Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 37bfb077 authored by Cole Faust's avatar Cole Faust
Browse files

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
parent eefca737
Loading
Loading
Loading
Loading
+22 −2
Original line number Diff line number Diff line
@@ -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")