mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01:00
Make klint happy :-)
Signed-off-by: Tim Krüger <t@timkrueger.me>
This commit is contained in:
parent
e1d9afa1a2
commit
1a9f5a3f73
@ -214,10 +214,10 @@ class UploadAndShareFilesWorker(val context: Context, workerParameters: WorkerPa
|
|||||||
|
|
||||||
fun isStoragePermissionGranted(context: Context): Boolean {
|
fun isStoragePermissionGranted(context: Context): Boolean {
|
||||||
when {
|
when {
|
||||||
Build.VERSION.SDK_INT > 29 -> {
|
Build.VERSION.SDK_INT > Build.VERSION_CODES.Q -> {
|
||||||
return if (PermissionChecker.checkSelfPermission(
|
return if (PermissionChecker.checkSelfPermission(
|
||||||
context, Manifest.permission
|
context,
|
||||||
.READ_EXTERNAL_STORAGE
|
Manifest.permission.READ_EXTERNAL_STORAGE
|
||||||
) == PermissionChecker.PERMISSION_GRANTED
|
) == PermissionChecker.PERMISSION_GRANTED
|
||||||
) {
|
) {
|
||||||
Log.d(TAG, "Permission is granted (SDK 30 or greater)")
|
Log.d(TAG, "Permission is granted (SDK 30 or greater)")
|
||||||
@ -249,9 +249,8 @@ class UploadAndShareFilesWorker(val context: Context, workerParameters: WorkerPa
|
|||||||
|
|
||||||
fun requestStoragePermission(controller: Controller) {
|
fun requestStoragePermission(controller: Controller) {
|
||||||
|
|
||||||
|
|
||||||
when {
|
when {
|
||||||
Build.VERSION.SDK_INT > 29 -> {
|
Build.VERSION.SDK_INT > Build.VERSION_CODES.Q -> {
|
||||||
controller.requestPermissions(
|
controller.requestPermissions(
|
||||||
arrayOf(
|
arrayOf(
|
||||||
Manifest.permission.READ_EXTERNAL_STORAGE
|
Manifest.permission.READ_EXTERNAL_STORAGE
|
||||||
@ -268,7 +267,6 @@ class UploadAndShareFilesWorker(val context: Context, workerParameters: WorkerPa
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
else -> { // permission is automatically granted on sdk<23 upon installation
|
else -> { // permission is automatically granted on sdk<23 upon installation
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user