From 26756a86c13ea36cc12fa6983a75fef1797b4fd9 Mon Sep 17 00:00:00 2001 From: Inseob Kim Date: Thu, 25 Jul 2024 10:58:08 +0000 Subject: [PATCH] Revert^4 "Add TARGET_SYSTEM_PROP to system build.prop" 072c0e4fcb3f9952e0d0dda7d56a595bca55dfcb Change-Id: I53a36f415a9bd472170f030f115039e623769acf --- android/build_prop.go | 13 +++++++++---- android/config.go | 4 ++++ android/variable.go | 2 ++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/android/build_prop.go b/android/build_prop.go index ed3e9c81f..d3ccecb66 100644 --- a/android/build_prop.go +++ b/android/build_prop.go @@ -31,10 +31,6 @@ type buildPropProperties struct { // properties in prop_files. Block_list []string - // Path to the input prop files. The contents of the files are directly - // emitted to the output - Prop_files []string `android:"path"` - // Files to be appended at the end of build.prop. These files are appended after // post_process_props without any further checking. Footer_files []string `android:"path"` @@ -56,6 +52,14 @@ func (p *buildPropModule) stem() string { return proptools.StringDefault(p.properties.Stem, "build.prop") } +func (p *buildPropModule) propFiles(ctx ModuleContext) Paths { + partition := p.PartitionTag(ctx.DeviceConfig()) + if partition == "system" { + return ctx.Config().SystemPropFiles(ctx) + } + return nil +} + func (p *buildPropModule) GenerateAndroidBuildActions(ctx ModuleContext) { p.outputFilePath = PathForModuleOut(ctx, "build.prop").OutputPath if !ctx.Config().KatiEnabled() { @@ -94,6 +98,7 @@ func (p *buildPropModule) GenerateAndroidBuildActions(ctx ModuleContext) { cmd.FlagWithInput("--platform-preview-sdk-fingerprint-file=", ApiFingerprintPath(ctx)) cmd.FlagWithInput("--product-config=", PathForModuleSrc(ctx, proptools.String(p.properties.Product_config))) cmd.FlagWithArg("--partition=", partition) + cmd.FlagForEachInput("--prop-files=", ctx.Config().SystemPropFiles(ctx)) cmd.FlagWithOutput("--out=", p.outputFilePath) postProcessCmd := rule.Command().BuiltTool("post_process_props") diff --git a/android/config.go b/android/config.go index eff9fdd5b..92aae7e16 100644 --- a/android/config.go +++ b/android/config.go @@ -2077,3 +2077,7 @@ func (c *config) UseDebugArt() bool { return Bool(c.productVariables.Eng) } + +func (c *config) SystemPropFiles(ctx PathContext) Paths { + return PathsForSource(ctx, c.productVariables.SystemPropFiles) +} diff --git a/android/variable.go b/android/variable.go index eb0e210c5..5356e8525 100644 --- a/android/variable.go +++ b/android/variable.go @@ -506,6 +506,8 @@ type ProductVariables struct { OemProperties []string `json:",omitempty"` ArtTargetIncludeDebugBuild *bool `json:",omitempty"` + + SystemPropFiles []string `json:",omitempty"` } type PartitionQualifiedVariablesType struct {