[ 
https://issues.apache.org/jira/browse/CB-14260?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16624297#comment-16624297
 ] 

ASF GitHub Bot commented on CB-14260:
-------------------------------------

jcesarmobile closed pull request #95: CB-14260: (android) captureImage 
permission denial on android 8.1
URL: https://github.com/apache/cordova-plugin-media-capture/pull/95
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/src/android/Capture.java b/src/android/Capture.java
index 40117aa..24578bc 100644
--- a/src/android/Capture.java
+++ b/src/android/Capture.java
@@ -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);
             }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> captureImage: permission denial on android 8.1
> ----------------------------------------------
>
>                 Key: CB-14260
>                 URL: https://issues.apache.org/jira/browse/CB-14260
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-plugin-media-capture
>    Affects Versions: 3.0.0
>            Reporter: Marco
>            Priority: Major
>
> When I call "captureImage" method I accept all permissions but I get:
> {noformat}
> java.lang.SecurityException: Permission Denial: writing 
> com.android.providers.media.MediaProvider uri 
> content://media/external/images/media from pid=12716, uid=10079 requires 
> android.permission.WRITE_EXTERNAL_STORAGE, or grantUriPermission(){noformat}
> I'm using cordova-plugin-media-capture version 3.0.2



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to