Reland "Turn on the instrumentation by default for the java code in APEXes"

This reverts commit c021ea0b35.

Exempt-From-Owner-Approval: cherry-pick from aosp

Bug: 149353192
Merged-In: I2b1c0736202de26c5ea88c0ab14574bd7207a5fb
Test: N/A (this is a clean revert) forward fix will be followed
(cherry picked from commit 00cae1cc88)
Change-Id: I2b1c0736202de26c5ea88c0ab14574bd7207a5fb
This commit is contained in:
Jiyong Park
2020-02-18 12:50:44 +00:00
parent 2ad2a7dfca
commit 81aaa0c1bd

View File

@@ -1521,6 +1521,11 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) {
j.headerJarFile = j.implementationJarFile
}
// Force enable the instrumentation for java code that is built for APEXes
if android.DirectlyInAnyApex(ctx, ctx.ModuleName()) && !j.IsForPlatform() {
j.properties.Instrument = true
}
if j.shouldInstrument(ctx) {
outputFile = j.instrument(ctx, flags, outputFile, jarName)
}