From f63a9545479f8f488c3738d3b4ca9cab241ced78 Mon Sep 17 00:00:00 2001 From: Ivan Pusic <450140+ivpusic@users.noreply.github.com> Date: Mon, 19 Jul 2021 20:23:09 +0200 Subject: [PATCH] remove write external storage permission only on android 11 --- .../com/reactnative/ivpusic/imagepicker/PickerModule.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/src/main/java/com/reactnative/ivpusic/imagepicker/PickerModule.java b/android/src/main/java/com/reactnative/ivpusic/imagepicker/PickerModule.java index b492ee2..9db3825 100644 --- a/android/src/main/java/com/reactnative/ivpusic/imagepicker/PickerModule.java +++ b/android/src/main/java/com/reactnative/ivpusic/imagepicker/PickerModule.java @@ -227,8 +227,8 @@ class PickerModule extends ReactContextBaseJavaModule implements ActivityEventLi List missingPermissions = new ArrayList<>(); List 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); }