Skip to content

Commit b605eb1

Browse files
authored
Merge branch 'main' into feat-sponsor
2 parents b0ecd0a + 44053cd commit b605eb1

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/plugins/terminal/src/android/AlpineDocumentProvider.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,7 @@
2424
public class AlpineDocumentProvider extends DocumentsProvider {
2525

2626
private static final String ALL_MIME_TYPES = "*/*";
27-
private static final File BASE_DIR = new File("/data/data/com.foxdebug.acode/files/public");
2827

29-
public AlpineDocumentProvider(){
30-
if (!BASE_DIR.exists()) {
31-
BASE_DIR.mkdirs();
32-
}
33-
}
3428

3529
// The default columns to return information about a root if no specific
3630
// columns are requested in a query.
@@ -58,6 +52,11 @@ public AlpineDocumentProvider(){
5852

5953
@Override
6054
public Cursor queryRoots(String[] projection) {
55+
File BASE_DIR = new File(getContext().getFilesDir(),"public");
56+
if (!BASE_DIR.exists()) {
57+
BASE_DIR.mkdirs();
58+
}
59+
6160
MatrixCursor result = new MatrixCursor(
6261
projection != null ? projection : DEFAULT_ROOT_PROJECTION
6362
);
@@ -185,6 +184,10 @@ public Cursor querySearchDocuments(
185184
String query,
186185
String[] projection
187186
) throws FileNotFoundException {
187+
File BASE_DIR = new File(getContext().getFilesDir(),"public");
188+
if (!BASE_DIR.exists()) {
189+
BASE_DIR.mkdirs();
190+
}
188191
MatrixCursor result = new MatrixCursor(
189192
projection != null ? projection : DEFAULT_DOCUMENT_PROJECTION
190193
);

0 commit comments

Comments
 (0)