Add PRODUCT_SHIPPING_API_LEVEL to device config

Bug: 175526482
Test: m selinux_policy
Change-Id: I040897f4bdb918aa4b1acb3539a7253640e670a3
This commit is contained in:
Inseob Kim
2020-12-21 22:53:05 +09:00
parent 404adeefdc
commit 60c32f0102
2 changed files with 12 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"runtime" "runtime"
"strconv"
"strings" "strings"
"sync" "sync"
@@ -246,6 +247,7 @@ func TestConfig(buildDir string, env map[string]string, bp string, fs map[string
AAPTCharacteristics: stringPtr("nosdcard"), AAPTCharacteristics: stringPtr("nosdcard"),
AAPTPrebuiltDPI: []string{"xhdpi", "xxhdpi"}, AAPTPrebuiltDPI: []string{"xhdpi", "xxhdpi"},
UncompressPrivAppDex: boolPtr(true), UncompressPrivAppDex: boolPtr(true),
ShippingApiLevel: stringPtr("30"),
}, },
buildDir: buildDir, buildDir: buildDir,
@@ -1421,6 +1423,14 @@ func (c *deviceConfig) RecoverySnapshotModules() map[string]bool {
return c.config.productVariables.RecoverySnapshotModules 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. // 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. // 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 // The apex part is either an apex name, or a special names "platform" or "system_ext". Jar is a

View File

@@ -367,6 +367,8 @@ type productVariables struct {
BoardMoveRecoveryResourcesToVendorBoot *bool `json:",omitempty"` BoardMoveRecoveryResourcesToVendorBoot *bool `json:",omitempty"`
PrebuiltHiddenApiDir *string `json:",omitempty"` PrebuiltHiddenApiDir *string `json:",omitempty"`
ShippingApiLevel *string `json:",omitempty"`
} }
func boolPtr(v bool) *bool { func boolPtr(v bool) *bool {