From a48df2b7fb5acada49fd375d0ec6d1825ee5711c Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Mon, 3 Jun 2024 22:29:38 +0000 Subject: [PATCH] Shipping_api_level in build. Add shipping API level to build, so that we can move certain tests to build time. Bug: 340953047 Test: works in init for build time host checks Change-Id: Ic89066c2b49089da3113a1afef1d39de53b307d9 --- android/config.go | 4 ++-- android/test_config.go | 2 +- android/variable.go | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/android/config.go b/android/config.go index 600745162..bb49c9f8e 100644 --- a/android/config.go +++ b/android/config.go @@ -1916,10 +1916,10 @@ func (c *deviceConfig) HostFakeSnapshotEnabled() bool { } func (c *deviceConfig) ShippingApiLevel() ApiLevel { - if c.config.productVariables.ShippingApiLevel == nil { + if c.config.productVariables.Shipping_api_level == nil { return NoneApiLevel } - apiLevel, _ := strconv.Atoi(*c.config.productVariables.ShippingApiLevel) + apiLevel, _ := strconv.Atoi(*c.config.productVariables.Shipping_api_level) return uncheckedFinalApiLevel(apiLevel) } diff --git a/android/test_config.go b/android/test_config.go index a15343adb..f2510387f 100644 --- a/android/test_config.go +++ b/android/test_config.go @@ -50,7 +50,7 @@ func TestConfig(buildDir string, env map[string]string, bp string, fs map[string AAPTCharacteristics: stringPtr("nosdcard"), AAPTPrebuiltDPI: []string{"xhdpi", "xxhdpi"}, UncompressPrivAppDex: boolPtr(true), - ShippingApiLevel: stringPtr("30"), + Shipping_api_level: stringPtr("30"), }, outDir: buildDir, diff --git a/android/variable.go b/android/variable.go index 684aab0b1..3538e2fda 100644 --- a/android/variable.go +++ b/android/variable.go @@ -55,6 +55,10 @@ type variableProperties struct { Base_dir *string } + Shipping_api_level struct { + Cflags []string + } + // unbundled_build is a catch-all property to annotate modules that don't build in one or // more unbundled branches, usually due to dependencies missing from the manifest. Unbundled_build struct { @@ -440,7 +444,7 @@ type ProductVariables struct { PrebuiltHiddenApiDir *string `json:",omitempty"` - ShippingApiLevel *string `json:",omitempty"` + Shipping_api_level *string `json:",omitempty"` BuildBrokenPluginValidation []string `json:",omitempty"` BuildBrokenClangAsFlags bool `json:",omitempty"`