From 60c32f010263f18f5466ff57cd028d9f478b421a Mon Sep 17 00:00:00 2001 From: Inseob Kim Date: Mon, 21 Dec 2020 22:53:05 +0900 Subject: [PATCH] Add PRODUCT_SHIPPING_API_LEVEL to device config Bug: 175526482 Test: m selinux_policy Change-Id: I040897f4bdb918aa4b1acb3539a7253640e670a3 --- android/config.go | 10 ++++++++++ android/variable.go | 2 ++ 2 files changed, 12 insertions(+) diff --git a/android/config.go b/android/config.go index 50e39d7e9..a4fe03760 100644 --- a/android/config.go +++ b/android/config.go @@ -24,6 +24,7 @@ import ( "os" "path/filepath" "runtime" + "strconv" "strings" "sync" @@ -246,6 +247,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"), }, buildDir: buildDir, @@ -1421,6 +1423,14 @@ func (c *deviceConfig) RecoverySnapshotModules() map[string]bool { return c.config.productVariables.RecoverySnapshotModules } +func (c *deviceConfig) ShippingApiLevel() ApiLevel { + if c.config.productVariables.ShippingApiLevel == nil { + return NoneApiLevel + } + apiLevel, _ := strconv.Atoi(*c.config.productVariables.ShippingApiLevel) + return uncheckedFinalApiLevel(apiLevel) +} + // The ConfiguredJarList struct provides methods for handling a list of (apex, jar) pairs. // Such lists are used in the build system for things like bootclasspath jars or system server jars. // The apex part is either an apex name, or a special names "platform" or "system_ext". Jar is a diff --git a/android/variable.go b/android/variable.go index e76d68397..8b04d6510 100644 --- a/android/variable.go +++ b/android/variable.go @@ -367,6 +367,8 @@ type productVariables struct { BoardMoveRecoveryResourcesToVendorBoot *bool `json:",omitempty"` PrebuiltHiddenApiDir *string `json:",omitempty"` + + ShippingApiLevel *string `json:",omitempty"` } func boolPtr(v bool) *bool {