Simon MacDonald created CB-11396:
------------------------------------

             Summary: Audio Media Capture Crashes if app stores file on 
external storage
                 Key: CB-11396
                 URL: https://issues.apache.org/jira/browse/CB-11396
             Project: Apache Cordova
          Issue Type: Bug
          Components: Plugin Media Capture
         Environment: Android
            Reporter: Simon MacDonald
            Assignee: Simon MacDonald


I’ll go over the issue that we were seeing and that we want to address with 
this fix:

- The app crashes when returning from the recorder application (RecForge) when 
it tries to get the recorded audio – in onAudioActivityResult.
- This only happens if the app doesn’t already have the READ_EXTERNAL_STORAGE 
permission already allowed. If the permissions for image get accepted this 
issue will not reproduce anymore.
- The READ_EXTERNAL_STORAGE is part of the manifest but is not requesting 
permissions from anywhere else except this plugin.

Stack trace:

java.lang.SecurityException: Permission Denial: reading 
com.android.providers.media.MediaProvider uri 
content://media/external/audio/media/8706 from pid=12598, uid=10333 requires 
android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
            at android.os.Parcel.readException(Parcel.java:1599)
            at 
android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183)
            at 
android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
            at 
android.content.ContentProviderProxy.query(ContentProviderNative.java:421)
            at android.content.ContentResolver.query(ContentResolver.java:491)
            at android.content.ContentResolver.query(ContentResolver.java:434)
            at 
org.apache.cordova.CordovaResourceApi.mapUriToFile(CordovaResourceApi.java:154)
            at 
org.apache.cordova.mediacapture.Capture.createMediaFile(Capture.java:465)
            at 
org.apache.cordova.mediacapture.Capture.onAudioActivityResult(Capture.java:364)
            at org.apache.cordova.mediacapture.Capture$1.run(Capture.java:321)
            at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
            at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
            at java.lang.Thread.run(Thread.java:818)




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to