Conditionally pass kernel version to build.prop

This is to replicate Makefile's behavior as-is.

Bug: 322090587
Test: build and compare build command
Change-Id: Ib9ebec920701ea561a007bf2a1ae092ae1b4ff28
This commit is contained in:
Inseob Kim
2024-07-25 19:56:10 +09:00
parent 45ed4c2f9c
commit 036d9e6744
3 changed files with 12 additions and 1 deletions

View File

@@ -121,7 +121,12 @@ func (p *buildPropModule) GenerateAndroidBuildActions(ctx ModuleContext) {
postProcessCmd.Flag("--allow-dup")
}
postProcessCmd.FlagWithArg("--sdk-version ", config.PlatformSdkVersion().String())
postProcessCmd.FlagWithInput("--kernel-version-file-for-uffd-gc ", PathForOutput(ctx, "dexpreopt/kernel_version_for_uffd_gc.txt"))
if ctx.Config().EnableUffdGc() == "default" {
postProcessCmd.FlagWithInput("--kernel-version-file-for-uffd-gc ", PathForOutput(ctx, "dexpreopt/kernel_version_for_uffd_gc.txt"))
} else {
// still need to pass an empty string to kernel-version-file-for-uffd-gc
postProcessCmd.FlagWithArg("--kernel-version-file-for-uffd-gc ", `""`)
}
postProcessCmd.Text(p.outputFilePath.String())
postProcessCmd.Flags(p.properties.Block_list)

View File

@@ -2081,3 +2081,7 @@ func (c *config) UseDebugArt() bool {
func (c *config) SystemPropFiles(ctx PathContext) Paths {
return PathsForSource(ctx, c.productVariables.SystemPropFiles)
}
func (c *config) EnableUffdGc() string {
return String(c.productVariables.EnableUffdGc)
}

View File

@@ -508,6 +508,8 @@ type ProductVariables struct {
ArtTargetIncludeDebugBuild *bool `json:",omitempty"`
SystemPropFiles []string `json:",omitempty"`
EnableUffdGc *string `json:",omitempty"`
}
type PartitionQualifiedVariablesType struct {