OSDN Git Service

Pass DEXOPT_INSTALL_WITH_DEX_METADATA_FILE for first boot
authorMathieu Chartier <mathieuc@google.com>
Fri, 16 Feb 2018 02:35:52 +0000 (18:35 -0800)
committerMathieu Chartier <mathieuc@google.com>
Fri, 16 Feb 2018 02:51:18 +0000 (18:51 -0800)
Motivation, use dm files in system partition for verifying if they
exist.

Bug: 70934104
Test: manual

Change-Id: I1224101eb830ce7c7bedb3a81b7569df1ef50491

services/core/java/com/android/server/pm/PackageManagerService.java

index 4997635..900e188 100644 (file)
@@ -9851,6 +9851,10 @@ public class PackageManagerService extends IPackageManager.Stub
             // behave differently than "pm.dexopt.bg-dexopt=speed-profile" but that's a
             // trade-off worth doing to save boot time work.
             int dexoptFlags = bootComplete ? DexoptOptions.DEXOPT_BOOT_COMPLETE : 0;
+            if (compilationReason == REASON_FIRST_BOOT) {
+                // TODO: This doesn't cover the upgrade case, we should check for this too.
+                dexoptFlags |= DexoptOptions.DEXOPT_INSTALL_WITH_DEX_METADATA_FILE;
+            }
             int primaryDexOptStaus = performDexOptTraced(new DexoptOptions(
                     pkg.packageName,
                     pkgCompilationReason,