Merge "Add system_ext support to build_prop module" into main

This commit is contained in:
Treehugger Robot
2024-08-06 02:00:28 +00:00
committed by Gerrit Code Review
5 changed files with 44 additions and 14 deletions

View File

@@ -37,6 +37,9 @@ type buildPropProperties struct {
// Path to a JSON file containing product configs.
Product_config *string `android:"path"`
// Optional subdirectory under which this file is installed into
Relative_install_path *string
}
type buildPropModule struct {
@@ -56,6 +59,8 @@ func (p *buildPropModule) propFiles(ctx ModuleContext) Paths {
partition := p.PartitionTag(ctx.DeviceConfig())
if partition == "system" {
return ctx.Config().SystemPropFiles(ctx)
} else if partition == "system_ext" {
return ctx.Config().SystemExtPropFiles(ctx)
}
return nil
}
@@ -84,8 +89,8 @@ func (p *buildPropModule) GenerateAndroidBuildActions(ctx ModuleContext) {
}
partition := p.PartitionTag(ctx.DeviceConfig())
if partition != "system" {
ctx.PropertyErrorf("partition", "unsupported partition %q: only \"system\" is supported", partition)
if partition != "system" && partition != "system_ext" {
ctx.PropertyErrorf("partition", "unsupported partition %q: only \"system\" and \"system_ext\" are supported", partition)
return
}
@@ -134,7 +139,7 @@ func (p *buildPropModule) GenerateAndroidBuildActions(ctx ModuleContext) {
rule.Build(ctx.ModuleName(), "generating build.prop")
p.installPath = PathForModuleInstall(ctx)
p.installPath = PathForModuleInstall(ctx, proptools.String(p.properties.Relative_install_path))
ctx.InstallFile(p.installPath, p.stem(), p.outputFilePath)
ctx.SetOutputFiles(Paths{p.outputFilePath}, "")

View File

@@ -2090,6 +2090,10 @@ func (c *config) SystemPropFiles(ctx PathContext) Paths {
return PathsForSource(ctx, c.productVariables.SystemPropFiles)
}
func (c *config) SystemExtPropFiles(ctx PathContext) Paths {
return PathsForSource(ctx, c.productVariables.SystemExtPropFiles)
}
func (c *config) EnableUffdGc() string {
return String(c.productVariables.EnableUffdGc)
}

View File

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