Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 619ed5ce authored by Rico Wind's avatar Rico Wind
Browse files

Give flag to R8 if we explicity opted for optimized shrinking

This allows us to keep R fields for targets that are not explicilty opting in (many tests rely on these, and R8 shake them away)

Bug: 372264901
Bug: 325905703
Test: v2/android-virtual-infra/test_mapping/presubmit-avd
Change-Id: Ifeede36f6b6fae5ebc382e38ca2eba6725c0e84b
parent 56d95dc4
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -404,6 +404,10 @@ func (d *dexer) r8Flags(ctx android.ModuleContext, dexParams *compileDexParams)
		r8Flags = append(r8Flags, "--resource-output", d.resourcesOutput.Path().String())
		if d.dexProperties.optimizedResourceShrinkingEnabled(ctx) {
			r8Flags = append(r8Flags, "--optimized-resource-shrinking")
			if Bool(d.dexProperties.Optimize.Optimized_shrink_resources) {
				// Explicitly opted into optimized shrinking, no need for keeping R$id entries
				r8Flags = append(r8Flags, "--force-optimized-resource-shrinking")
			}
		}
	}