From ad250836eb200a5820468be1ef967c83c80f0e7c Mon Sep 17 00:00:00 2001 From: darthpaul Date: Thu, 24 Feb 2022 17:24:25 +0000 Subject: [PATCH] Add check for isExternalStorageManager - if the app (like Simple FileManger), is an External Storage Manager, then there is no need to use SAF --- .../simplemobiletools/commons/extensions/Context-storage.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context-storage.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context-storage.kt index 5f92d489c..2519b986b 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context-storage.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context-storage.kt @@ -164,13 +164,13 @@ fun Context.getSAFOnlyDirs(): List { } fun Context.isAccessibleWithSAFSdk30(path: String): Boolean { - if(path.startsWith(filesDir.absolutePath)){ + if (path.startsWith(filesDir.absolutePath)) { return false } val firstParentPath = path.getFirstParentPath(this) val firstParentDir = path.getFirstParentDirName(this) - return isRPlus() && firstParentPath != path && + return isRPlus() && !Environment.isExternalStorageManager() && firstParentPath != path && DIRS_INACCESSIBLE_WITH_SAF_SDK_30.all { firstParentDir != it }