[ https://issues.apache.org/jira/browse/CB-10825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15188348#comment-15188348 ]
ASF GitHub Bot commented on CB-10825: ------------------------------------- Github user macdonst commented on the pull request: https://github.com/apache/cordova-plugin-camera/pull/191#issuecomment-194582918 @riknoll if you call getPicture() to read from the gallery shouldn't it request READ permission before opening the gallery? > Permission not being requested for photolibrary source > ------------------------------------------------------ > > Key: CB-10825 > URL: https://issues.apache.org/jira/browse/CB-10825 > Project: Apache Cordova > Issue Type: Bug > Components: Plugin Camera > Reporter: Richard B Knoll > Priority: Critical > Labels: android, regression, reproduced, triaged > > We get a SecurityException for certain cameraOptions in Marshmallow because > we do not request the READ_EXTERNAL_STORAGE permission. Here is a repro set: > {code} > { > saveToPhotoAlbum: false, > targetHeight: -1, > targetWidth: -1, > allowEdit: false, > correctOrientation: false, > destinationType: Camera.DestinationType.FILE_URI, > mediaType: Camera.MediaType.PICTURE, > encodingType: 1, > sourceType: Camera.PictureSourceType.SAVEDPHOTOALBUM > } > {code} > Stack trace: > {code} > DatabaseUtils: Writing exception to parcel > DatabaseUtils: java.lang.SecurityException: Permission Denial: reading > com.android.providers.media.MediaProvider uri > content://media/external/images/media requires > android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission() > DatabaseUtils: at > android.content.ContentProvider.enforceReadPermissionInner(ContentProvider.java:605) > DatabaseUtils: at > android.content.ContentProvider$Transport.enforceReadPermission(ContentProvider.java:480) > DatabaseUtils: at > android.content.ContentProvider$Transport.query(ContentProvider.java:211) > DatabaseUtils: at > android.content.ContentProviderNative.onTransact(ContentProviderNative.java:112) > DatabaseUtils: at android.os.Binder.execTransact(Binder.java:453) > AndroidRuntime: FATAL EXCEPTION: pool-1-thread-2 > AndroidRuntime: Process: io.cordova.hellocordova > AndroidRuntime: java.lang.SecurityException: Permission Denial: reading > com.android.providers.media.MediaProvider uri > content://media/external/images/media requires > android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission() > AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1620) > AndroidRuntime: at > android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183) > AndroidRuntime: at > android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135) > AndroidRuntime: at > android.content.ContentProviderProxy.query(ContentProviderNative.java:421) > AndroidRuntime: at > android.content.ContentResolver.query(ContentResolver.java:491) > AndroidRuntime: at > android.content.ContentResolver.query(ContentResolver.java:434) > AndroidRuntime: at > org.apache.cordova.camera.FileHelper.getDataColumn(FileHelper.java:292) > AndroidRuntime: at > org.apache.cordova.camera.FileHelper.getRealPathFromURI_API19(FileHelper.java:128) > AndroidRuntime: at > org.apache.cordova.camera.FileHelper.getRealPath(FileHelper.java:64) > AndroidRuntime: at > org.apache.cordova.camera.CameraLauncher.processResultFromGallery(CameraLauncher.java:623) > AndroidRuntime: at > org.apache.cordova.camera.CameraLauncher.access$000(CameraLauncher.java:66) > AndroidRuntime: at > org.apache.cordova.camera.CameraLauncher$1.run(CameraLauncher.java:781) > AndroidRuntime: at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) > AndroidRuntime: at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) > AndroidRuntime: at java.lang.Thread.run(Thread.java:818) > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org