summaryrefslogtreecommitdiff
path: root/android/api_levels.go
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2019-02-04 11:22:08 -0800
committerColin Cross <ccross@android.com>2019-02-06 01:52:41 +0000
commit571cccfcbc795f2bc955ca7fb3ac09085b360e09 (patch)
tree16da47a7ce728a0dfec6d48b1ef89c2cf72341f3 /android/api_levels.go
parent5cb5b093d1f49a160b6ef2994c6bce07793a7d2d (diff)
Prepare for a type-safe OnceKey
Add an opaque OnceKey type and use it for all calls to Once in build/soong. A future patch will convert the arguments to Once* to OnceKey once users outside build/soong have been updated. Test: onceper_test.go Change-Id: Ifcb338e6e603e804e507203c9508d30ffb2df966
Diffstat (limited to 'android/api_levels.go')
-rw-r--r--android/api_levels.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/android/api_levels.go b/android/api_levels.go
index 1b56625b2..51d470381 100644
--- a/android/api_levels.go
+++ b/android/api_levels.go
@@ -51,8 +51,10 @@ func GetApiLevelsJson(ctx PathContext) WritablePath {
return PathForOutput(ctx, "api_levels.json")
}
+var apiLevelsMapKey = NewOnceKey("ApiLevelsMap")
+
func getApiLevelsMap(config Config) map[string]int {
- return config.Once("ApiLevelsMap", func() interface{} {
+ return config.Once(apiLevelsMapKey, func() interface{} {
baseApiLevel := 9000
apiLevelsMap := map[string]int{
"G": 9,