0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-20 03:52:15 +02:00

refactor: remove unused code

`allGranted` was unused
This commit is contained in:
David Allison 2023-08-19 01:14:26 +01:00 committed by Mike Hardy
parent 294af97c94
commit 4f8f2012a9
2 changed files with 0 additions and 8 deletions

View File

@ -21,7 +21,6 @@ package com.ichi2.anki.permissions
* @param permissions A map, containing an entry for each required permission, associating to it whether it's already granted
*/
open class PermissionsCheckResult(val permissions: Map<String, Boolean>) {
val allGranted = permissions.all { it.value }
val requiresPermissionDialog: Boolean = permissions.any { !it.value }
/**

View File

@ -50,13 +50,6 @@ class PermissionsRequestResults(permissions: Map<String, PermissionRequestResult
val hasTemporarilyDeniedPermissions = permissions.any { it.value == TEMPORARILY_DENIED }
companion object {
fun allGranted(checkResult: PermissionsCheckResult): PermissionsRequestResults {
if (!checkResult.allGranted) {
throw IllegalStateException("allGranted called when permissions were not all granted")
}
return PermissionsRequestResults(checkResult.permissions.mapValues { GRANTED })
}
fun from(activity: Activity, rawResults: PermissionsRequestRawResults): PermissionsRequestResults {
val permissions = rawResults.mapValues { toPermissionRequestResult(activity, it.key, it.value) }
return PermissionsRequestResults(permissions)