Do not remove RRO resources

am: f0f747c949

Change-Id: I18ddd4f03f4f2500f3ac7c1c4b374d3bf081bf54
This commit is contained in:
Jaewoong Jung
2020-01-24 13:13:30 -08:00
committed by android-build-merger
2 changed files with 11 additions and 1 deletions

View File

@@ -1257,7 +1257,8 @@ func (r *RuntimeResourceOverlay) DepsMutator(ctx android.BottomUpMutatorContext)
func (r *RuntimeResourceOverlay) GenerateAndroidBuildActions(ctx android.ModuleContext) {
// Compile and link resources
r.aapt.hasNoCode = true
r.aapt.buildActions(ctx, r)
// Do not remove resources without default values nor dedupe resource configurations with the same value
r.aapt.buildActions(ctx, r, "--no-resource-deduping", "--no-resource-removal")
// Sign the built package
_, certificates := collectAppDeps(ctx, false)

View File

@@ -2214,6 +2214,7 @@ func TestRuntimeResourceOverlay(t *testing.T) {
name: "foo",
certificate: "platform",
product_specific: true,
aaptflags: ["--keep-raw-values"],
}
runtime_resource_overlay {
@@ -2226,6 +2227,14 @@ func TestRuntimeResourceOverlay(t *testing.T) {
m := ctx.ModuleForTests("foo", "android_common")
// Check AAPT2 link flags.
aapt2Flags := m.Output("package-res.apk").Args["flags"]
expectedFlags := []string{"--keep-raw-values", "--no-resource-deduping", "--no-resource-removal"}
absentFlags := android.RemoveListFromList(expectedFlags, strings.Split(aapt2Flags, " "))
if len(absentFlags) > 0 {
t.Errorf("expected values, %q are missing in aapt2 link flags, %q", absentFlags, aapt2Flags)
}
// Check cert signing flag.
signedApk := m.Output("signed/foo.apk")
signingFlag := signedApk.Args["certificates"]