From 2342c452a8c87325cdc217f40757a9253e94057d Mon Sep 17 00:00:00 2001 From: Andrew Gunnerson Date: Sat, 30 Dec 2023 19:41:09 -0500 Subject: [PATCH] RemoveHardRestrictions: Fix version check for Android 14 Signed-off-by: Andrew Gunnerson --- .../com/chiller3/bcr/standalone/RemoveHardRestrictions.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/chiller3/bcr/standalone/RemoveHardRestrictions.kt b/app/src/main/java/com/chiller3/bcr/standalone/RemoveHardRestrictions.kt index c8caa4503..69db5bca3 100644 --- a/app/src/main/java/com/chiller3/bcr/standalone/RemoveHardRestrictions.kt +++ b/app/src/main/java/com/chiller3/bcr/standalone/RemoveHardRestrictions.kt @@ -211,8 +211,7 @@ private fun removeRestriction(packageName: String, permission: String, userId: I throw IllegalArgumentException("Package $packageName is not installed for user $userId") } - val (getFlags, updateFlags) = if (Build.VERSION.SDK_INT in - Build.VERSION_CODES.R..Build.VERSION_CODES.TIRAMISU) { + val (getFlags, updateFlags) = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { val permissionManager = PermissionManagerProxy.instance Pair( @@ -222,7 +221,7 @@ private fun removeRestriction(packageName: String, permission: String, userId: I packageName, permission, mask, set, false, userId) }, ) - } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { + } else if (Build.VERSION.SDK_INT == Build.VERSION_CODES.Q) { Pair( { packageManager.getPermissionFlags(permission, packageName, userId) }, { mask: Int, set: Int ->