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

Commit 60c4ffb1 authored by Martijn Coenen's avatar Martijn Coenen
Browse files

Give AppZygote process shared app GID.

So AppZygote can access profiles belonging to the app.

Bug: 254422654
Flag: EXEMPT bugfix
Test: inspect /proc/pid/maps to verify profiles are loaded
Change-Id: Ibf0f43accff687bfe172796086124f77eeca574d
parent 2ea93073
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -111,12 +111,15 @@ public class AppZygote {
        try {
            int runtimeFlags = Zygote.getMemorySafetyRuntimeFlagsForSecondaryZygote(
                    mAppInfo, mProcessInfo);

            final int[] sharedAppGid = {
                    UserHandle.getSharedAppGid(UserHandle.getAppId(mAppInfo.uid)) };
            mZygote = Process.ZYGOTE_PROCESS.startChildZygote(
                    "com.android.internal.os.AppZygoteInit",
                    mAppInfo.processName + "_zygote",
                    mZygoteUid,
                    mZygoteUid,
                    null,  // gids
                    sharedAppGid,  // Zygote gets access to shared app GID for profiles
                    runtimeFlags,
                    "app_zygote",  // seInfo
                    abi,  // abi