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
diff --git a/java/app.go b/java/app.go
index 9be3f6d..05f042d 100755
--- a/java/app.go
+++ b/java/app.go
@@ -472,8 +472,9 @@
// 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) {