Merge "[ActivityManager] Avoid killing unrelated processes."
This commit is contained in:
@@ -1215,7 +1215,7 @@ public final class ActivityManagerService extends ActivityManagerNative
|
|||||||
TAG, "Death received in " + this
|
TAG, "Death received in " + this
|
||||||
+ " for thread " + mAppThread.asBinder());
|
+ " for thread " + mAppThread.asBinder());
|
||||||
synchronized(ActivityManagerService.this) {
|
synchronized(ActivityManagerService.this) {
|
||||||
appDiedLocked(mApp, mPid, mAppThread);
|
appDiedLocked(mApp, mPid, mAppThread, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4687,10 +4687,11 @@ public final class ActivityManagerService extends ActivityManagerNative
|
|||||||
}
|
}
|
||||||
|
|
||||||
final void appDiedLocked(ProcessRecord app) {
|
final void appDiedLocked(ProcessRecord app) {
|
||||||
appDiedLocked(app, app.pid, app.thread);
|
appDiedLocked(app, app.pid, app.thread, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
final void appDiedLocked(ProcessRecord app, int pid, IApplicationThread thread) {
|
final void appDiedLocked(ProcessRecord app, int pid, IApplicationThread thread,
|
||||||
|
boolean fromBinderDied) {
|
||||||
// First check if this ProcessRecord is actually active for the pid.
|
// First check if this ProcessRecord is actually active for the pid.
|
||||||
synchronized (mPidsSelfLocked) {
|
synchronized (mPidsSelfLocked) {
|
||||||
ProcessRecord curProc = mPidsSelfLocked.get(pid);
|
ProcessRecord curProc = mPidsSelfLocked.get(pid);
|
||||||
@@ -4706,7 +4707,9 @@ public final class ActivityManagerService extends ActivityManagerNative
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!app.killed) {
|
if (!app.killed) {
|
||||||
Process.killProcessQuiet(pid);
|
if (!fromBinderDied) {
|
||||||
|
Process.killProcessQuiet(pid);
|
||||||
|
}
|
||||||
Process.killProcessGroup(app.info.uid, pid);
|
Process.killProcessGroup(app.info.uid, pid);
|
||||||
app.killed = true;
|
app.killed = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user