Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2dabfda8 authored by Mateus Azis's avatar Mateus Azis
Browse files

Log process exit reason and subreason as strings.

These are currently logged as integers, but this makes them harder to
use during debugging. Log them as strings instead to make them more
helpful.

Test: flipped ActivityManagerDebugConfig and observed the following log
  when swiping up to kill an activity:

  07-01 10:54:48.698   784   813 I ActivityManager: note: ProcessRecord{d3e8a8 3858:com.android.dialer/u0a63} is being killed, reason: USER REQUESTED, sub-reason: REMOVE TASK, message: remove task

Change-Id: I84c0d8f54a01f9ee6d0e774a56d35b31b875ac14
parent 8cdf261e
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -5491,8 +5491,9 @@ public final class ProcessList {
    void noteAppKill(final ProcessRecord app, final @Reason int reason,
            final @SubReason int subReason, final String msg) {
        if (DEBUG_PROCESSES) {
            Slog.i(TAG, "note: " + app + " is being killed, reason: " + reason
                    + ", sub-reason: " + subReason + ", message: " + msg);
            Slog.i(TAG, "note: " + app + " is being killed, reason: "
                    + ApplicationExitInfo.reasonCodeToString(reason) + ", sub-reason: "
                    + ApplicationExitInfo.subreasonToString(subReason) + ", message: " + msg);
        }
        if (app.getPid() > 0 && !app.isolated && app.getDeathRecipient() != null) {
            // We are killing it, put it into the dying process list.