From fe0822915d2121de11b679671f2462f7b101546f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pereda?= Date: Tue, 12 Nov 2024 17:43:49 +0100 Subject: [PATCH] Add new permissions to picture service (#409) --- .../android/dalvik/DalvikPicturesService.java | 14 +++++++++++--- .../META-INF/substrate/dalvik/AndroidManifest.xml | 3 +++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/modules/pictures/src/main/native/android/dalvik/DalvikPicturesService.java b/modules/pictures/src/main/native/android/dalvik/DalvikPicturesService.java index e1672a32..fa87be18 100644 --- a/modules/pictures/src/main/native/android/dalvik/DalvikPicturesService.java +++ b/modules/pictures/src/main/native/android/dalvik/DalvikPicturesService.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Gluon + * Copyright (c) 2020, 2024, Gluon * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -73,8 +73,16 @@ public DalvikPicturesService(Activity activity) { private boolean verifyPermissions() { if (!verified) { - verified = Util.verifyPermissions(Manifest.permission.CAMERA, - Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE); + if (Build.VERSION.SDK_INT >= 33) { + verified = Util.verifyPermissions(Manifest.permission.CAMERA, + Manifest.permission.READ_MEDIA_AUDIO, + Manifest.permission.READ_MEDIA_IMAGES, + Manifest.permission.READ_MEDIA_VIDEO); + } else { + verified = Util.verifyPermissions(Manifest.permission.CAMERA, + Manifest.permission.READ_EXTERNAL_STORAGE, + Manifest.permission.WRITE_EXTERNAL_STORAGE); + } } return verified; } diff --git a/modules/pictures/src/main/resources/META-INF/substrate/dalvik/AndroidManifest.xml b/modules/pictures/src/main/resources/META-INF/substrate/dalvik/AndroidManifest.xml index a309b366..1031ba2b 100644 --- a/modules/pictures/src/main/resources/META-INF/substrate/dalvik/AndroidManifest.xml +++ b/modules/pictures/src/main/resources/META-INF/substrate/dalvik/AndroidManifest.xml @@ -2,6 +2,9 @@ + + +