From 128b9106ade8386ff3b51661e56cc6f12b7804e8 Mon Sep 17 00:00:00 2001 From: "Philip P. Moltmann" Date: Thu, 9 Apr 2020 16:39:13 -0700 Subject: [PATCH] Allow non-system server code to AppOpsManager.checkOp and NoteOp 1. Allow checkOp from any caller, not only callers with android.permission.UPDATE_APP_OPS_STATS. This is ok as checkOp does not update any stats 2. Clear the binder identity when calling noteOp so that it is checked if the service can perform the operation, not the caller. Test: Verified that RecognitionService can be used by third party apps Bug: 152436092 Merged-In: Ie6fe90b5737a1cd24e45446ea91560940b41c8fc Change-Id: Icfd46548b1c23b499b712ad795eab0c417b8586f --- services/core/java/com/android/server/appop/AppOpsService.java | 1 - 1 file changed, 1 deletion(-) diff --git a/services/core/java/com/android/server/appop/AppOpsService.java b/services/core/java/com/android/server/appop/AppOpsService.java index d45bc72aee11d..06f11a8efea6b 100644 --- a/services/core/java/com/android/server/appop/AppOpsService.java +++ b/services/core/java/com/android/server/appop/AppOpsService.java @@ -1789,7 +1789,6 @@ public class AppOpsService extends IAppOpsService.Stub { private int checkOperationImpl(int code, int uid, String packageName, boolean raw) { - verifyIncomingUid(uid); verifyIncomingOp(code); String resolvedPackageName = resolvePackageName(uid, packageName); if (resolvedPackageName == null) {