Skip to content

Commit

Permalink
Enable partial media picking in Marketplace (facebook#38880)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#38880

Users who interact with your app on Android 14 devices can now grant partial access to their visual media library (Photos/Videos) when an app requests any visual media permissions (READ_MEDIA_IMAGES or READ_MEDIA_VIDEO) introduced in Android 13 (API level 33).

This diff allow enable the partial access via "READ_MEDIA_VISUAL_USER_SELECTED" in Marketplace photo picker

For Android 14 this diff request partial media access plus the normal access, there will be two return cases:
- READ_MEDIA_VISUAL_USER_SELECTED is granted, READ_MEDIA_IMAGES and READ_MEDIA_VIDEO will be denied automatically, there is no need to check the later ones
- READ_MEDIA_VISUAL_USER_SELECTED is denied, then check READ_MEDIA_IMAGES and READ_MEDIA_VIDEO

Changelog:
[Android][Changed] - Enable partial media picking in Marketplace

Reviewed By: NickGerleman

Differential Revision: D48171193

fbshipit-source-id: 6e8d022a81b2e32108cd57b30ad5ce148be17c5a
  • Loading branch information
Lulu Wu authored and facebook-github-bot committed Aug 9, 2023
1 parent c956a1b commit 372575c
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ const PERMISSIONS = Object.freeze({
READ_MEDIA_IMAGES: 'android.permission.READ_MEDIA_IMAGES',
READ_MEDIA_VIDEO: 'android.permission.READ_MEDIA_VIDEO',
READ_MEDIA_AUDIO: 'android.permission.READ_MEDIA_AUDIO',
READ_MEDIA_VISUAL_USER_SELECTED:
'android.permission.READ_MEDIA_VISUAL_USER_SELECTED',
WRITE_EXTERNAL_STORAGE: 'android.permission.WRITE_EXTERNAL_STORAGE',
BLUETOOTH_CONNECT: 'android.permission.BLUETOOTH_CONNECT',
BLUETOOTH_SCAN: 'android.permission.BLUETOOTH_SCAN',
Expand Down Expand Up @@ -115,6 +117,7 @@ class PermissionsAndroid {
READ_MEDIA_IMAGES: string,
READ_MEDIA_VIDEO: string,
READ_MEDIA_AUDIO: string,
READ_MEDIA_VISUAL_USER_SELECTED: string,
READ_PHONE_NUMBERS: string,
READ_PHONE_STATE: string,
READ_SMS: string,
Expand Down Expand Up @@ -287,7 +290,6 @@ class PermissionsAndroid {
NativePermissionsAndroid,
'PermissionsAndroid is not installed correctly.',
);

return NativePermissionsAndroid.requestMultiplePermissions(permissions);
}
}
Expand Down

0 comments on commit 372575c

Please sign in to comment.