- MediaStore crashed on deletion because the ViewPagerActivity got finish before the MediaStore.createDeleteRequest executes
- To fix, we apply the same approach in the MediaActivity and finish explicitly after deletion completes, if the media list is empty
- also, only refresh the UI when the media list is not empty to avoid UI glitches
- fix slideshow bug by resetting mAreSlideShowMediaVisible back to false when the slideshow ends
- on SDK 31+, if the app can manange media, we want to use the MediaStore request way of deleting files
- we use the new method added BaseSimpleActivity.checkManageMediaOrHandleSAFDialogSdk30 that performs the check and determines if we should show the SAF dialog or not
- users should not be able to pick restricted folders in PickDirectoryDialog when copying/moving files on SDK 30+
- show nice error message R.string.system_folder_restriction when user picks a restricted folder on SDK 30+
- restricted folders on SDK 30+ are: Android, Root of Internal and SDCard. The Download directory is writable
- the app has declared the MANAGE_MEDIA permission in the AndroidManifest
- also requesting the ACCESS_MEDIA_LOCATION permission will make the system not to show the user the prompts from MediaStore.createWriteRequest and MediaStore.createDeleteRequest
- when file is on the root of Internal Storage or SD Card, change the destination to the /Pictures folder, we cannot write to the root of any volume on SDK 30+
- call handleSAFDialogSdk30, so users are prompted to allow SAF when restoring, if not previously allowed
- if there are conflicts, handle it as though it's a CONFLICT_KEEP_BOTH by appending some characters to the destination name
- add new string restore_to_path shown when restoring to /Pictures folder on SDK 30+ instead of the root folder
- show error message when a user tries to rename a file on the root of the SD Card in ViewPagerActivity and MediaAdapter
- in PickDirectoryDialog, use the Activity.isAStorageRootFolder method instead of String.isBasePath
- handle WRITE_STORAGE permission in EditActivity
- in PickDirectoryDialog replace error message when users select a restricted system directory to R.string.system_folder_restriction
- in SaveDialog
- if path is a restricted path, automatically change it to {CURRENT_VOLUME}/Pictures directory.
- if there is conflict and the file is direct child of the Download folder, show the user a prompt to grant WRITE request permission
- remove unused string R.string.copy_to_restricted_folder_message
- in NewPhotoEditActivity and NewVideoEditActivity, only delete SD Card file on conflict for devices running lower than SDK 30
- update commons module