Move platform compat config to their own directory.

This prevents SystemConfig from trying to read them. Also removed ' ' prefix+postfix when creating an empty config.
Bug: 140074769
Bug: 140092095
Test: Flashed device, no more "SystemConfig: Tag compat-change is unknown..." warnings in logcat

Change-Id: I374826526fe3e4555474688b65a0be7253c6dd8c
This commit is contained in:
atrost
2019-08-29 12:48:43 +01:00
committed by Anna Trostanetski
parent e7eb842bbb
commit 87901b055b

View File

@@ -23,8 +23,7 @@ func init() {
}
type platformCompatConfigProperties struct {
Src *string `android:"path"`
Prefix *string
Src *string `android:"path"`
}
type platformCompatConfig struct {
@@ -38,13 +37,13 @@ type platformCompatConfig struct {
func (p *platformCompatConfig) GenerateAndroidBuildActions(ctx android.ModuleContext) {
rule := android.NewRuleBuilder()
configFileName := String(p.properties.Prefix) + "_platform_compat_config.xml"
configFileName := p.Name() + ".xml"
p.configFile = android.PathForModuleOut(ctx, configFileName).OutputPath
path := android.PathForModuleSrc(ctx, String(p.properties.Src))
// Use the empty config if the compat config file idoesn't exist (can happen if @ChangeId
// annotation is not used).
emptyConfig := `<?xml version="1.0" encoding="UTF-8" standalone="no"?><config/>`
emptyConfig := `'<?xml version="1.0" encoding="UTF-8" standalone="no"?><config/>'`
configPath := `compat/compat_config.xml`
rule.Command().
@@ -61,13 +60,13 @@ func (p *platformCompatConfig) GenerateAndroidBuildActions(ctx android.ModuleCon
Text(configPath).
Text(`>`).
Output(p.configFile).
Text(`; else echo '`).
Text(`; else echo `).
Text(emptyConfig).
Text(`' >`).
Text(`>`).
Output(p.configFile).
Text(`; fi`)
p.installDirPath = android.PathForModuleInstall(ctx, "etc", "sysconfig")
p.installDirPath = android.PathForModuleInstall(ctx, "etc", "compatconfig")
rule.Build(pctx, ctx, configFileName, "Extract compat/compat_config.xml and install it")
}