From 25c0e03520f40a5aa0b0525715297fa1f09f8f03 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Thu, 4 Apr 2019 18:45:20 +0100 Subject: [PATCH] Use the apex image when the device config asks for it. Test: lunch walleye_jitzygote-userdebug m && all odex file use the apex image Bug: 119800099 Change-Id: Id2fff6a4569d48b8e6a886cb82bdba205b0dd56a --- dexpreopt/config.go | 1 + java/dexpreopt.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/dexpreopt/config.go b/dexpreopt/config.go index 15008b968..f1fa0ff34 100644 --- a/dexpreopt/config.go +++ b/dexpreopt/config.go @@ -32,6 +32,7 @@ type GlobalConfig struct { OnlyPreoptBootImageAndSystemServer bool // only preopt jars in the boot image or system server GenerateApexImage bool // generate an extra boot image only containing jars from the runtime apex + UseApexImage bool // use the apex image by default HasSystemOther bool // store odex files that match PatternsOnSystemOther on the system_other partition PatternsOnSystemOther []string // patterns (using '%' to denote a prefix match) to put odex on the system_other partition diff --git a/java/dexpreopt.go b/java/dexpreopt.go index ecb242159..6b93c10e3 100644 --- a/java/dexpreopt.go +++ b/java/dexpreopt.go @@ -98,6 +98,9 @@ func (d *dexpreopter) dexpreopt(ctx android.ModuleContext, dexJarFile android.Mo global := dexpreoptGlobalConfig(ctx) bootImage := defaultBootImageConfig(ctx) + if global.UseApexImage { + bootImage = apexBootImageConfig(ctx) + } var archs []android.ArchType for _, a := range ctx.MultiTargets() {