merge from open-source master

This commit is contained in:
The Android Open Source Project
2010-03-01 09:30:21 -08:00

View File

@@ -1905,11 +1905,16 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
+ " app=" + app + " knownToBeDead=" + knownToBeDead + " app=" + app + " knownToBeDead=" + knownToBeDead
+ " thread=" + (app != null ? app.thread : null) + " thread=" + (app != null ? app.thread : null)
+ " pid=" + (app != null ? app.pid : -1)); + " pid=" + (app != null ? app.pid : -1));
if (app != null && if (app != null && app.pid > 0) {
(!knownToBeDead || app.thread == null) && app.pid > 0) { if (!knownToBeDead || app.thread == null) {
return app; return app;
} else {
// An application record is attached to a previous process,
// clean it up now.
handleAppDiedLocked(app, true);
}
} }
String hostingNameStr = hostingName != null String hostingNameStr = hostingName != null
? hostingName.flattenToShortString() : null; ? hostingName.flattenToShortString() : null;
@@ -4553,7 +4558,9 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
mProcDeaths[0]++; mProcDeaths[0]++;
if (app.thread != null && app.thread.asBinder() == thread.asBinder()) { // Clean up already done if the process has been re-started.
if (app.pid == pid && app.thread != null &&
app.thread.asBinder() == thread.asBinder()) {
Log.i(TAG, "Process " + app.processName + " (pid " + pid Log.i(TAG, "Process " + app.processName + " (pid " + pid
+ ") has died."); + ") has died.");
EventLog.writeEvent(LOG_AM_PROCESS_DIED, app.pid, app.processName); EventLog.writeEvent(LOG_AM_PROCESS_DIED, app.pid, app.processName);
@@ -4603,6 +4610,11 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
scheduleAppGcsLocked(); scheduleAppGcsLocked();
} }
} }
} else if (app.pid != pid) {
// A new process has already been started.
Log.i(TAG, "Process " + app.processName + " (pid " + pid
+ ") has died and restarted (pid " + app.pid + ").");
EventLog.writeEvent(LOG_AM_PROCESS_DIED, pid, app.processName);
} else if (Config.LOGD) { } else if (Config.LOGD) {
Log.d(TAG, "Received spurious death notification for thread " Log.d(TAG, "Received spurious death notification for thread "
+ thread.asBinder()); + thread.asBinder());
@@ -5424,6 +5436,8 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
finishReceiverLocked(br.receiver, br.resultCode, br.resultData, finishReceiverLocked(br.receiver, br.resultCode, br.resultData,
br.resultExtras, br.resultAbort, true); br.resultExtras, br.resultAbort, true);
scheduleBroadcastsLocked(); scheduleBroadcastsLocked();
// We need to reset the state if we fails to start the receiver.
br.state = BroadcastRecord.IDLE;
} }
} }