-
Notifications
You must be signed in to change notification settings - Fork 599
Description
Hello,
We are using open_file in our Flutter project and recently received a Google Play policy compliance notice regarding the Photo and Video Permissions policy. According to this policy, apps must remove the READ_MEDIA_IMAGES and READ_MEDIA_VIDEO permissions unless they are essential for core functionality.
Issue
Currently, open_file requests READ_MEDIA_IMAGES, READ_MEDIA_VIDEO, and READ_MEDIA_AUDIO permissions, even when they are not required to open files. This behavior is problematic because:
Google Play is enforcing a stricter permission policy starting January 22, 2025.
If an app retains these permissions without a valid reason, it risks removal from the Play Store.
Opening files using system tools (e.g., Media Provider, Photo Picker, SAF) does not require these permissions.
Removing these permissions from our native code does not affect functionality, meaning they are unnecessary in open_file.
Code Reference in doOpen() Method
The following snippet unnecessarily blocks file opening if READ_MEDIA_* permissions are not granted:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU && FileUtil.isExternalStoragePublicMedia(filePath, mimeType)) {
if (FileUtil.isImage(mimeType) && !hasPermission(Manifest.permission.READ_MEDIA_IMAGES) && !Environment.isExternalStorageManager()) {
result(-3, "Permission denied: " + Manifest.permission.READ_MEDIA_IMAGES);
return;
}
if (FileUtil.isVideo(mimeType) && !hasPermission(Manifest.permission.READ_MEDIA_VIDEO) && !Environment.isExternalStorageManager()) {
result(-3, "Permission denied: " + Manifest.permission.READ_MEDIA_VIDEO);
return;
}
if (FileUtil.isAudio(mimeType) && !hasPermission(Manifest.permission.READ_MEDIA_AUDIO) && !Environment.isExternalStorageManager()) {
result(-3, "Permission denied: " + Manifest.permission.READ_MEDIA_AUDIO);
return;
}
}
Request
To ensure compliance with Google Play policies, we request the following changes:
Remove or make READ_MEDIA_* permissions optional in open_file.
Use alternative solutions (e.g., MediaStore, SAF, or Intent.ACTION_VIEW) that do not require broad storage access.
Ensure apps can use open_file without unnecessary permission requests, to comply with Google Play policies.
Google Play Policy Reference:
Google Play Photo and Video Permissions Policy
This issue affects all developers using open_file. If not resolved, apps using this library may fail Play Store compliance checks starting January 22, 2025.
Thank you for your work on this package! Looking forward to your response. 🚀