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

Commit 2cf1cf43 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove exception from OverlayConfig zygote method"

parents 6c839dd1 857ce7ac
Loading
Loading
Loading
Loading
+5 −17
Original line number Diff line number Diff line
@@ -186,13 +186,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 +202,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;
    }

@@ -373,10 +365,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 =