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

Commit cfdc5df9 authored by Calin Juravle's avatar Calin Juravle Committed by Automerger Merge Worker
Browse files

Merge "Use the same reason for OTAs and First Boots" am: 274d2004 am: dbbebbe0

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1573881

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ibc7ef2f65ed04ddc97c5fe27f33f5b2a5a23f127
parents 8cacd6d9 dbbebbe0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -241,7 +241,7 @@ public class BackgroundDexOptService extends JobService {
            // trade-off worth doing to save boot time work.
            int result = pm.performDexOptWithStatus(new DexoptOptions(
                    pkg,
                    PackageManagerService.REASON_BOOT,
                    PackageManagerService.REASON_POST_BOOT,
                    DexoptOptions.DEXOPT_BOOT_COMPLETE));
            if (result == PackageDexOptimizer.DEX_OPT_PERFORMED)  {
                updatedPackages.add(pkg);
+2 −1
Original line number Diff line number Diff line
@@ -687,7 +687,8 @@ public class PackageDexOptimizer {
        boolean generateCompactDex = true;
        switch (compilationReason) {
            case PackageManagerService.REASON_FIRST_BOOT:
            case PackageManagerService.REASON_BOOT:
            case PackageManagerService.REASON_BOOT_AFTER_OTA:
            case PackageManagerService.REASON_POST_BOOT:
            case PackageManagerService.REASON_INSTALL:
                 generateCompactDex = false;
        }
+14 −16
Original line number Diff line number Diff line
@@ -678,17 +678,18 @@ public class PackageManagerService extends IPackageManager.Stub
    // Compilation reasons.
    public static final int REASON_UNKNOWN = -1;
    public static final int REASON_FIRST_BOOT = 0;
    public static final int REASON_BOOT = 1;
    public static final int REASON_INSTALL = 2;
    public static final int REASON_INSTALL_FAST = 3;
    public static final int REASON_INSTALL_BULK = 4;
    public static final int REASON_INSTALL_BULK_SECONDARY = 5;
    public static final int REASON_INSTALL_BULK_DOWNGRADED = 6;
    public static final int REASON_INSTALL_BULK_SECONDARY_DOWNGRADED = 7;
    public static final int REASON_BACKGROUND_DEXOPT = 8;
    public static final int REASON_AB_OTA = 9;
    public static final int REASON_INACTIVE_PACKAGE_DOWNGRADE = 10;
    public static final int REASON_SHARED = 11;
    public static final int REASON_BOOT_AFTER_OTA = 1;
    public static final int REASON_POST_BOOT = 2;
    public static final int REASON_INSTALL = 3;
    public static final int REASON_INSTALL_FAST = 4;
    public static final int REASON_INSTALL_BULK = 5;
    public static final int REASON_INSTALL_BULK_SECONDARY = 6;
    public static final int REASON_INSTALL_BULK_DOWNGRADED = 7;
    public static final int REASON_INSTALL_BULK_SECONDARY_DOWNGRADED = 8;
    public static final int REASON_BACKGROUND_DEXOPT = 9;
    public static final int REASON_AB_OTA = 10;
    public static final int REASON_INACTIVE_PACKAGE_DOWNGRADE = 11;
    public static final int REASON_SHARED = 12;
    public static final int REASON_LAST = REASON_SHARED;
@@ -9673,10 +9674,7 @@ public class PackageManagerService extends IPackageManager.Stub
        //       first boot, as they do not have profile data.
        boolean causeFirstBoot = isFirstBoot() || mIsPreNUpgrade;
        // We need to re-extract after a pruned cache, as AoT-ed files will be out of date.
        boolean causePrunedCache = VMRuntime.didPruneDalvikCache();
        if (!causeUpgrade && !causeFirstBoot && !causePrunedCache) {
        if (!causeUpgrade && !causeFirstBoot) {
            return;
        }
@@ -9693,7 +9691,7 @@ public class PackageManagerService extends IPackageManager.Stub
        final long startTime = System.nanoTime();
        final int[] stats = performDexOptUpgrade(pkgs, mIsPreNUpgrade /* showDialog */,
                    causeFirstBoot ? REASON_FIRST_BOOT : REASON_BOOT,
                    causeFirstBoot ? REASON_FIRST_BOOT : REASON_BOOT_AFTER_OTA,
                    false /* bootComplete */);
        final int elapsedTimeSeconds =
+2 −1
Original line number Diff line number Diff line
@@ -29,7 +29,8 @@ public class PackageManagerServiceCompilerMapping {
    // Names for compilation reasons.
    public static final String REASON_STRINGS[] = {
        "first-boot",
        "boot",
        "boot-after-ota",
        "post-boot",
        "install",
        "install-fast",
        "install-bulk",
+5 −2
Original line number Diff line number Diff line
@@ -587,7 +587,7 @@ public class ArtManagerService extends android.content.pm.dex.IArtManager.Stub {
    private static final int TRON_COMPILATION_REASON_ERROR = 0;
    private static final int TRON_COMPILATION_REASON_UNKNOWN = 1;
    private static final int TRON_COMPILATION_REASON_FIRST_BOOT = 2;
    private static final int TRON_COMPILATION_REASON_BOOT = 3;
    private static final int TRON_COMPILATION_REASON_BOOT_DEPRECATED_SINCE_S = 3;
    private static final int TRON_COMPILATION_REASON_INSTALL = 4;
    private static final int TRON_COMPILATION_REASON_BG_DEXOPT = 5;
    private static final int TRON_COMPILATION_REASON_AB_OTA = 6;
@@ -605,6 +605,8 @@ public class ArtManagerService extends android.content.pm.dex.IArtManager.Stub {
    private static final int TRON_COMPILATION_REASON_INSTALL_BULK_DOWNGRADED_WITH_DM = 18;
    private static final int
            TRON_COMPILATION_REASON_INSTALL_BULK_SECONDARY_DOWNGRADED_WITH_DM = 19;
    private static final int TRON_COMPILATION_REASON_BOOT_AFTER_OTA = 20;
    private static final int TRON_COMPILATION_REASON_POST_BOOT = 21;

    // The annotation to add as a suffix to the compilation reason when dexopt was
    // performed with dex metadata.
@@ -618,7 +620,8 @@ public class ArtManagerService extends android.content.pm.dex.IArtManager.Stub {
            case "unknown" : return TRON_COMPILATION_REASON_UNKNOWN;
            case "error" : return TRON_COMPILATION_REASON_ERROR;
            case "first-boot" : return TRON_COMPILATION_REASON_FIRST_BOOT;
            case "boot" : return TRON_COMPILATION_REASON_BOOT;
            case "boot-after-ota": return TRON_COMPILATION_REASON_BOOT_AFTER_OTA;
            case "post-boot" : return TRON_COMPILATION_REASON_POST_BOOT;
            case "install" : return TRON_COMPILATION_REASON_INSTALL;
            case "bg-dexopt" : return TRON_COMPILATION_REASON_BG_DEXOPT;
            case "ab-ota" : return TRON_COMPILATION_REASON_AB_OTA;
Loading