Adapt to PLATFORM_VERSION_FUTURE_CODENAMES.
Don't preserve the confusing names from make. Rename AllCodenames to
ActiveCodenames, add FutureCodenames, and add CombinedCodenames to
fetch the *real* AllCodenames.
To allow `introduced=P` in NDK library definitions, we need to know
that P exists. Use the combined list of current and future API
codenames generating stubs.
Test: make ndk
Test: check out/soong/api_levels.json
Bug: None
Change-Id: I435f9ce7446236edc268a84e33474044a55a6302
diff --git a/android/config.go b/android/config.go
index 5dcc59b..ee2f40f 100644
--- a/android/config.go
+++ b/android/config.go
@@ -378,8 +378,25 @@
return strconv.Itoa(c.PlatformSdkVersionInt())
}
-func (c *config) PlatformVersionAllCodenames() []string {
- return c.ProductVariables.Platform_version_all_codenames
+// Codenames that are active in the current lunch target.
+func (c *config) PlatformVersionActiveCodenames() []string {
+ return c.ProductVariables.Platform_version_active_codenames
+}
+
+// Codenames that are available in the branch but not included in the current
+// lunch target.
+func (c *config) PlatformVersionFutureCodenames() []string {
+ return c.ProductVariables.Platform_version_future_codenames
+}
+
+// All possible codenames in the current branch. NB: Not named AllCodenames
+// because "all" has historically meant "active" in make, and still does in
+// build.prop.
+func (c *config) PlatformVersionCombinedCodenames() []string {
+ combined := []string{}
+ combined = append(combined, c.PlatformVersionActiveCodenames()...)
+ combined = append(combined, c.PlatformVersionFutureCodenames()...)
+ return combined
}
func (c *config) BuildNumber() string {