am a5ba0a78: am 767eb427: Merge change If990cab0 into eclair

Merge commit 'a5ba0a78811fcd5d3470bfa09df3e0106b77567e' into eclair-mr2-plus-aosp

* commit 'a5ba0a78811fcd5d3470bfa09df3e0106b77567e':
  Make sure to acknowledge stale broadcasts
This commit is contained in:
Christopher Tate
2009-12-09 15:52:43 -08:00
committed by Android Git Automerger

View File

@@ -691,6 +691,20 @@ public final class ActivityThread {
if (rd != null) {
rd.performReceive(intent, resultCode, data, extras,
ordered, sticky);
} else {
// The activity manager dispatched a broadcast to a registered
// receiver in this process, but before it could be delivered the
// receiver was unregistered. Acknowledge the broadcast on its
// behalf so that the system's broadcast sequence can continue.
if (DEBUG_BROADCAST) {
Log.i(TAG, "Broadcast to unregistered receiver");
}
IActivityManager mgr = ActivityManagerNative.getDefault();
try {
mgr.finishReceiver(this, resultCode, data, extras, false);
} catch (RemoteException e) {
Log.w(TAG, "Couldn't finish broadcast to unregistered receiver");
}
}
}
}
@@ -716,8 +730,8 @@ public final class ActivityThread {
BroadcastReceiver receiver = mReceiver;
if (DEBUG_BROADCAST) {
int seq = mCurIntent.getIntExtra("seq", -1);
Log.i(TAG, "Dispathing broadcast " + mCurIntent.getAction() + " seq=" + seq
+ " to " + mReceiver);
Log.i(TAG, "Dispatching broadcast " + mCurIntent.getAction()
+ " seq=" + seq + " to " + mReceiver);
}
if (receiver == null) {
return;