From db5138230d771cc4646b7273ad78c201433daf4a Mon Sep 17 00:00:00 2001 From: Martin Stjernholm Date: Tue, 16 Feb 2021 19:55:58 +0000 Subject: [PATCH] Recognise the Google-signed ART APEXes as well. Test: `m nothing` in internal tree Bug: 180325915 Change-Id: I83eb660ad7cb480fba2a7874ee7e7f9d35646871 --- java/dexpreopt_bootjars.go | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/java/dexpreopt_bootjars.go b/java/dexpreopt_bootjars.go index 86b189558..e94b20c55 100644 --- a/java/dexpreopt_bootjars.go +++ b/java/dexpreopt_bootjars.go @@ -210,6 +210,15 @@ import ( // apps instead of the Framework boot image extension (see DEXPREOPT_USE_ART_IMAGE and UseArtImage). // +var artApexNames = []string{ + "com.android.art", + "com.android.art.debug", + "com.android.art,testing", + "com.google.android.art", + "com.google.android.art.debug", + "com.google.android.art.testing", +} + func init() { RegisterDexpreoptBootJarsComponents(android.InitRegistrationContext) } @@ -485,7 +494,14 @@ func getBootImageJar(ctx android.SingletonContext, image *bootImageConfig, modul switch image.name { case artBootImageName: - if apexInfo.InApexByBaseName("com.android.art") || apexInfo.InApexByBaseName("com.android.art.debug") || apexInfo.InApexByBaseName("com.android.art,testing") { + inArtApex := false + for _, n := range artApexNames { + if apexInfo.InApexByBaseName(n) { + inArtApex = true + break + } + } + if inArtApex { // ok: found the jar in the ART apex } else if name == "jacocoagent" && ctx.Config().IsEnvTrue("EMMA_INSTRUMENT_FRAMEWORK") { // exception (skip and continue): Jacoco platform variant for a coverage build