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

Commit 2417a8a4 authored by Ashwini Oruganti's avatar Ashwini Oruganti Committed by Android (Google) Code Review
Browse files

Merge "Update the BroadcastQueue logic for runtime permissions"

parents 6dc43a11 1e6a9681
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
@@ -1588,17 +1588,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;
                    }