mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-31 23:03:54 +01:00
add permission to access media location
This commit is contained in:
parent
095f9ddfca
commit
543840ccd4
2 changed files with 8 additions and 5 deletions
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue