Merge changes Ibaf383c4,I2b1c0736 am: 139fa4320f am: e45d4d1612

Change-Id: Iba51fa72f9232cd5ce9826550fc7b2072280fad4
This commit is contained in:
Automerger Merge Worker
2020-02-25 07:28:33 +00:00
2 changed files with 20 additions and 0 deletions

View File

@@ -1521,6 +1521,14 @@ 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 ...
// except for the jacocoagent itself (because instrumenting jacocoagent using jacocoagent
// doesn't make sense)
isJacocoAgent := ctx.ModuleName() == "jacocoagent"
if android.DirectlyInAnyApex(ctx, ctx.ModuleName()) && !isJacocoAgent && !j.IsForPlatform() {
j.properties.Instrument = true
}
if j.shouldInstrument(ctx) {
outputFile = j.instrument(ctx, flags, outputFile, jarName)
}