diff options
| author | 2012-08-28 16:56:18 -0700 | |
|---|---|---|
| committer | 2012-08-28 16:56:19 -0700 | |
| commit | c3815a5679c21a6b09c2deaa6baedd124f9e717a (patch) | |
| tree | b38d4026b393a6795b600c763f3d91a226b1eb7c /services/java/com | |
| parent | b5b2acec806a3acfbecb63839f8da431e8a9daab (diff) | |
| parent | 4ea60693236d73fa2d9b5bf25deeb6d9b602ed30 (diff) | |
Merge "Fix PendingIntent caching for multiuser" into jb-mr1-dev
Diffstat (limited to 'services/java/com')
| -rw-r--r-- | services/java/com/android/server/am/ActivityManagerService.java | 3 | ||||
| -rw-r--r-- | services/java/com/android/server/am/PendingIntentRecord.java | 12 |
2 files changed, 11 insertions, 4 deletions
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index 6e4759d31ab7..368db2661f56 100644 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -4430,7 +4430,8 @@ public final class ActivityManagerService extends ActivityManagerNative PendingIntentRecord.Key key = new PendingIntentRecord.Key( type, packageName, activity, resultWho, - requestCode, intents, resolvedTypes, flags, options); + requestCode, intents, resolvedTypes, flags, options, + UserHandle.getUserId(callingUid)); WeakReference<PendingIntentRecord> ref; ref = mIntentSenderRecords.get(key); PendingIntentRecord rec = ref != null ? ref.get() : null; diff --git a/services/java/com/android/server/am/PendingIntentRecord.java b/services/java/com/android/server/am/PendingIntentRecord.java index d3b851026aac..8e70376fc26b 100644 --- a/services/java/com/android/server/am/PendingIntentRecord.java +++ b/services/java/com/android/server/am/PendingIntentRecord.java @@ -54,11 +54,12 @@ class PendingIntentRecord extends IIntentSender.Stub { String[] allResolvedTypes; final int flags; final int hashCode; + final int userId; private static final int ODD_PRIME_NUMBER = 37; Key(int _t, String _p, ActivityRecord _a, String _w, - int _r, Intent[] _i, String[] _it, int _f, Bundle _o) { + int _r, Intent[] _i, String[] _it, int _f, Bundle _o, int _userId) { type = _t; packageName = _p; activity = _a; @@ -70,10 +71,12 @@ class PendingIntentRecord extends IIntentSender.Stub { allResolvedTypes = _it; flags = _f; options = _o; - + userId = _userId; + int hash = 23; hash = (ODD_PRIME_NUMBER*hash) + _f; hash = (ODD_PRIME_NUMBER*hash) + _r; + hash = (ODD_PRIME_NUMBER*hash) + _userId; if (_w != null) { hash = (ODD_PRIME_NUMBER*hash) + _w.hashCode(); } @@ -102,6 +105,9 @@ class PendingIntentRecord extends IIntentSender.Stub { if (type != other.type) { return false; } + if (userId != other.userId){ + return false; + } if (!packageName.equals(other.packageName)) { return false; } @@ -156,7 +162,7 @@ class PendingIntentRecord extends IIntentSender.Stub { + " intent=" + (requestIntent != null ? requestIntent.toShortString(false, true, false, false) : "<null>") - + " flags=0x" + Integer.toHexString(flags) + "}"; + + " flags=0x" + Integer.toHexString(flags) + " u=" + userId + "}"; } String typeName() { |