Skip to content
Permalink
Browse files
CB-14260: (android) captureImage permission denial on android 8.1 (#95)
* CB-14260: (android) captureImage permission denial on android 8.1
  • Loading branch information
mcelotti authored and jcesarmobile committed Sep 21, 2018
1 parent 5815be4 commit 3755f9f7374cb6434ddbf67e8c5e800671b939f5
Showing 1 changed file with 3 additions and 3 deletions.
@@ -251,16 +251,16 @@ private String getTempDirectoryPath() {
*/
private void captureImage(Request req) {
boolean needExternalStoragePermission =
!PermissionHelper.hasPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE);
!PermissionHelper.hasPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);

boolean needCameraPermission = cameraPermissionInManifest &&
!PermissionHelper.hasPermission(this, Manifest.permission.CAMERA);

if (needExternalStoragePermission || needCameraPermission) {
if (needExternalStoragePermission && needCameraPermission) {
PermissionHelper.requestPermissions(this, req.requestCode, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.CAMERA});
PermissionHelper.requestPermissions(this, req.requestCode, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA});
} else if (needExternalStoragePermission) {
PermissionHelper.requestPermission(this, req.requestCode, Manifest.permission.READ_EXTERNAL_STORAGE);
PermissionHelper.requestPermission(this, req.requestCode, Manifest.permission.WRITE_EXTERNAL_STORAGE);
} else {
PermissionHelper.requestPermission(this, req.requestCode, Manifest.permission.CAMERA);
}

0 comments on commit 3755f9f

Please sign in to comment.