From ba039609610447fd1875fb6df28a5787938f48aa Mon Sep 17 00:00:00 2001 From: ewt45 <79033456+ewt45@users.noreply.github.com> Date: Sat, 9 Mar 2024 19:11:50 +0800 Subject: [PATCH] =?UTF-8?q?Update=20TermuxDocumentsProvider.java=EF=BC=8C?= =?UTF-8?q?=E5=B0=9D=E8=AF=95=E5=9C=A8=E6=96=87=E4=BB=B6=E6=8F=90=E4=BE=9B?= =?UTF-8?q?=E5=99=A8=E4=B8=AD=E6=98=BE=E7=A4=BAusr=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/termux/filepicker/TermuxDocumentsProvider.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/termux/filepicker/TermuxDocumentsProvider.java b/app/src/main/java/com/termux/filepicker/TermuxDocumentsProvider.java index 7974d6dbc1..a74d84ec49 100644 --- a/app/src/main/java/com/termux/filepicker/TermuxDocumentsProvider.java +++ b/app/src/main/java/com/termux/filepicker/TermuxDocumentsProvider.java @@ -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 @@ -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 {