Add check for isExternalStorageManager

- if the app (like Simple FileManger), is an External Storage Manager, then there is no need to use SAF
This commit is contained in:
darthpaul 2022-02-24 17:24:25 +00:00
parent 46c5529ec7
commit ad250836eb

View file

@ -164,13 +164,13 @@ fun Context.getSAFOnlyDirs(): List<String> {
}
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
}