From faa4615ee00fbe31eb1098fd912c9e7c22ee47f2 Mon Sep 17 00:00:00 2001 From: ravi-yk <107058879+ravi-yk@users.noreply.github.com> Date: Thu, 24 Oct 2024 22:08:18 +0530 Subject: [PATCH] Remove media permissions to make complaint with Android 14 requirements (#889) Co-authored-by: Ravi Yakasiri --- plugin.xml | 4 +--- src/android/CameraLauncher.java | 19 ++----------------- 2 files changed, 3 insertions(+), 20 deletions(-) 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);