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

Commit 41e4a376 authored by Mathieu Chartier's avatar Mathieu Chartier
Browse files

Avoid profile guided compilation for vmSafeMode

Bug: 30688277
Bug: 30733908

Test: adb shell cmd package compile -m speed-profile comb.BBClient

Change-Id: I6783c80566b6b3b67025a3d258ebbdede0c7ca2d
parent 47784a79
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -174,6 +174,16 @@ class PackageDexOptimizer {
            isProfileGuidedFilter = false;
        }

        // Disable profile guided compilation for vmSafeMode.
        final boolean vmSafeMode = (pkg.applicationInfo.flags & ApplicationInfo.FLAG_VM_SAFE_MODE)
                != 0;
        final boolean debuggable = (pkg.applicationInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE)
                != 0;
        if (vmSafeMode) {
            targetCompilerFilter = getNonProfileGuidedCompilerFilter(targetCompilerFilter);
            isProfileGuidedFilter = false;
        }

        // If we're asked to take profile updates into account, check now.
        boolean newProfile = false;
        if (checkProfiles && isProfileGuidedFilter) {
@@ -185,9 +195,6 @@ class PackageDexOptimizer {
            }
        }

        final boolean vmSafeMode = (pkg.applicationInfo.flags & ApplicationInfo.FLAG_VM_SAFE_MODE) != 0;
        final boolean debuggable = (pkg.applicationInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;

        boolean performedDexOpt = false;
        boolean successfulDexOpt = true;