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

Commit 0a91f61a authored by Martijn Coenen's avatar Martijn Coenen
Browse files

Use killProcessGroup when killing app zygote.

To make sure we kill all untracked children, too.

Bug: 156741968
Bug: 157598956
Test: manual inspection, PoC no longer works.
Change-Id: I5d8efeb05ddec08a7fc7c00eabca6590c4cfdd8c
parent f2811097
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -90,10 +90,9 @@ public class AppZygote {
    @GuardedBy("mLock")
    @GuardedBy("mLock")
    private void stopZygoteLocked() {
    private void stopZygoteLocked() {
        if (mZygote != null) {
        if (mZygote != null) {
            // Close the connection and kill the zygote process. This will not cause
            // child processes to be killed by itself.
            mZygote.close();
            mZygote.close();
            Process.killProcess(mZygote.getPid());
            // use killProcessGroup() here, so we kill all untracked children as well.
            Process.killProcessGroup(mZygoteUid, mZygote.getPid());
            mZygote = null;
            mZygote = null;
        }
        }
    }
    }