Merge change I490e01ba into eclair
* changes: Fix issue #2174566: HOT STABILITY: NPE in activity manager
This commit is contained in:
@ -4556,7 +4556,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
|
||||
long now = SystemClock.uptimeMillis();
|
||||
for (i=0; i<count; i++) {
|
||||
ProcessRecord rec = mLRUProcesses.get(i);
|
||||
if (rec.thread != null &&
|
||||
if (rec != app && rec.thread != null &&
|
||||
(rec.lastLowMemory+GC_MIN_INTERVAL) <= now) {
|
||||
// The low memory report is overriding any current
|
||||
// state for a GC request. Make sure to do
|
||||
@ -9852,6 +9852,8 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
|
||||
mLRUProcesses.remove(index);
|
||||
}
|
||||
|
||||
mProcessesToGc.remove(app);
|
||||
|
||||
// Dismiss any open dialogs.
|
||||
if (app.crashDialog != null) {
|
||||
app.crashDialog.dismiss();
|
||||
@ -10519,7 +10521,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
|
||||
//Log.i(TAG, "Bring up service:");
|
||||
//r.dump(" ");
|
||||
|
||||
if (r.app != null) {
|
||||
if (r.app != null && r.app.thread != null) {
|
||||
sendServiceArgsLocked(r, false);
|
||||
return true;
|
||||
}
|
||||
@ -10550,7 +10552,6 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
|
||||
// restart the application.
|
||||
}
|
||||
|
||||
if (!mPendingServices.contains(r)) {
|
||||
// Not running -- get it started, and enqueue this service record
|
||||
// to be executed when the app comes up.
|
||||
if (startProcessLocked(appName, r.appInfo, true, intentFlags,
|
||||
@ -10562,8 +10563,11 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
|
||||
bringDownServiceLocked(r, true);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!mPendingServices.contains(r)) {
|
||||
mPendingServices.add(r);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user