Skip to content

Commit

Permalink
Update TermuxDocumentsProvider.java,尝试在文件提供器中显示usr文件夹
Browse files Browse the repository at this point in the history
  • Loading branch information
ewt45 authored Mar 9, 2024
1 parent 3e8ffbb commit ba03960
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class TermuxDocumentsProvider extends DocumentsProvider {

private static final String ALL_MIME_TYPES = "*/*";

private static final File BASE_DIR = TermuxConstants.TERMUX_HOME_DIR;
private static final File BASE_DIR = TermuxConstants.TERMUX_FILES_DIR;


// The default columns to return information about a root if no specific
Expand Down Expand Up @@ -169,13 +169,13 @@ public Cursor querySearchDocuments(String rootId, String query, String[] project
final File file = pending.removeFirst();
// Avoid directories outside the $HOME directory linked with symlinks (to avoid e.g. search
// through the whole SD card).
boolean isInsideHome;
boolean isInsideFiles;
try {
isInsideHome = file.getCanonicalPath().startsWith(TermuxConstants.TERMUX_HOME_DIR_PATH);
isInsideFiles = file.getCanonicalPath().startsWith(TermuxConstants.TERMUX_FILES_DIR_PATH);
} catch (IOException e) {
isInsideHome = true;
isInsideFiles = true;
}
if (isInsideHome) {
if (isInsideFiles) {
if (file.isDirectory()) {
Collections.addAll(pending, file.listFiles());
} else {
Expand Down

0 comments on commit ba03960

Please sign in to comment.