OSDN Git Service

Further fix on issue #16013164
authorDianne Hackborn <hackbod@google.com>
Tue, 22 Jul 2014 23:29:04 +0000 (16:29 -0700)
committerDianne Hackborn <hackbod@google.com>
Wed, 23 Jul 2014 01:26:29 +0000 (18:26 -0700)
Dumb dumb dumb copy/paste error when moving the
uid checking up out of the function.

Change-Id: I01513ccd80750b724dbfa8d9d7d171819c6b959b

services/core/java/com/android/server/AppOpsService.java

index 579c449..5a510a9 100644 (file)
@@ -371,11 +371,10 @@ public class AppOpsService extends IAppOpsService.Stub {
 
     @Override
     public void setMode(int code, int uid, String packageName, int mode) {
-        if (Binder.getCallingPid() == Process.myPid()) {
-            return;
+        if (Binder.getCallingPid() != Process.myPid()) {
+            mContext.enforcePermission(android.Manifest.permission.UPDATE_APP_OPS_STATS,
+                    Binder.getCallingPid(), Binder.getCallingUid(), null);
         }
-        mContext.enforcePermission(android.Manifest.permission.UPDATE_APP_OPS_STATS,
-                Binder.getCallingPid(), Binder.getCallingUid(), null);
         verifyIncomingOp(code);
         ArrayList<Callback> repCbs = null;
         code = AppOpsManager.opToSwitch(code);