Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b7c2ca68 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Update the BroadcastQueue logic for runtime permissions" into sc-v2-dev am: 1c6635fe

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16059330

Change-Id: Iea5ce7f319208a11c3f8a766bf8cabf2ea6e3a3b
parents 98388575 1c6635fe
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
@@ -1568,17 +1568,23 @@ public final class BroadcastQueue {
                    perm = PackageManager.PERMISSION_DENIED;
                }

                if (perm == PackageManager.PERMISSION_GRANTED) {
                    skip = true;
                    break;
                }

                int appOp = AppOpsManager.permissionToOpCode(excludedPermission);
                if (appOp != AppOpsManager.OP_NONE) {
                    if (mService.getAppOpsManager().checkOpNoThrow(appOp,
                    // When there is an app op associated with the permission,
                    // skip when both the permission and the app op are
                    // granted.
                    if ((perm == PackageManager.PERMISSION_GRANTED) && (
                                mService.getAppOpsManager().checkOpNoThrow(appOp,
                                info.activityInfo.applicationInfo.uid,
                                info.activityInfo.packageName)
                            == AppOpsManager.MODE_ALLOWED) {
                            == AppOpsManager.MODE_ALLOWED)) {
                        skip = true;
                        break;
                    }
                } else {
                    // When there is no app op associated with the permission,
                    // skip when permission is granted.
                    if (perm == PackageManager.PERMISSION_GRANTED) {
                        skip = true;
                        break;
                    }