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

家住魔仙堡 提交于 2019-12-05 03:43:06

问题


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 ?

来源:https://stackoverflow.com/questions/36544838/im-received-the-output-path-that-i-cant-access-because-its-custom-content-pro

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!