summaryrefslogtreecommitdiff
path: root/java/dexpreopt_bootjars.go
diff options
context:
space:
mode:
author Jiakai Zhang <jiakaiz@google.com> 2023-05-10 17:04:53 +0100
committer Jiakai Zhang <jiakaiz@google.com> 2023-05-11 18:25:18 +0100
commit09d88df0407263e846b01c226184b262f2e36678 (patch)
treeca5ca5504dd326973413adaf910c44ca73c13f9e /java/dexpreopt_bootjars.go
parentb47caccbc037b65462f757c462a99732ad6dd51c (diff)
Unify installDirOnHost and installDirOnDevice.
These two fields never do what they are described to do. This CL unifies them to avoid the confusion. Bug: 280440941 Test: m Change-Id: I3652d73a50832a2e494d9f5cae750f5fc38293b4
Diffstat (limited to 'java/dexpreopt_bootjars.go')
-rw-r--r--java/dexpreopt_bootjars.go17
1 files changed, 9 insertions, 8 deletions
diff --git a/java/dexpreopt_bootjars.go b/java/dexpreopt_bootjars.go
index 7b5c294a0..792fa6396 100644
--- a/java/dexpreopt_bootjars.go
+++ b/java/dexpreopt_bootjars.go
@@ -250,11 +250,12 @@ type bootImageConfig struct {
// Output directory for the image files with debug symbols.
symbolsDir android.OutputPath
- // Subdirectory where the image files are installed.
- installDirOnHost string
-
- // Subdirectory where the image files on device are installed.
- installDirOnDevice string
+ // The relative location where the image files are installed. On host, the location is relative to
+ // $ANDROID_PRODUCT_OUT.
+ //
+ // Only the configs that are built by platform_bootclasspath are installable on device. On device,
+ // the location is relative to "/".
+ installDir string
// Install path of the boot image profile if it needs to be installed in the APEX, or empty if not
// needed.
@@ -668,9 +669,9 @@ func buildBootImageVariant(ctx android.ModuleContext, image *bootImageVariant, p
arch := image.target.Arch.ArchType
os := image.target.Os.String() // We need to distinguish host-x86 and device-x86.
- symbolsDir := image.symbolsDir.Join(ctx, os, image.installDirOnHost, arch.String())
+ symbolsDir := image.symbolsDir.Join(ctx, os, image.installDir, arch.String())
symbolsFile := symbolsDir.Join(ctx, image.stem+".oat")
- outputDir := image.dir.Join(ctx, os, image.installDirOnHost, arch.String())
+ outputDir := image.dir.Join(ctx, os, image.installDir, arch.String())
outputPath := outputDir.Join(ctx, image.stem+".oat")
oatLocation := dexpreopt.PathToLocation(outputPath, arch)
imagePath := outputPath.ReplaceExtension(ctx, "art")
@@ -796,7 +797,7 @@ func buildBootImageVariant(ctx android.ModuleContext, image *bootImageVariant, p
cmd.Textf(`|| ( echo %s ; false )`, proptools.ShellEscape(failureMessage))
- installDir := filepath.Join("/", image.installDirOnHost, arch.String())
+ installDir := filepath.Dir(image.imagePathOnDevice)
var vdexInstalls android.RuleBuilderInstalls
var unstrippedInstalls android.RuleBuilderInstalls