Rename fields in dexpreopt config
Add 'host' into the name of fields regarding path on the host side to
distinguish between paths on the device(which will be added in the
following commit), and paths on the host.
Bug: 158843648
Test: build and flash, and then
adb wait-for-device \
&& adb -s $S root \
&& adb -s $S logcat \
| grep -E 'ClassLoaderContext [a-z ]+ mismatch' -C 1
Change-Id: Ib2645ed51591ba2f4b726c115b401ad2bd6675da
diff --git a/java/dexpreopt_config.go b/java/dexpreopt_config.go
index 0ab6502..9eb3f49 100644
--- a/java/dexpreopt_config.go
+++ b/java/dexpreopt_config.go
@@ -84,26 +84,26 @@
artModules := global.ArtApexJars
frameworkModules := global.BootJars.RemoveList(artModules)
- artSubdir := "apex/art_boot_images/javalib"
+ artDirOnHost := "apex/art_boot_images/javalib"
frameworkSubdir := "system/framework"
// ART config for the primary boot image in the ART apex.
// It includes the Core Libraries.
artCfg := bootImageConfig{
- name: artBootImageName,
- stem: "boot",
- installSubdir: artSubdir,
- modules: artModules,
+ name: artBootImageName,
+ stem: "boot",
+ installDirOnHost: artDirOnHost,
+ modules: artModules,
}
// Framework config for the boot image extension.
// It includes framework libraries and depends on the ART config.
frameworkCfg := bootImageConfig{
- extends: &artCfg,
- name: frameworkBootImageName,
- stem: "boot",
- installSubdir: frameworkSubdir,
- modules: frameworkModules,
+ extends: &artCfg,
+ name: frameworkBootImageName,
+ stem: "boot",
+ installDirOnHost: frameworkSubdir,
+ modules: frameworkModules,
}
configs := map[string]*bootImageConfig{
@@ -130,11 +130,11 @@
// Create target-specific variants.
for _, target := range targets {
arch := target.Arch.ArchType
- imageDir := c.dir.Join(ctx, target.Os.String(), c.installSubdir, arch.String())
+ imageDir := c.dir.Join(ctx, target.Os.String(), c.installDirOnHost, arch.String())
variant := &bootImageVariant{
bootImageConfig: c,
target: target,
- images: imageDir.Join(ctx, imageName),
+ imagePathOnHost: imageDir.Join(ctx, imageName),
imagesDeps: c.moduleFiles(ctx, imageDir, ".art", ".oat", ".vdex"),
dexLocations: c.modules.DevicePaths(ctx.Config(), target.Os),
}
@@ -148,7 +148,7 @@
// specific to the framework config
frameworkCfg.dexPathsDeps = append(artCfg.dexPathsDeps, frameworkCfg.dexPathsDeps...)
for i := range targets {
- frameworkCfg.variants[i].primaryImages = artCfg.variants[i].images
+ frameworkCfg.variants[i].primaryImages = artCfg.variants[i].imagePathOnHost
frameworkCfg.variants[i].dexLocationsDeps = append(artCfg.variants[i].dexLocations, frameworkCfg.variants[i].dexLocationsDeps...)
}