Revert "Consistently use either "boot" or "apex" boot image as the default."
This reverts commit 48b3b3c71f76fa05de191b8460a186e9dbcc36bf.
Reason for revert: breaks emulator
BUG: 146558375
Change-Id: I2af3d11ad9a014b0d73a73540bc814f245bc6418
diff --git a/java/dexpreopt.go b/java/dexpreopt.go
index 1192d92..479dec6 100644
--- a/java/dexpreopt.go
+++ b/java/dexpreopt.go
@@ -101,6 +101,10 @@
global := dexpreoptGlobalConfig(ctx)
bootImage := defaultBootImageConfig(ctx)
+ defaultBootImage := bootImage
+ if global.UseApexImage {
+ bootImage = apexBootImageConfig(ctx)
+ }
var archs []android.ArchType
for _, a := range ctx.MultiTargets() {
@@ -170,8 +174,11 @@
DexPreoptImagesDeps: imagesDeps,
DexPreoptImageLocations: bootImage.imageLocations,
- PreoptBootClassPathDexFiles: bootImage.dexPathsDeps.Paths(),
- PreoptBootClassPathDexLocations: bootImage.dexLocationsDeps,
+ // We use the dex paths and dex locations of the default boot image, as it
+ // contains the full dexpreopt boot classpath. Other images may just contain a subset of
+ // the dexpreopt boot classpath.
+ PreoptBootClassPathDexFiles: defaultBootImage.dexPathsDeps.Paths(),
+ PreoptBootClassPathDexLocations: defaultBootImage.dexLocationsDeps,
PreoptExtractedApk: false,