From d29c767f07a238eccdf74062d45578712d8d0e34 Mon Sep 17 00:00:00 2001 From: Sergey Zolotarev Date: Fri, 27 Jan 2017 01:41:56 +0600 Subject: [PATCH] CB-12368: Fix permission check on Android The plugin was checking whether camera permission was granted but then actually requested permission for external storage. Surprisingly enough this fixed CB-12368. --- src/android/CameraLauncher.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/android/CameraLauncher.java b/src/android/CameraLauncher.java index e3ee20b..3970634 100644 --- a/src/android/CameraLauncher.java +++ b/src/android/CameraLauncher.java @@ -185,7 +185,7 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect } else if ((this.srcType == PHOTOLIBRARY) || (this.srcType == SAVEDPHOTOALBUM)) { // FIXME: Stop always requesting the permission - if(!PermissionHelper.hasPermission(this, permissions[0])) { + if(!PermissionHelper.hasPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE)) { PermissionHelper.requestPermission(this, SAVE_TO_ALBUM_SEC, Manifest.permission.READ_EXTERNAL_STORAGE); } else { this.getImage(this.srcType, destType, encodingType);