diff options
-rw-r--r-- | services/core/java/com/android/server/am/ActivityManagerService.java | 16 | ||||
-rw-r--r-- | services/core/java/com/android/server/am/ProcessRecord.java | 3 |
2 files changed, 14 insertions, 5 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index c0c401d..0301638 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -2744,13 +2744,19 @@ public final class ActivityManagerService extends ActivityManagerNative return index; } + private static void killProcessGroup(int uid, int pid) { + Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "killProcessGroup"); + Process.killProcessGroup(uid, pid); + Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER); + } + final void removeLruProcessLocked(ProcessRecord app) { int lrui = mLruProcesses.lastIndexOf(app); if (lrui >= 0) { if (!app.killed) { Slog.wtfStack(TAG, "Removing process that hasn't been killed: " + app); Process.killProcessQuiet(app.pid); - Process.killProcessGroup(app.info.uid, app.pid); + killProcessGroup(app.info.uid, app.pid); } if (lrui <= mLruProcessActivityStart) { mLruProcessActivityStart--; @@ -3115,7 +3121,7 @@ public final class ActivityManagerService extends ActivityManagerNative // clean it up now. if (DEBUG_PROCESSES || DEBUG_CLEANUP) Slog.v(TAG_PROCESSES, "App died: " + app); checkTime(startTime, "startProcess: bad proc running, killing"); - Process.killProcessGroup(app.info.uid, app.pid); + killProcessGroup(app.info.uid, app.pid); handleAppDiedLocked(app, true, true); checkTime(startTime, "startProcess: done killing old proc"); } @@ -4603,7 +4609,7 @@ public final class ActivityManagerService extends ActivityManagerNative if (!fromBinderDied) { Process.killProcessQuiet(pid); } - Process.killProcessGroup(app.info.uid, pid); + killProcessGroup(app.info.uid, pid); app.killed = true; } @@ -5924,7 +5930,7 @@ public final class ActivityManagerService extends ActivityManagerNative EventLog.writeEvent(EventLogTags.AM_DROP_PROCESS, pid); if (pid > 0 && pid != MY_PID) { Process.killProcessQuiet(pid); - //TODO: Process.killProcessGroup(app.info.uid, pid); + //TODO: killProcessGroup(app.info.uid, pid); } else { try { thread.scheduleExit(); @@ -12392,7 +12398,7 @@ public final class ActivityManagerService extends ActivityManagerNative } else { // Huh. Process.killProcess(pid); - Process.killProcessGroup(uid, pid); + killProcessGroup(uid, pid); } } return; diff --git a/services/core/java/com/android/server/am/ProcessRecord.java b/services/core/java/com/android/server/am/ProcessRecord.java index 3acd3a3..bd31a21 100644 --- a/services/core/java/com/android/server/am/ProcessRecord.java +++ b/services/core/java/com/android/server/am/ProcessRecord.java @@ -40,6 +40,7 @@ import android.os.Bundle; import android.os.IBinder; import android.os.Process; import android.os.SystemClock; +import android.os.Trace; import android.os.UserHandle; import android.util.ArrayMap; import android.util.PrintWriterPrinter; @@ -536,6 +537,7 @@ final class ProcessRecord { void kill(String reason, boolean noisy) { if (!killedByAm) { + Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "kill"); if (noisy) { Slog.i(TAG, "Killing " + toShortString() + " (adj " + setAdj + "): " + reason); } @@ -546,6 +548,7 @@ final class ProcessRecord { killed = true; killedByAm = true; } + Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER); } } |