From 10c9f83f26e5550d3640fbe5249b440fbfefdd50 Mon Sep 17 00:00:00 2001 From: Kun Niu Date: Mon, 29 Jul 2019 16:28:57 -0700 Subject: [PATCH] Build module from source branch instead of using prebuilds when coverage is enabled. Test: successfully get coverage data from coverage build. Bug: 137865099 Change-Id: I7df96c2b2c2ec2859393fb2c19ffe1081d112c96 --- apex/apex.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apex/apex.go b/apex/apex.go index 0466ccbe4..330724d6d 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -1474,6 +1474,10 @@ func (p *Prebuilt) DepsMutator(ctx android.BottomUpMutatorContext) { // to build the prebuilts themselves. forceDisable = forceDisable || ctx.Config().UnbundledBuild() + // Force disable the prebuilts when coverage is enabled. + forceDisable = forceDisable || ctx.DeviceConfig().NativeCoverageEnabled() + forceDisable = forceDisable || ctx.Config().IsEnvTrue("EMMA_INSTRUMENT") + // b/137216042 don't use prebuilts when address sanitizer is on forceDisable = forceDisable || android.InList("address", ctx.Config().SanitizeDevice()) || android.InList("hwaddress", ctx.Config().SanitizeDevice())