add permission to access media location

This commit is contained in:
Rohit Verma 2024-09-15 14:18:46 +05:30
parent 095f9ddfca
commit 543840ccd4
2 changed files with 8 additions and 5 deletions

View file

@ -81,7 +81,7 @@ class UploadWorker(
//Attributes of the current-upload notification //Attributes of the current-upload notification
private var currentNotificationID: Int = -1// late init is not allowed with primitives private var currentNotificationID: Int = -1// lateinit is not allowed with primitives
private lateinit var currentNotificationTag: String private lateinit var currentNotificationTag: String
private var currentNotification: NotificationCompat.Builder private var currentNotification: NotificationCompat.Builder

View file

@ -27,13 +27,16 @@ public class PermissionUtils {
static String[] getPermissionsStorage() { static String[] getPermissionsStorage() {
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
return new String[]{ Manifest.permission.READ_MEDIA_VISUAL_USER_SELECTED, return new String[]{ Manifest.permission.READ_MEDIA_VISUAL_USER_SELECTED,
Manifest.permission.READ_MEDIA_IMAGES }; Manifest.permission.READ_MEDIA_IMAGES,
Manifest.permission.ACCESS_MEDIA_LOCATION };
} }
if(Build.VERSION.SDK_INT == Build.VERSION_CODES.TIRAMISU) { if(Build.VERSION.SDK_INT == Build.VERSION_CODES.TIRAMISU) {
return new String[]{ Manifest.permission.READ_MEDIA_IMAGES }; return new String[]{ Manifest.permission.READ_MEDIA_IMAGES,
Manifest. permission.ACCESS_MEDIA_LOCATION };
} }
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
return new String[]{ Manifest.permission.READ_EXTERNAL_STORAGE }; return new String[]{ Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.ACCESS_MEDIA_LOCATION };
} }
return new String[]{ return new String[]{
Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE,