diff options
author | Alexandra Gherghina <alexgherghina@google.com> | 2014-08-06 13:43:22 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-08-05 00:35:13 +0000 |
commit | ff40ed3f8cdb9eab1e6ba97a157f431c2d759d41 (patch) | |
tree | 45ff997df012fb4faa191bdf3172af162cbd94ac | |
parent | 41da5ff98f68a575fc46085e8714c8a3e5e5c17a (diff) | |
parent | d6a98979b5d45fff1fa842932274517e999a59c2 (diff) | |
download | frameworks_base-ff40ed3f8cdb9eab1e6ba97a157f431c2d759d41.zip frameworks_base-ff40ed3f8cdb9eab1e6ba97a157f431c2d759d41.tar.gz frameworks_base-ff40ed3f8cdb9eab1e6ba97a157f431c2d759d41.tar.bz2 |
Merge "Fix resetAllModes call to act only on the calling user" into lmp-dev
-rw-r--r-- | services/core/java/com/android/server/AppOpsService.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/AppOpsService.java b/services/core/java/com/android/server/AppOpsService.java index 13e1b37..ef6e07c 100644 --- a/services/core/java/com/android/server/AppOpsService.java +++ b/services/core/java/com/android/server/AppOpsService.java @@ -437,13 +437,18 @@ public class AppOpsService extends IAppOpsService.Stub { @Override public void resetAllModes() { + int callingUid = Binder.getCallingUid(); mContext.enforcePermission(android.Manifest.permission.UPDATE_APP_OPS_STATS, - Binder.getCallingPid(), Binder.getCallingUid(), null); + Binder.getCallingPid(), callingUid, null); HashMap<Callback, ArrayList<Pair<String, Integer>>> callbacks = null; synchronized (this) { boolean changed = false; for (int i=mUidOps.size()-1; i>=0; i--) { HashMap<String, Ops> packages = mUidOps.valueAt(i); + if (UserHandle.getUserId(callingUid) != UserHandle.getUserId(mUidOps.keyAt(i))) { + // Skip any ops for a different user + continue; + } Iterator<Map.Entry<String, Ops>> it = packages.entrySet().iterator(); while (it.hasNext()) { Map.Entry<String, Ops> ent = it.next(); |