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

Commit d2204db2 authored by Nicolas Geoffray's avatar Nicolas Geoffray Committed by Android (Google) Code Review
Browse files

Merge "Rewrite handling of oob priv-apps in framework."

parents c510a619 11d21a29
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -4063,7 +4063,6 @@ public class ActivityManagerService extends IActivityManager.Stub
            if (app.info.isPrivilegedApp() &&
            if (app.info.isPrivilegedApp() &&
                    SystemProperties.getBoolean("pm.dexopt.priv-apps-oob", false)) {
                    SystemProperties.getBoolean("pm.dexopt.priv-apps-oob", false)) {
                runtimeFlags |= Zygote.DISABLE_VERIFIER;
                runtimeFlags |= Zygote.ONLY_USE_SYSTEM_OAT_FILES;
                runtimeFlags |= Zygote.ONLY_USE_SYSTEM_OAT_FILES;
            }
            }
+5 −5
Original line number Original line Diff line number Diff line
@@ -111,11 +111,6 @@ public class PackageDexOptimizer {
            return false;
            return false;
        }
        }


        // We do not dexopt a priv-app package when pm.dexopt.priv-apps-oob is true.
        if (pkg.isPrivileged()) {
            return !SystemProperties.getBoolean("pm.dexopt.priv-apps-oob", false);
        }

        return true;
        return true;
    }
    }


@@ -481,6 +476,11 @@ public class PackageDexOptimizer {
            boolean isUsedByOtherApps) {
            boolean isUsedByOtherApps) {
        int flags = info.flags;
        int flags = info.flags;
        boolean vmSafeMode = (flags & ApplicationInfo.FLAG_VM_SAFE_MODE) != 0;
        boolean vmSafeMode = (flags & ApplicationInfo.FLAG_VM_SAFE_MODE) != 0;
        // When pm.dexopt.priv-apps-oob is true, we only verify privileged apps.
        if (info.isPrivilegedApp() &&
            SystemProperties.getBoolean("pm.dexopt.priv-apps-oob", false)) {
          return "verify";
        }
        if (vmSafeMode) {
        if (vmSafeMode) {
            return getSafeModeCompilerFilter(targetCompilerFilter);
            return getSafeModeCompilerFilter(targetCompilerFilter);
        }
        }