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

Commit 92453575 authored by Martijn Coenen's avatar Martijn Coenen
Browse files

Be more robust against premature process crash.

In case a process crashes right after calling `attachApplication`, it is
possible that binder wasn't able to get the PID of the process while
delivering the transaction, resulting in a PID of 0. libprocessgroup's
killProcessGroup() requires a positive PID, so only call when we got a
valid PID.

Bug: 297833427
Test: N/A
Change-Id: I7f815bcccfac05cd84f53a1dd9d5b457275b7558
parent 67890dbe
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -4869,8 +4869,10 @@ public class ActivityManagerService extends IActivityManager.Stub
        } else {
            Slog.wtf(TAG, "Mismatched or missing ProcessRecord: " + app + ". Pid: " + pid
                    + ". Uid: " + uid);
            if (pid > 0) {
                killProcess(pid);
                killProcessGroup(uid, pid);
            }
            mProcessList.noteAppKill(pid, uid,
                    ApplicationExitInfo.REASON_INITIALIZATION_FAILURE,
                    ApplicationExitInfo.SUBREASON_UNKNOWN,