Support building boot images with disabled dexpreopt.
Bug: 176171716
Test: build_mainline_modules.sh and ensure that the ART boot image is
built: `find out -type f -name '*.art'` is nonempty for every arch.
Change-Id: Ibc45581eef2b205c750a30709780cf659ba7cfa1
diff --git a/java/dexpreopt_bootjars.go b/java/dexpreopt_bootjars.go
index 80211fd..0a71df1 100644
--- a/java/dexpreopt_bootjars.go
+++ b/java/dexpreopt_bootjars.go
@@ -347,8 +347,8 @@
ctx.RegisterSingletonType("dex_bootjars", dexpreoptBootJarsFactory)
}
-func skipDexpreoptBootJars(ctx android.PathContext) bool {
- return dexpreopt.GetGlobalConfig(ctx).DisablePreopt
+func SkipDexpreoptBootJars(ctx android.PathContext) bool {
+ return dexpreopt.GetGlobalConfig(ctx).DisablePreoptBootImages
}
// Singleton for generating boot image build rules.
@@ -371,7 +371,7 @@
// Accessor function for the apex package. Returns nil if dexpreopt is disabled.
func DexpreoptedArtApexJars(ctx android.BuilderContext) map[android.ArchType]android.OutputPaths {
- if skipDexpreoptBootJars(ctx) {
+ if SkipDexpreoptBootJars(ctx) {
return nil
}
// Include dexpreopt files for the primary boot image.
@@ -387,7 +387,7 @@
// Generate build rules for boot images.
func (d *dexpreoptBootJars) GenerateBuildActions(ctx android.SingletonContext) {
- if skipDexpreoptBootJars(ctx) {
+ if SkipDexpreoptBootJars(ctx) {
return
}
if dexpreopt.GetCachedGlobalSoongConfig(ctx) == nil {
@@ -727,7 +727,7 @@
globalSoong := dexpreopt.GetCachedGlobalSoongConfig(ctx)
global := dexpreopt.GetGlobalConfig(ctx)
- if global.DisableGenerateProfile || ctx.Config().UnbundledBuild() {
+ if global.DisableGenerateProfile {
return nil
}
profile := ctx.Config().Once(bootImageProfileRuleKey, func() interface{} {