[
https://issues.apache.org/jira/browse/CB-5398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13823835#comment-13823835
]
Mike Billau commented on CB-5398:
---------------------------------
This exists on 3.x as well.
In the mean time a workaround is to go through the "Gallery" app.
So when it says "Recent", "Drive", "Images", and "Downloads", at the bottom of
that list will be "Gallery". As far as I can tell this opens up the Gallery app
and then you can navigate through those folders and select any of the photos.
I'm getting this in LOGCAT:
{noformat}
11-15 12:16:24.017: D/CordovaActivity(7351): Incoming Result
11-15 12:16:24.017: D/CordovaActivity(7351): Request code = 50
11-15 12:16:24.017: D/CordovaActivity(7351): We have a callback to send this
result to
11-15 12:16:24.037: D/dalvikvm(7351): GC_FOR_ALLOC freed 34K, 3% free
16572K/17084K, paused 8ms, total 8ms
11-15 12:16:24.057: I/dalvikvm-heap(7351): Grow heap (frag case) to 46.700MB
for 31961104-byte allocation
11-15 12:16:24.067: D/dalvikvm(7351): GC_FOR_ALLOC freed <1K, 2% free
47783K/48300K, paused 9ms, total 9ms
11-15 12:16:24.227: E/DatabaseUtils(4667): Writing exception to parcel
11-15 12:16:24.227: E/DatabaseUtils(4667): java.lang.SecurityException:
Permission Denial: reading com.android.providers.media.MediaDocumentsProvider
uri content://com.android.providers.media.documents/document/image:59 from
pid=7351, uid=10083 requires android.permission.MANAGE_DOCUMENTS, or
grantUriPermission()
11-15 12:16:24.227: E/DatabaseUtils(4667): at
android.content.ContentProvider$Transport.enforceReadPermissionInner(ContentProvider.java:457)
11-15 12:16:24.227: E/DatabaseUtils(4667): at
android.content.ContentProvider$Transport.enforceReadPermission(ContentProvider.java:394)
11-15 12:16:24.227: E/DatabaseUtils(4667): at
android.content.ContentProvider$Transport.enforceFilePermission(ContentProvider.java:387)
11-15 12:16:24.227: E/DatabaseUtils(4667): at
android.content.ContentProvider$Transport.openTypedAssetFile(ContentProvider.java:339)
11-15 12:16:24.227: E/DatabaseUtils(4667): at
android.content.ContentProviderNative.onTransact(ContentProviderNative.java:305)
11-15 12:16:24.227: E/DatabaseUtils(4667): at
android.os.Binder.execTransact(Binder.java:404)
11-15 12:16:24.227: E/DatabaseUtils(4667): at
dalvik.system.NativeStart.run(Native Method)
11-15 12:16:24.237: E/AndroidProtocolHandler(7351): Unable to open content URL:
content://com.android.providers.media.documents/document/image%3A59
11-15 12:16:24.247: D/dalvikvm(7351): GC_EXPLICIT freed 31233K, 4% free
16554K/17084K, paused 2ms+2ms, total 25ms
11-15 12:16:24.247: D/Whitelist(7351): Unlimited access to network resources
11-15 12:16:24.247: I/CordovaLog(7351): Found start page location: index.html
11-15 12:16:24.247: I/CordovaLog(7351): Changing log level to DEBUG(3)
11-15 12:16:24.247: D/CordovaActivity(7351): Resuming the App
11-15 12:16:24.247: D/CordovaActivity(7351): CB-3064: The errorUrl is null
11-15 12:16:24.247: D/CordovaLog(7351):
file:///android_asset/www/camera/index.html: Line 58 : URL:
content://com.android.providers.media.documents/document/image%3A59
11-15 12:16:24.247: I/chromium(7351): [INFO:CONSOLE(58)] "URL:
content://com.android.providers.media.documents/document/image%3A59", source:
file:///android_asset/www/camera/index.html (58)
{noformat}
Looks like there is a new permission: MANAGE_DOCUMENTS:
http://developer.android.com/reference/android/Manifest.permission.html#MANAGE_DOCUMENTS
I tried to add {{android.permission.MANAGE_DOCUMENTS}} to the
AndroidManifest.xml but even after doing this, compiling with ADB and
installing, I'm still getting the above error and still unable to pick any
photos unless I go through the "Gallery" app first. I made sure to set
targetSDK=19 which is when this new permission was added.
[~bowserj] do you have any ideas on why Android wouldn't be picking up the new
permission? Is the problem in {{DatabaseUtils}} that I assume is some Android
app?
> Pick image from Library or Photo album on android 4.4
> -----------------------------------------------------
>
> Key: CB-5398
> URL: https://issues.apache.org/jira/browse/CB-5398
> Project: Apache Cordova
> Issue Type: Bug
> Components: Android, Plugin Camera
> Affects Versions: 2.9.0, 3.2.0
> Environment: android 4.4
> Reporter: julio cesar
> Assignee: Mike Billau
>
> An android 4.4 try to pick a photo using pictureSource.PHOTOLIBRARY or
> pictureSource.SAVEDPHOTOALBUM and return type destinationType.FILE_URI.
> Now android 4.4, when you select the above options, it opens an "open from"
> dialog that let you choose from new places as "Recent", "Drive", "Images"
> and "Downloads" (the names might not be the same as I use the device in
> spanish and translated it).
> If you choose any of them, you get an error, AndroidProtocolHandler, unable
> to open content URL: the url here with a content://com.android.providers
> format.
> I've tested on phonegap 2.9 because this is the version I use, but I suppose
> it affects all of them. (in fact I use 2.9.1)
--
This message was sent by Atlassian JIRA
(v6.1#6144)