From 799ee34558f5ef91efe4e02242dabf5ca4feb463 Mon Sep 17 00:00:00 2001 From: Hai Zhang Date: Wed, 22 Apr 2020 14:04:56 -0700 Subject: Call noteOperation() in ShellDelegate so that noteOp() really passes. Previously it was calling noteProxyOperation() (with a wrong proxy/proxied relationship) in the hope that we can attribute the operation to the original app instead of only the shell. However, noteProxyOperation() requires both the proxy and the proxied app to have the app op, which defeats the purpose of ShellDelegate. So change the implementation to call noteOperation() as shell directly instead. Bug: 153676562 Test: presubmit Change-Id: I783d7a7473e2622cb0ed379b109cf511c20cc876 --- services/core/java/com/android/server/am/ActivityManagerService.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 3fdf541566a5..a22b44225b70 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -20045,8 +20045,7 @@ public class ActivityManagerService extends IActivityManager.Stub if (uid == mTargetUid && isTargetOp(code)) { final long identity = Binder.clearCallingIdentity(); try { - return mAppOpsService.noteProxyOperation(code, Process.SHELL_UID, - "com.android.shell", null, uid, packageName, featureId, + return superImpl.apply(code, Process.SHELL_UID, "com.android.shell", featureId, shouldCollectAsyncNotedOp, message); } finally { Binder.restoreCallingIdentity(identity); -- cgit v1.2.3-59-g8ed1b