From 881e465fda38d1e4de8f6290c8a45d5b61005072 Mon Sep 17 00:00:00 2001 From: Kiyoung Kim Date: Mon, 8 Jul 2024 11:02:23 +0900 Subject: [PATCH] Add 'use_debug_art' to product_variable Add 'use_debug_art' property to product_variable so it can be checked from Android.bp whether ART debug APEX or ART APEX should be used. Bug: 351698657 Test: AOSP CF eng build succeeded Test: AOSP CF userdebug build succeeded Change-Id: I01cd80f0d899c55828ecb05fdafdc9bb05fd8200 --- android/config.go | 8 ++++++++ android/module.go | 3 +++ android/variable.go | 2 ++ 3 files changed, 13 insertions(+) diff --git a/android/config.go b/android/config.go index d16377d7b..0e3b0a1ef 100644 --- a/android/config.go +++ b/android/config.go @@ -2127,3 +2127,11 @@ func (c *config) BoardUseVbmetaDigestInFingerprint() bool { func (c *config) OemProperties() []string { return c.productVariables.OemProperties } + +func (c *config) UseDebugArt() bool { + if c.productVariables.ArtTargetIncludeDebugBuild != nil { + return Bool(c.productVariables.ArtTargetIncludeDebugBuild) + } + + return Bool(c.productVariables.Eng) +} diff --git a/android/module.go b/android/module.go index 75e73c678..6ad46246f 100644 --- a/android/module.go +++ b/android/module.go @@ -2221,6 +2221,9 @@ func (e configurationEvalutor) EvaluateConfiguration(condition proptools.Configu switch variable { case "debuggable": return proptools.ConfigurableValueBool(ctx.Config().Debuggable()) + case "use_debug_art": + // TODO(b/234351700): Remove once ART does not have separated debug APEX + return proptools.ConfigurableValueBool(ctx.Config().UseDebugArt()) default: // TODO(b/323382414): Might add these on a case-by-case basis ctx.OtherModulePropertyErrorf(m, property, fmt.Sprintf("TODO(b/323382414): Product variable %q is not yet supported in selects", variable)) diff --git a/android/variable.go b/android/variable.go index d144f7d43..4e2954a5a 100644 --- a/android/variable.go +++ b/android/variable.go @@ -518,6 +518,8 @@ type ProductVariables struct { BoardUseVbmetaDigestInFingerprint *bool `json:",omitempty"` OemProperties []string `json:",omitempty"` + + ArtTargetIncludeDebugBuild *bool `json:",omitempty"` } type PartitionQualifiedVariablesType struct {