From e0ce4ba491d00ad4a1c7d41b2293dfaf4a767028 Mon Sep 17 00:00:00 2001 From: Ulya Trafimovich Date: Wed, 8 Apr 2020 15:00:49 +0100 Subject: [PATCH] Relax boot image check to allow platform Jacoco variant in a coverage build. Test: m nothing Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true nothing Bug: 153533941 Change-Id: I5847ec282f6b481cee61ed9ec6b6928c9a41fae7 --- java/dexpreopt_bootjars.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/java/dexpreopt_bootjars.go b/java/dexpreopt_bootjars.go index d53022f0a..543b2333c 100644 --- a/java/dexpreopt_bootjars.go +++ b/java/dexpreopt_bootjars.go @@ -277,6 +277,9 @@ func getBootImageJar(ctx android.SingletonContext, image *bootImageConfig, modul } else if isApexModule && apex.IsForPlatform() && Bool(module.(*Library).deviceProperties.Hostdex) { // this is a special "hostdex" variant, skip it and resume search return -1, nil + } else if name == "jacocoagent" && ctx.Config().IsEnvTrue("EMMA_INSTRUMENT_FRAMEWORK") { + // this is Jacoco platform variant for a coverage build, skip it and resume search + return -1, nil } else { // this (installable) jar is part of the platform, fail immediately ctx.Errorf("module '%s' is part of the platform and not allowed in the ART boot image", name)