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

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

Merge "Skip dexopt if app has preferCodeIntegrity=true"

parents 6136239d f12af2f6
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1955,6 +1955,11 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
        return (privateFlags & ApplicationInfo.PRIVATE_FLAG_PRODUCT_SERVICES) != 0;
    }

    /** @hide */
    public boolean isCodeIntegrityPreferred() {
        return (privateFlags & PRIVATE_FLAG_PREFER_CODE_INTEGRITY) != 0;
    }

    /**
     * Returns whether or not this application was installed as a virtual preload.
     */
+1 −1
Original line number Diff line number Diff line
@@ -1502,7 +1502,7 @@ public final class ProcessList {
                mService.mNativeDebuggingApp = null;
            }

            if ((app.info.privateFlags & ApplicationInfo.PRIVATE_FLAG_PREFER_CODE_INTEGRITY) != 0
            if (app.info.isCodeIntegrityPreferred()
                    || (app.info.isPrivilegedApp()
                        && DexManager.isPackageSelectedToRunOob(app.pkgList.mPkgList.keySet()))) {
                runtimeFlags |= Zygote.ONLY_USE_SYSTEM_OAT_FILES;
+4 −2
Original line number Diff line number Diff line
@@ -506,8 +506,10 @@ public class PackageDexOptimizer {
            boolean isUsedByOtherApps) {
        int flags = info.flags;
        boolean vmSafeMode = (flags & ApplicationInfo.FLAG_VM_SAFE_MODE) != 0;
        // When a priv app is configured to run out of box, only verify it.
        if (info.isPrivilegedApp() && DexManager.isPackageSelectedToRunOob(info.packageName)) {
        // When an app or priv app is configured to run out of box, only verify it.
        if (info.isCodeIntegrityPreferred()
                || (info.isPrivilegedApp()
                    && DexManager.isPackageSelectedToRunOob(info.packageName))) {
            return "verify";
        }
        if (vmSafeMode) {