[Android] Force displaying the permission dialog if it has previously exited without explicit choice

Nicolas Pomepuy git at videolan.org
Mon Sep 28 13:40:07 CEST 2020


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Fri Sep 25 10:03:16 2020 +0200| [6cbd8ba5a61b8d024de0b1ae601677c043b881ad] | committer: Nicolas Pomepuy

Force displaying the permission dialog if it has previously exited without explicit choice

> https://code.videolan.org/videolan/vlc-android/commit/6cbd8ba5a61b8d024de0b1ae601677c043b881ad
---

 .../src/org/videolan/vlc/gui/helpers/hf/StoragePermissionsDelegate.kt   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/helpers/hf/StoragePermissionsDelegate.kt b/application/vlc-android/src/org/videolan/vlc/gui/helpers/hf/StoragePermissionsDelegate.kt
index c3b75d38f..cde872470 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/helpers/hf/StoragePermissionsDelegate.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/helpers/hf/StoragePermissionsDelegate.kt
@@ -132,7 +132,7 @@ class StoragePermissionsDelegate : BaseHeadlessFragment() {
         suspend fun FragmentActivity.getStoragePermission(write: Boolean = false) : Boolean {
             if (isFinishing) return false
             val model : PermissionViewmodel by viewModels()
-            if (model.isCompleted) return model.deferredGrant.getCompleted()
+            if (model.isCompleted && storageAccessGranted.value == true) return model.deferredGrant.getCompleted()
             if (!model.permissionPending) {
                 model.setupDeferred()
                 val fragment = StoragePermissionsDelegate().apply {



More information about the Android mailing list