diff --git a/java/rro.go b/java/rro.go index cd8c635ff..9d0667cf0 100644 --- a/java/rro.go +++ b/java/rro.go @@ -142,6 +142,10 @@ func (r *RuntimeResourceOverlay) GenerateAndroidBuildActions(ctx android.ModuleC aaptLinkFlags = append(aaptLinkFlags, "--rename-overlay-target-package "+*r.overridableProperties.Target_package_name) } + if r.overridableProperties.Category != nil { + aaptLinkFlags = append(aaptLinkFlags, + "--rename-overlay-category "+*r.overridableProperties.Category) + } r.aapt.buildActions(ctx, r, nil, nil, false, aaptLinkFlags...) // Sign the built package @@ -220,6 +224,9 @@ type OverridableRuntimeResourceOverlayProperties struct { // the target package name of this overlay app. The target package name in the manifest file is used if one was not given. Target_package_name *string + + // the rro category of this overlay. The category in the manifest file is used if one was not given. + Category *string } type OverrideRuntimeResourceOverlay struct { diff --git a/java/rro_test.go b/java/rro_test.go index 00ba5ba11..8067a4703 100644 --- a/java/rro_test.go +++ b/java/rro_test.go @@ -201,6 +201,7 @@ func TestOverrideRuntimeResourceOverlay(t *testing.T) { base: "foo_overlay", package_name: "com.android.bar.overlay", target_package_name: "com.android.bar", + category: "mycategory", } `) @@ -212,6 +213,7 @@ func TestOverrideRuntimeResourceOverlay(t *testing.T) { targetVariant string packageFlag string targetPackageFlag string + categoryFlag string }{ { variantName: "android_common", @@ -228,6 +230,7 @@ func TestOverrideRuntimeResourceOverlay(t *testing.T) { targetVariant: "android_common_bar", packageFlag: "com.android.bar.overlay", targetPackageFlag: "com.android.bar", + categoryFlag: "mycategory", }, } for _, expected := range expectedVariants { @@ -249,6 +252,7 @@ func TestOverrideRuntimeResourceOverlay(t *testing.T) { checkAapt2LinkFlag(t, aapt2Flags, "rename-manifest-package", expected.packageFlag) checkAapt2LinkFlag(t, aapt2Flags, "rename-resources-package", "") checkAapt2LinkFlag(t, aapt2Flags, "rename-overlay-target-package", expected.targetPackageFlag) + checkAapt2LinkFlag(t, aapt2Flags, "rename-overlay-category", expected.categoryFlag) } }