summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorOlawale Ogunwale <ogunwale@google.com>2015-03-09 16:36:31 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-03-09 16:36:31 +0000
commitedc3c8939f3cde4ab9343e7654f5dac1122fb470 (patch)
treeb22944da9ddd4897cf4070c5e57bab46c3b4314f /services
parent5596600697f54feb944737b7bc55df06123e6e54 (diff)
parent14ccc26f1ce006963f1a0b7a917404aa6a0e9da1 (diff)
downloadframeworks_base-edc3c8939f3cde4ab9343e7654f5dac1122fb470.zip
frameworks_base-edc3c8939f3cde4ab9343e7654f5dac1122fb470.tar.gz
frameworks_base-edc3c8939f3cde4ab9343e7654f5dac1122fb470.tar.bz2
am 14ccc26f: Merge "[ActivityManager] Skip receiver precisely."
* commit '14ccc26f1ce006963f1a0b7a917404aa6a0e9da1': [ActivityManager] Skip receiver precisely.
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/am/BroadcastQueue.java27
1 files changed, 11 insertions, 16 deletions
diff --git a/services/core/java/com/android/server/am/BroadcastQueue.java b/services/core/java/com/android/server/am/BroadcastQueue.java
index 9b7d0b2..5d969c6 100644
--- a/services/core/java/com/android/server/am/BroadcastQueue.java
+++ b/services/core/java/com/android/server/am/BroadcastQueue.java
@@ -294,28 +294,23 @@ public final class BroadcastQueue {
}
public void skipCurrentReceiverLocked(ProcessRecord app) {
- boolean reschedule = false;
- BroadcastRecord r = app.curReceiver;
- if (r != null && r.queue == this) {
- // The current broadcast is waiting for this app's receiver
- // to be finished. Looks like that's not going to happen, so
- // let the broadcast continue.
- logBroadcastReceiverDiscardLocked(r);
- finishReceiverLocked(r, r.resultCode, r.resultData,
- r.resultExtras, r.resultAbort, false);
- reschedule = true;
+ BroadcastRecord r = null;
+ if (mOrderedBroadcasts.size() > 0) {
+ BroadcastRecord br = mOrderedBroadcasts.get(0);
+ if (br.curApp == app) {
+ r = br;
+ }
}
-
- r = mPendingBroadcast;
- if (r != null && r.curApp == app) {
+ if (r == null && mPendingBroadcast != null && mPendingBroadcast.curApp == app) {
if (DEBUG_BROADCAST) Slog.v(TAG,
"[" + mQueueName + "] skip & discard pending app " + r);
+ r = mPendingBroadcast;
+ }
+
+ if (r != null) {
logBroadcastReceiverDiscardLocked(r);
finishReceiverLocked(r, r.resultCode, r.resultData,
r.resultExtras, r.resultAbort, false);
- reschedule = true;
- }
- if (reschedule) {
scheduleBroadcastsLocked();
}
}