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

Commit 01d6f5eb authored by Christopher Tate's avatar Christopher Tate Committed by Jessica Wagantall
Browse files

Kill the real/isolated uid group, not the ApplicationInfo uid

This is a direct reimplementation in L of fixes applied to N in
these two commits:

8dc8d37c
e8741d23

Ticket: CYNGNOS-2707
Bug 19285814

Change-Id: I59bcc8f1d41c426e9da635bea9ad1d7c6756d5aa
parent 41bccb8e
Loading
Loading
Loading
Loading
+5 −9
Original line number Diff line number Diff line
@@ -3013,7 +3013,7 @@ public final class ActivityManagerService extends ActivityManagerNative
            if (!app.killed) {
                Slog.wtfStack(TAG, "Removing process that hasn't been killed: " + app);
                Process.killProcessQuiet(app.pid);
                killProcessGroup(app.info.uid, app.pid);
                Process.killProcessGroup(app.uid, app.pid);
            }
            if (lrui <= mLruProcessActivityStart) {
                mLruProcessActivityStart--;
@@ -3388,7 +3388,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");
            killProcessGroup(app.info.uid, app.pid);
            Process.killProcessGroup(app.uid, app.pid);
            handleAppDiedLocked(app, true, true);
            checkTime(startTime, "startProcess: done killing old proc");
        }
@@ -4920,13 +4920,9 @@ public final class ActivityManagerService extends ActivityManagerNative
            stats.noteProcessDiedLocked(app.info.uid, pid);
        }
        if (!app.killed) {
            if (!fromBinderDied) {
        Process.killProcessQuiet(pid);
            }
            killProcessGroup(app.info.uid, pid);
        Process.killProcessGroup(app.uid, pid);
        app.killed = true;
        }
        // Clean up already done if the process has been re-started.
        if (app.pid == pid && app.thread != null &&
+1 −1
Original line number Diff line number Diff line
@@ -578,7 +578,7 @@ final class ProcessRecord {
            }
            EventLog.writeEvent(EventLogTags.AM_KILL, userId, pid, processName, setAdj, reason);
            Process.killProcessQuiet(pid);
            Process.killProcessGroup(info.uid, pid);
            Process.killProcessGroup(uid, pid);
            if (!persistent) {
                killed = true;
                killedByAm = true;