dexpreopt: Use the dirty-image-objects path from frameworks/base.

Test: m
Bug: 176171716
Change-Id: Ifbc08ae03e2b1bec7161948970bd197386e3b305
This commit is contained in:
Nicolas Geoffray
2021-01-20 14:30:40 +00:00
parent 4d31a041c7
commit 1086e604b9
2 changed files with 8 additions and 11 deletions

View File

@@ -79,8 +79,6 @@ type GlobalConfig struct {
CpuVariant map[android.ArchType]string // cpu variant for each architecture CpuVariant map[android.ArchType]string // cpu variant for each architecture
InstructionSetFeatures map[android.ArchType]string // instruction set for each architecture InstructionSetFeatures map[android.ArchType]string // instruction set for each architecture
// Only used for boot image
DirtyImageObjects android.OptionalPath // path to a dirty-image-objects file
BootImageProfiles android.Paths // path to a boot-image-profile.txt file BootImageProfiles android.Paths // path to a boot-image-profile.txt file
BootFlags string // extra flags to pass to dex2oat for the boot image BootFlags string // extra flags to pass to dex2oat for the boot image
Dex2oatImageXmx string // max heap size for dex2oat for the boot image Dex2oatImageXmx string // max heap size for dex2oat for the boot image
@@ -178,7 +176,6 @@ func ParseGlobalConfig(ctx android.PathContext, data []byte) (*GlobalConfig, err
// Copies of entries in GlobalConfig that are not constructable without extra parameters. They will be // Copies of entries in GlobalConfig that are not constructable without extra parameters. They will be
// used to construct the real value manually below. // used to construct the real value manually below.
DirtyImageObjects string
BootImageProfiles []string BootImageProfiles []string
} }
@@ -189,7 +186,6 @@ func ParseGlobalConfig(ctx android.PathContext, data []byte) (*GlobalConfig, err
} }
// Construct paths that require a PathContext. // Construct paths that require a PathContext.
config.GlobalConfig.DirtyImageObjects = android.OptionalPathForPath(constructPath(ctx, config.DirtyImageObjects))
config.GlobalConfig.BootImageProfiles = constructPaths(ctx, config.BootImageProfiles) config.GlobalConfig.BootImageProfiles = constructPaths(ctx, config.BootImageProfiles)
return config.GlobalConfig, nil return config.GlobalConfig, nil
@@ -545,7 +541,6 @@ func GlobalConfigForTests(ctx android.PathContext) *GlobalConfig {
EmptyDirectory: "empty_dir", EmptyDirectory: "empty_dir",
CpuVariant: nil, CpuVariant: nil,
InstructionSetFeatures: nil, InstructionSetFeatures: nil,
DirtyImageObjects: android.OptionalPath{},
BootImageProfiles: nil, BootImageProfiles: nil,
BootFlags: "", BootFlags: "",
Dex2oatImageXmx: "", Dex2oatImageXmx: "",

View File

@@ -622,8 +622,10 @@ func buildBootImageVariant(ctx android.SingletonContext, image *bootImageVariant
cmd.FlagWithInput("--profile-file=", profile) cmd.FlagWithInput("--profile-file=", profile)
} }
if global.DirtyImageObjects.Valid() { dirtyImageFile := "frameworks/base/config/dirty-image-objects"
cmd.FlagWithInput("--dirty-image-objects=", global.DirtyImageObjects.Path()) dirtyImagePath := android.ExistentPathForSource(ctx, dirtyImageFile)
if dirtyImagePath.Valid() {
cmd.FlagWithInput("--dirty-image-objects=", dirtyImagePath.Path())
} }
if image.extends != nil { if image.extends != nil {