remove write external storage permission only on android 11

This commit is contained in:
Ivan Pusic 2021-07-19 20:23:09 +02:00
parent 2437d998ac
commit f63a954547
No known key found for this signature in database
GPG Key ID: 3DA903AB9F026DE9
1 changed files with 2 additions and 2 deletions

View File

@ -227,8 +227,8 @@ class PickerModule extends ReactContextBaseJavaModule implements ActivityEventLi
List<String> missingPermissions = new ArrayList<>();
List<String> supportedPermissions = new ArrayList<>(requiredPermissions);
// we should not ask for WRITE_EXTERNAL_STORAGE when android on version with scoped storage
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.P) {
// android 11 introduced scoped storage, and WRITE_EXTERNAL_STORAGE no longer works there
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) {
supportedPermissions.remove(Manifest.permission.WRITE_EXTERNAL_STORAGE);
}