From 5e4550d52bbf0b53a9c9767c98efa7ed6abcde4b Mon Sep 17 00:00:00 2001 From: darthpaul Date: Sat, 16 Apr 2022 11:44:22 +0100 Subject: [PATCH] fix: restore to android folder on SDK30 --- .../simplemobiletools/gallery/pro/extensions/Activity.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Activity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Activity.kt index cd887cd4b..767dd376e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Activity.kt @@ -346,10 +346,8 @@ fun BaseSimpleActivity.restoreRecycleBinPaths(paths: ArrayList, callback var destination = source.removePrefix(recycleBinPath) val destinationParent = destination.getParentPath() - val isAStorageRootFolder = isAStorageRootFolder(destinationParent) - if (isRPlus() && isAStorageRootFolder) { - // if the file is on the root of Internal Storage or SD Card, change it to Pictures - // we cannot write there on 30+ + if (isRestrictedWithSAFSdk30(destinationParent) && !isInDownloadDir(destinationParent)) { + // if the file is not writeable on SDK30+, change it to Pictures val picturesDirectory = getPicturesDirectoryPath(destination) destination = File(picturesDirectory, destination.getFilenameFromPath()).path if (!shownRestoringToPictures) {