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

Commit 4e2db7ce authored by Martijn Coenen's avatar Martijn Coenen
Browse files

Give WebViewZygote process shared app GID.

So WebViewZygote can access profiles belonging to the app.

Bug: 254422654
Flag: EXEMPT bugfix
Test: inspect /proc/pid/maps to verify profiles are loaded
Change-Id: I33ebb8c2f8115cd3f25099987dfb5dad38ed057c
parent 26ac6575
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.content.pm.PackageInfo;
import android.os.Build;
import android.os.ChildZygoteProcess;
import android.os.Process;
import android.os.UserHandle;
import android.os.ZygoteProcess;
import android.text.TextUtils;
import android.util.Log;
@@ -141,12 +142,14 @@ public class WebViewZygote {
            String abi = sPackage.applicationInfo.primaryCpuAbi;
            int runtimeFlags = Zygote.getMemorySafetyRuntimeFlagsForSecondaryZygote(
                    sPackage.applicationInfo, null);
            final int[] sharedAppGid = {
                    UserHandle.getSharedAppGid(UserHandle.getAppId(sPackage.applicationInfo.uid)) };
            sZygote = Process.ZYGOTE_PROCESS.startChildZygote(
                    "com.android.internal.os.WebViewZygoteInit",
                    "webview_zygote",
                    Process.WEBVIEW_ZYGOTE_UID,
                    Process.WEBVIEW_ZYGOTE_UID,
                    null,  // gids
                    sharedAppGid,  // Access to shared app GID for ART profiles
                    runtimeFlags,
                    "webview_zygote",  // seInfo
                    abi,  // abi