From 10af6edc5218f82ecc945b57c8a4b717b8d75605 Mon Sep 17 00:00:00 2001 From: Inseob Kim Date: Tue, 13 Feb 2024 12:56:46 +0900 Subject: [PATCH] Skip passing "--product default" to aapt2 Because 1) it has no effect. 2) it will simplify build commands, which will minimize differences among targets using generate_product_characteristics_rro Bug: 322932641 Test: TH Change-Id: I16afae597038da7489989483f8c926916d207df5 --- java/app.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/java/app.go b/java/app.go index 9be3f6d50..05f042d7f 100755 --- a/java/app.go +++ b/java/app.go @@ -472,8 +472,9 @@ func (a *AndroidApp) aaptBuildActions(ctx android.ModuleContext) { // Add TARGET_AAPT_CHARACTERISTICS values to AAPT link flags if they exist and --product flags were not provided. autogenerateRRO := proptools.Bool(a.appProperties.Generate_product_characteristics_rro) hasProduct := android.PrefixInList(a.aaptProperties.Aaptflags, "--product") - if !autogenerateRRO && !hasProduct && len(ctx.Config().ProductAAPTCharacteristics()) > 0 { - aaptLinkFlags = append(aaptLinkFlags, "--product", ctx.Config().ProductAAPTCharacteristics()) + characteristics := ctx.Config().ProductAAPTCharacteristics() + if !autogenerateRRO && !hasProduct && len(characteristics) > 0 && characteristics != "default" { + aaptLinkFlags = append(aaptLinkFlags, "--product", characteristics) } if !Bool(a.aaptProperties.Aapt_include_all_resources) {