You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling the app using the ACTION_GET_CONTENT intent, I have noticed the app returns a content provider on Android N (API 24) and above. On older versions it simply returns the file url. (see FileOpener.getUriFromFile)
I think it would be nice to lower the version where a content provider is returned. Since the app returns the FLAG_GRANT_READ_URI_PERMISSION flag in the intent, the app which initiated the request expects to be able to read the selected file. But unless the app has READ_EXTERNAL_STORAGE permission, it cannot. If a content provider was used, it could still open the file. I am not sure what the argument is for returning a file url, perhaps content providers are not supported on older versions?
An alternative is to not include the FLAG_GRANT_READ_URI_PERMISSION flag when a file url is returned. The calling app then still can't open the file, but at least it knows.
I have tested this on Android 4.4.
The text was updated successfully, but these errors were encountered:
When calling the app using the ACTION_GET_CONTENT intent, I have noticed the app returns a content provider on Android N (API 24) and above. On older versions it simply returns the file url. (see FileOpener.getUriFromFile)
I think it would be nice to lower the version where a content provider is returned. Since the app returns the FLAG_GRANT_READ_URI_PERMISSION flag in the intent, the app which initiated the request expects to be able to read the selected file. But unless the app has READ_EXTERNAL_STORAGE permission, it cannot. If a content provider was used, it could still open the file. I am not sure what the argument is for returning a file url, perhaps content providers are not supported on older versions?
An alternative is to not include the FLAG_GRANT_READ_URI_PERMISSION flag when a file url is returned. The calling app then still can't open the file, but at least it knows.
I have tested this on Android 4.4.
The text was updated successfully, but these errors were encountered: