From fb9ec50795142c24b56dd28e45f5012b9b445380 Mon Sep 17 00:00:00 2001 From: Svetoslav Date: Tue, 1 Sep 2015 14:45:18 -0700 Subject: [PATCH] Incorrect app op check in broadcast queue An intent broadcaster can specify which permissions should be held by a receiver to get the broadcast. These permissions may have corresponding app ops and if this is the case we also check the app ops. There is a bug in broadcast queue where if a permission does not have an app op we still try to check this app op and get an exception as the app op does not exist. This did not manifest often because the broadcast API takes an optional app op against which is compared the app op for each permission and if they differ the app op for the permission is checked. bug:23725305 Change-Id: Iec56ee354bbc11e7bc245134cf3afd2c11eecbc4 --- services/core/java/com/android/server/am/BroadcastQueue.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/am/BroadcastQueue.java b/services/core/java/com/android/server/am/BroadcastQueue.java index a956c564f9ee..960cbf15a96e 100644 --- a/services/core/java/com/android/server/am/BroadcastQueue.java +++ b/services/core/java/com/android/server/am/BroadcastQueue.java @@ -509,7 +509,7 @@ public final class BroadcastQueue { break; } int appOp = AppOpsManager.permissionToOpCode(requiredPermission); - if (appOp != r.appOp + if (appOp != AppOpsManager.OP_NONE && appOp != r.appOp && mService.mAppOpsService.noteOperation(appOp, filter.receiverList.uid, filter.packageName) != AppOpsManager.MODE_ALLOWED) { -- 2.11.0