diff --git a/android/config.go b/android/config.go index d83bf0a9e..56d0a39e5 100644 --- a/android/config.go +++ b/android/config.go @@ -468,16 +468,20 @@ func (c *config) BuildNumber() string { return "000000" } -func (c *config) ProductAaptConfig() []string { - return []string{"normal", "large", "xlarge", "hdpi", "xhdpi", "xxhdpi"} +func (c *config) ProductAAPTConfig() []string { + return *c.ProductVariables.AAPTConfig } -func (c *config) ProductAaptPreferredConfig() string { - return "xhdpi" +func (c *config) ProductAAPTPreferredConfig() string { + return *c.ProductVariables.AAPTPreferredConfig } -func (c *config) ProductAaptCharacteristics() string { - return "nosdcard" +func (c *config) ProductAAPTCharacteristics() string { + return *c.ProductVariables.AAPTCharacteristics +} + +func (c *config) ProductAAPTPrebuiltDPI() []string { + return *c.ProductVariables.AAPTPrebuiltDPI } func (c *config) DefaultAppCertificateDir(ctx PathContext) SourcePath { diff --git a/android/variable.go b/android/variable.go index 16a6b11c4..4b3925cca 100644 --- a/android/variable.go +++ b/android/variable.go @@ -132,6 +132,17 @@ type productVariables struct { CrossHostArch *string `json:",omitempty"` CrossHostSecondaryArch *string `json:",omitempty"` + ResourceOverlays *[]string `json:",omitempty"` + EnforceRROTargets *[]string `json:",omitempty"` + EnforceRROExcludedOverlays *[]string `json:",omitempty"` + + AAPTCharacteristics *string `json:",omitempty"` + AAPTConfig *[]string `json:",omitempty"` + AAPTPreferredConfig *string `json:",omitempty"` + AAPTPrebuiltDPI *[]string `json:",omitempty"` + + AppsDefaultVersionName *string `json:",omitempty"` + Allow_missing_dependencies *bool `json:",omitempty"` Unbundled_build *bool `json:",omitempty"` Brillo *bool `json:",omitempty"` @@ -203,8 +214,14 @@ func (v *productVariables) SetDefaultConfig() { DeviceSecondaryArchVariant: stringPtr("armv7-a-neon"), DeviceSecondaryCpuVariant: stringPtr("denver"), DeviceSecondaryAbi: &[]string{"armeabi-v7a"}, - Malloc_not_svelte: boolPtr(false), - Safestack: boolPtr(false), + + AAPTConfig: &[]string{"normal", "large", "xlarge", "hdpi", "xhdpi", "xxhdpi"}, + AAPTPreferredConfig: stringPtr("xhdpi"), + AAPTCharacteristics: stringPtr("nosdcard"), + AAPTPrebuiltDPI: &[]string{"xhdpi", "xxhdpi"}, + + Malloc_not_svelte: boolPtr(false), + Safestack: boolPtr(false), } if runtime.GOOS == "linux" { diff --git a/java/app.go b/java/app.go index e8028a0de..c2e9214b3 100644 --- a/java/app.go +++ b/java/app.go @@ -102,7 +102,7 @@ func (a *AndroidApp) GenerateAndroidBuildActions(ctx android.ModuleContext) { if !hasProduct { aaptPackageFlags = append(aaptPackageFlags, - "--product "+ctx.AConfig().ProductAaptCharacteristics()) + "--product "+ctx.AConfig().ProductAAPTCharacteristics()) } a.exportPackage = CreateExportPackage(ctx, aaptPackageFlags, aaptDeps) ctx.CheckbuildFile(a.exportPackage) @@ -132,7 +132,7 @@ func (a *AndroidApp) GenerateAndroidBuildActions(ctx android.ModuleContext) { if !hasProduct { aaptPackageFlags = append(aaptPackageFlags, - "--product "+ctx.AConfig().ProductAaptCharacteristics()) + "--product "+ctx.AConfig().ProductAAPTCharacteristics()) } certificate := a.appProperties.Certificate