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

Nicolas Pomepuy git at videolan.org
Tue Oct 6 10:58:46 CEST 2020


vlc-android | branch: 3.3.x | Nicolas Pomepuy <nicolas at videolabs.io> | Fri Sep 25 10:03:16 2020 +0200| [1976e83088a1a238bd4933d344931f4f17106451] | committer: Nicolas Pomepuy

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

(cherry picked from commit 6cbd8ba5a61b8d024de0b1ae601677c043b881ad)

> https://code.videolan.org/videolan/vlc-android/commit/1976e83088a1a238bd4933d344931f4f17106451
---

 .../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