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

Commit b8b72773 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Revert "Revert "Remove exception from OverlayConfig zygote method"""...

Merge "Revert "Revert "Remove exception from OverlayConfig zygote method""" into rvc-dev am: 6f0c1bc1 am: 93d48d19

Change-Id: Iaa791e6ff33bf09cbd20f14249d81793b58b2138
parents de4d0acf 93d48d19
Loading
Loading
Loading
Loading
+5 −18
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ import android.annotation.Nullable;
import android.content.pm.PackagePartitions;
import android.content.pm.parsing.ParsingPackageRead;
import android.os.Build;
import android.os.Process;
import android.os.Trace;
import android.util.ArrayMap;
import android.util.Log;
@@ -186,13 +185,6 @@ public class OverlayConfig {
     */
    @NonNull
    public static OverlayConfig getZygoteInstance() {
        if (Process.myUid() != Process.ROOT_UID) {
            // Scan the overlays in the zygote process to generate configuration settings for
            // overlays on the system image. Do not cache this instance so OverlayConfig will not
            // be present in applications by default.
            throw new IllegalStateException("Can only be invoked in the root process");
        }

        Trace.traceBegin(Trace.TRACE_TAG_RRO, "OverlayConfig#getZygoteInstance");
        try {
            return new OverlayConfig(null /* rootDirectory */, OverlayScanner::new,
@@ -209,13 +201,12 @@ public class OverlayConfig {
     */
    @NonNull
    public static OverlayConfig initializeSystemInstance(PackageProvider packageProvider) {
        if (Process.myUid() != Process.SYSTEM_UID) {
            throw new IllegalStateException("Can only be invoked in the system process");
        }

        Trace.traceBegin(Trace.TRACE_TAG_RRO, "OverlayConfig#initializeSystemInstance");
        try {
            sInstance = new OverlayConfig(null, null, packageProvider);
        } finally {
            Trace.traceEnd(Trace.TRACE_TAG_RRO);
        }
        return sInstance;
    }

@@ -379,10 +370,6 @@ public class OverlayConfig {
     */
    @NonNull
    public String[] createImmutableFrameworkIdmapsInZygote() {
        if (Process.myUid() != Process.ROOT_UID) {
            throw new IllegalStateException("This method can only be called from the root process");
        }

        final String targetPath = "/system/framework/framework-res.apk";
        final ArrayList<String> idmapPaths = new ArrayList<>();
        final ArrayList<IdmapInvocation> idmapInvocations =