Skip to content

Commit

Permalink
FIX: Minor crash on BBK brands.
Browse files Browse the repository at this point in the history
OnePlus, Realme, OPPO and etc.
  • Loading branch information
oasisfeng committed Mar 1, 2022
1 parent 58edc55 commit bf581ff
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ class AppOpsPermissionsUnlock: BroadcastReceiver() {

val async = goAsync()
thread(start = true) {
unlockAll(context.applicationContext)
try { unlockAll(context.applicationContext) } // SecurityException on BBK brands (OnePlus, Realme, OPPO and etc.), "getPackagesForUid: UID 1010256 requires android.permission.INTERACT_ACROSS_USERS_FULL or android.permission.INTERACT_ACROSS_USERS or android.permission.INTERACT_ACROSS_PROFILES to access user ."
catch (e: SecurityException) { Log.e(TAG, "Failed to unlock all permissions", e) }
disableSelf(context)
async.finish() }
async.finish()
}
}

companion object {
Expand Down

0 comments on commit bf581ff

Please sign in to comment.