diff options
author | Dianne Hackborn <hackbod@google.com> | 2012-10-12 17:43:45 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-10-12 17:43:46 -0700 |
commit | 59cb2cf15c912280b32292c79c2c0e5bfea49b68 (patch) | |
tree | a3980665c3ec0fee2e7eb78bb1327c251613d025 | |
parent | f15005ee3926302588d19f1be6ad4a62b3e691b4 (diff) | |
parent | 861a3b2d4f2090d23cc5e135890a0faf091b9e12 (diff) | |
download | frameworks_base-59cb2cf15c912280b32292c79c2c0e5bfea49b68.zip frameworks_base-59cb2cf15c912280b32292c79c2c0e5bfea49b68.tar.gz frameworks_base-59cb2cf15c912280b32292c79c2c0e5bfea49b68.tar.bz2 |
Merge "Revert fix to issue #6880627: PendingIntent.getService() returns..." into jb-mr1-dev
-rw-r--r-- | services/java/com/android/server/am/ActivityManagerService.java | 78 |
1 files changed, 42 insertions, 36 deletions
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index daed0a2..7132e1e 100644 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -3930,48 +3930,54 @@ public final class ActivityManagerService extends ActivityManagerNative removeDyingProviderLocked(null, providers.get(i), true); } - if (mIntentSenderRecords.size() > 0) { - Iterator<WeakReference<PendingIntentRecord>> it - = mIntentSenderRecords.values().iterator(); - while (it.hasNext()) { - WeakReference<PendingIntentRecord> wpir = it.next(); - if (wpir == null) { - it.remove(); - continue; - } - PendingIntentRecord pir = wpir.get(); - if (pir == null) { - it.remove(); - continue; - } - if (name == null) { - // Stopping user, remove all objects for the user. - if (pir.key.userId != userId) { - // Not the same user, skip it. + if (name == null) { + // Remove pending intents. For now we only do this when force + // stopping users, because we have some problems when doing this + // for packages -- app widgets are not currently cleaned up for + // such packages, so they can be left with bad pending intents. + if (mIntentSenderRecords.size() > 0) { + Iterator<WeakReference<PendingIntentRecord>> it + = mIntentSenderRecords.values().iterator(); + while (it.hasNext()) { + WeakReference<PendingIntentRecord> wpir = it.next(); + if (wpir == null) { + it.remove(); continue; } - } else { - if (UserHandle.getAppId(pir.uid) != appId) { - // Different app id, skip it. + PendingIntentRecord pir = wpir.get(); + if (pir == null) { + it.remove(); continue; } - if (userId != UserHandle.USER_ALL && pir.key.userId != userId) { - // Different user, skip it. - continue; + if (name == null) { + // Stopping user, remove all objects for the user. + if (pir.key.userId != userId) { + // Not the same user, skip it. + continue; + } + } else { + if (UserHandle.getAppId(pir.uid) != appId) { + // Different app id, skip it. + continue; + } + if (userId != UserHandle.USER_ALL && pir.key.userId != userId) { + // Different user, skip it. + continue; + } + if (!pir.key.packageName.equals(name)) { + // Different package, skip it. + continue; + } } - if (!pir.key.packageName.equals(name)) { - // Different package, skip it. - continue; + if (!doit) { + return true; + } + didSomething = true; + it.remove(); + pir.canceled = true; + if (pir.key.activity != null) { + pir.key.activity.pendingResults.remove(pir.ref); } - } - if (!doit) { - return true; - } - didSomething = true; - it.remove(); - pir.canceled = true; - if (pir.key.activity != null) { - pir.key.activity.pendingResults.remove(pir.ref); } } } |