aboutsummaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
authorJiyong Park <jiyong@google.com>2020-02-21 16:04:53 +0900
committerJiyong Park <jiyong@google.com>2020-02-25 11:34:28 +0000
commit2882660422bbbe7ecc5d0ead431b383f6d5e7fcd (patch)
treee202f202201e5d22ceea61c8220e1e4a0a7e795d /java/java.go
parent81aaa0c1bd99e38f61611d574712a761e3ef8508 (diff)
Expect added members for instrumented modules
hiddenapi expects that all members in a class to have corresponding hidden API flags. However, this can't be satisfied when the java module having the class is instrumented; JaCoCo added a few number of synthetic members. In this case, give 'no-force-assign-all' option to the hidden api tool so that it doesn't complain about the synthetic methods. Also, disabling instrumenting jacocoagent itself, because it doesn't make sense. Exempt-From-Owner-Approval: PS3 fixes a typo in a comment. PS2 got ORV. Bug: 149353192 Test: SKIP_ABI_CHECKS=true EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true SKIP_BOOT_JARS_CHECK=true m out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/hiddenapi/unaligned/unaligned.jar Merged-In: Ibaf383c439945ab664e885af319548b56e2c8cb6 (cherry picked from commit 93e57a0b862beabdd11b8dac342167ea7f7c7b76) Change-Id: Ibaf383c439945ab664e885af319548b56e2c8cb6
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/java/java.go b/java/java.go
index 1273eff9c..8d58a9023 100644
--- a/java/java.go
+++ b/java/java.go
@@ -1521,8 +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() {
+ // 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
}