Fix issue #29532165: System Server Java Crashes in WiFi (RT Restart)

I really have no idea how this can be happening (we check
for a null intent before posting the args), but add another
check before dispatching to try to avoid it.

Change-Id: Ic704850c9750b6a078c49ea628189be568031086
This commit is contained in:
Dianne Hackborn
2016-06-22 16:49:14 -07:00
parent ec6db57ac7
commit 17c77536ec

View File

@@ -1072,6 +1072,7 @@ public final class LoadedApk {
final class Args extends BroadcastReceiver.PendingResult implements Runnable {
private Intent mCurIntent;
private final boolean mOrdered;
private boolean mDispatched;
public Args(Intent intent, int resultCode, String resultData, Bundle resultExtras,
boolean ordered, boolean sticky, int sendingUser) {
@@ -1096,9 +1097,13 @@ public final class LoadedApk {
final IActivityManager mgr = ActivityManagerNative.getDefault();
final Intent intent = mCurIntent;
if (intent == null) {
Log.wtf(TAG, "Null intent being dispatched, mDispatched=" + mDispatched);
}
mCurIntent = null;
if (receiver == null || mForgotten) {
mDispatched = true;
if (receiver == null || intent == null || mForgotten) {
if (mRegistered && ordered) {
if (ActivityThread.DEBUG_BROADCAST) Slog.i(ActivityThread.TAG,
"Finishing null broadcast to " + mReceiver);