Merge "[ActivityManager] Avoid orphan ContentProviderRecord."

This commit is contained in:
Olawale Ogunwale
2015-04-24 17:42:58 +00:00
committed by Gerrit Code Review

View File

@@ -5816,17 +5816,20 @@ public final class ActivityManagerService extends ActivityManagerNative
if (app.isolated) { if (app.isolated) {
mBatteryStatsService.removeIsolatedUid(app.uid, app.info.uid); mBatteryStatsService.removeIsolatedUid(app.uid, app.info.uid);
} }
app.kill(reason, true); boolean willRestart = false;
handleAppDiedLocked(app, true, allowRestart);
removeLruProcessLocked(app);
if (app.persistent && !app.isolated) { if (app.persistent && !app.isolated) {
if (!callerWillRestart) { if (!callerWillRestart) {
addAppLocked(app.info, false, null /* ABI override */); willRestart = true;
} else { } else {
needRestart = true; needRestart = true;
} }
} }
app.kill(reason, true);
handleAppDiedLocked(app, willRestart, allowRestart);
if (willRestart) {
removeLruProcessLocked(app);
addAppLocked(app.info, false, null /* ABI override */);
}
} else { } else {
mRemovedProcesses.add(app); mRemovedProcesses.add(app);
} }