mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-22 20:48:00 +01:00
Merge pull request #2415 from KryptKode/fix/restore_to_android_folder_sdk_30
fix: restore to android folder on SDK30
This commit is contained in:
commit
108ecf3c8c
1 changed files with 2 additions and 4 deletions
|
@ -346,10 +346,8 @@ fun BaseSimpleActivity.restoreRecycleBinPaths(paths: ArrayList<String>, callback
|
||||||
var destination = source.removePrefix(recycleBinPath)
|
var destination = source.removePrefix(recycleBinPath)
|
||||||
|
|
||||||
val destinationParent = destination.getParentPath()
|
val destinationParent = destination.getParentPath()
|
||||||
val isAStorageRootFolder = isAStorageRootFolder(destinationParent)
|
if (isRestrictedWithSAFSdk30(destinationParent) && !isInDownloadDir(destinationParent)) {
|
||||||
if (isRPlus() && isAStorageRootFolder) {
|
// if the file is not writeable on SDK30+, change it to Pictures
|
||||||
// if the file is on the root of Internal Storage or SD Card, change it to Pictures
|
|
||||||
// we cannot write there on 30+
|
|
||||||
val picturesDirectory = getPicturesDirectoryPath(destination)
|
val picturesDirectory = getPicturesDirectoryPath(destination)
|
||||||
destination = File(picturesDirectory, destination.getFilenameFromPath()).path
|
destination = File(picturesDirectory, destination.getFilenameFromPath()).path
|
||||||
if (!shownRestoringToPictures) {
|
if (!shownRestoringToPictures) {
|
||||||
|
|
Loading…
Reference in a new issue