Replace starlark_import with hardcoded map

With roboleaf being cancelled, we don't need the api levels to be
present in starlark.

Bug: 315353489
Test: Presubmits
Change-Id: I21ea61ced00a5b0ae066a9ca99a88a512bf115ac
This commit is contained in:
Cole Faust 2024-03-06 15:50:53 -08:00
parent eefca7373c
commit 37bfb07722

View file

@ -15,7 +15,6 @@
package android
import (
"android/soong/starlark_import"
"encoding/json"
"fmt"
"strconv"
@ -440,7 +439,28 @@ func GetApiLevelsJson(ctx PathContext) WritablePath {
}
func getApiLevelsMapReleasedVersions() (map[string]int, error) {
return starlark_import.GetStarlarkValue[map[string]int]("api_levels_released_versions")
return map[string]int{
"G": 9,
"I": 14,
"J": 16,
"J-MR1": 17,
"J-MR2": 18,
"K": 19,
"L": 21,
"L-MR1": 22,
"M": 23,
"N": 24,
"N-MR1": 25,
"O": 26,
"O-MR1": 27,
"P": 28,
"Q": 29,
"R": 30,
"S": 31,
"S-V2": 32,
"Tiramisu": 33,
"UpsideDownCake": 34,
}, nil
}
var finalCodenamesMapKey = NewOnceKey("FinalCodenamesMap")