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

Commit f0036acb authored by Calin Juravle's avatar Calin Juravle Committed by android-build-merger
Browse files

[RFC] Special case system apps for profile optimizations am: 08313b0d am: 788e111c

am: 0bc450ac

Change-Id: I18324f1074a8c62002b88810ffcf61cd2efcd21e
parents 88b02592 0bc450ac
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -7269,6 +7269,19 @@ public class PackageManagerService extends IPackageManager.Stub {
                compilerFilter = getNonProfileGuidedCompilerFilter(compilerFilter);
            }
            // If the OTA updates a system app which was previously preopted to a non-preopted state
            // the app might end up being verified at runtime. That's because by default the apps
            // are verify-profile but for preopted apps there's no profile.
            // Do a hacky check to ensure that if we have no profiles (a reasonable indication
            // that before the OTA the app was preopted) the app gets compiled with a non-profile
            // filter (by default interpret-only).
            // Note that at this stage unused apps are already filtered.
            if (isSystemApp(pkg) &&
                    DexFile.isProfileGuidedCompilerFilter(compilerFilter) &&
                    !Environment.getReferenceProfile(pkg.packageName).exists()) {
                compilerFilter = getNonProfileGuidedCompilerFilter(compilerFilter);
            }
            // checkProfiles is false to avoid merging profiles during boot which
            // might interfere with background compilation (b/28612421).
            // Unfortunately this will also means that "pm.dexopt.boot=speed-profile" will