I'm received the output path that i can't access because It's custom content provider on android
Asked Answered
D

0

2

I'm received the output path(EXTRA_OUTPUT) that i can't access because It's custom content provider on android.

My app is supporting the IMAGE_CAPTURE for other apps. but my app isn't works when I received the capture intent by the chrome browser. I had debugging and I found the invalid URI from intent by the Chrome browser. It's URI of custom content provider that I don't have access permission.

I have to compress my bitmap to output path(EXTRA_OUTPUT) for retrun the result. but If i access the uri. my app occurs the SecurityException. How can i write capure bitmap to this uri ?

The chrome browser is sent me the uri for custom content provider.

Bundle[{output=content://com.android.chrome.FileProvider/images/1460353414880661298992.jpg}]

ex content://com.android.chrome.FileProvider/images/14603482183391770716616.jpg

if i'm try to get the file path to call the query 'context.getContentResolver().query(receiverURI)', It throw SecurityException.

It's same when to open outputStream context.getContentResolver().openOutputStream(uri);

java.lang.SecurityException:
Permission Denial: opening provider org.chromium.chrome.browser.util.CompatibilityFileProvider

How i can write my bitmap to the output uri the received by chrome browser app ?

Dx answered 11/4, 2016 at 9:30 Comment(2)
intent.setFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);Dx
That sounds like a bug in Chrome. If they gave you the Uri, they need to include the flags to allow you to consume the content.Puca

© 2022 - 2024 — McMap. All rights reserved.