-
Notifications
You must be signed in to change notification settings - Fork 498
fix(android): remove broad media permissions #295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(android): remove broad media permissions #295
Conversation
The In otherwords, scoped storage is always enforced today on API 29+ devices. |
This comment was marked as outdated.
This comment was marked as outdated.
b1a2766
to
c4838ae
Compare
c4838ae
to
319bf5c
Compare
* feat(android): remove broad camera permissions * chore(android): prefer List over ArrayList when possible
Platforms affected
Android
Motivation and Context
As discussed on #288, broad media permissions (
READ_MEDIA_IMAGES
,READ_MEDIA_VIDEO
,READ_MEDIA_AUDIO
) policy will be enforced on August 31, 2024, threatening the Google Play approval of apps using this plugin.The purpose of this PR is to not use broad media permissions.
Description
My understanding is that, we don't need these permissions in the first place.
I would be interested to know why the changes of #262 were considered necessary at the time, am I missing something?
Here are the requirements that I've gathered:
READ_EXTERNAL_STORAGE
andWRITE_EXTERNAL_STORAGE
are needed to "access any media file"EXTERNAL_STORAGE
permissionsMediaCapture
intent, save the media file to theMediaStore.Images
collection and read it later because you "own" the fileFor Android 10, I would suggest this plugin be resilient to handle apps that have opted-out of scoped storage by using the
android:requestLegacyExternalStorage="true"
configuration.With these information in mind, here is what I've changed:
READ_EXTERNAL_STORAGE
andWRITE_EXTERNAL_STORAGE
declared in the manifest and asked at runtime only for Android up to 10READ_MEDIA_IMAGES
,READ_MEDIA_VIDEO
,READ_MEDIA_AUDIO
from the manifest and runtime request.Testing
I have tested an image capture on Android 14, 13, 12L, 11, 10 and 9: the photo app opens, the file is well saved and can be read.
I there a documentation on how to run the unit-tests ?
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)