mirror of
https://github.com/apache/cordova-plugin-camera.git
synced 2025-01-18 19:22:51 +08:00
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.
This commit is contained in:
parent
0ad5bdd9ff
commit
d29c767f07
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user