mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-02-09 08:38:40 +01:00
improve storage permission handling to fix an Android 11 issue
This commit is contained in:
parent
e7cb91cd34
commit
cbf831bd31
@ -436,22 +436,27 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||
}
|
||||
|
||||
private fun tryLoadGallery() {
|
||||
if (hasPermission(PERMISSION_WRITE_STORAGE)) {
|
||||
if (!config.wasUpgradedFromFreeShown && isPackageInstalled("com.simplemobiletools.gallery")) {
|
||||
ConfirmationDialog(this, "", R.string.upgraded_from_free, R.string.ok, 0) {}
|
||||
config.wasUpgradedFromFreeShown = true
|
||||
}
|
||||
handlePermission(PERMISSION_WRITE_STORAGE) {
|
||||
if (it) {
|
||||
if (!config.wasUpgradedFromFreeShown && isPackageInstalled("com.simplemobiletools.gallery")) {
|
||||
ConfirmationDialog(this, "", R.string.upgraded_from_free, R.string.ok, 0) {}
|
||||
config.wasUpgradedFromFreeShown = true
|
||||
}
|
||||
|
||||
checkOTGPath()
|
||||
checkDefaultSpamFolders()
|
||||
checkOTGPath()
|
||||
checkDefaultSpamFolders()
|
||||
|
||||
if (config.showAll) {
|
||||
showAllMedia()
|
||||
if (config.showAll) {
|
||||
showAllMedia()
|
||||
} else {
|
||||
getDirectories()
|
||||
}
|
||||
|
||||
setupLayoutManager()
|
||||
} else {
|
||||
getDirectories()
|
||||
toast(R.string.no_storage_permissions)
|
||||
finish()
|
||||
}
|
||||
|
||||
setupLayoutManager()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user