diff --git a/plugin.xml b/plugin.xml index c8ce7f5..21eb79b 100644 --- a/plugin.xml +++ b/plugin.xml @@ -55,9 +55,7 @@ - - - + permissions = new ArrayList<>(); - if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - // Android API 33 and higher - switch (mediaType) { - case PICTURE: - permissions.add(Manifest.permission.READ_MEDIA_IMAGES); - break; - case VIDEO: - permissions.add(Manifest.permission.READ_MEDIA_VIDEO); - break; - default: - permissions.add(Manifest.permission.READ_MEDIA_IMAGES); - permissions.add(Manifest.permission.READ_MEDIA_VIDEO); - break; - } - } else { - // Android API 32 or lower + if (android.os.Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) { + // Android API 30 or lower permissions.add(Manifest.permission.READ_EXTERNAL_STORAGE); permissions.add(Manifest.permission.WRITE_EXTERNAL_STORAGE); } - if (!storageOnly) { // Add camera permission when not storage. permissions.add(Manifest.permission.CAMERA);