diff --git a/android/api_levels.go b/android/api_levels.go index cf1011b97..370d553b7 100644 --- a/android/api_levels.go +++ b/android/api_levels.go @@ -68,7 +68,7 @@ func (a *apiLevelsSingleton) GenerateBuildActions(ctx blueprint.SingletonContext "N": 24, "N-MR1": 25, } - for i, codename := range ctx.Config().(Config).PlatformVersionAllCodenames() { + for i, codename := range ctx.Config().(Config).PlatformVersionCombinedCodenames() { apiLevelsMap[codename] = baseApiLevel + i } diff --git a/android/config.go b/android/config.go index 5dcc59bef..ee2f40fdb 100644 --- a/android/config.go +++ b/android/config.go @@ -378,8 +378,25 @@ func (c *config) PlatformSdkVersion() string { 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 { diff --git a/android/variable.go b/android/variable.go index 8462d0d58..74fa86801 100644 --- a/android/variable.go +++ b/android/variable.go @@ -102,8 +102,9 @@ type productVariables struct { // Suffix to add to generated Makefiles Make_suffix *string `json:",omitempty"` - Platform_sdk_version *int `json:",omitempty"` - Platform_version_all_codenames []string `json:",omitempty"` + Platform_sdk_version *int `json:",omitempty"` + Platform_version_active_codenames []string `json:",omitempty"` + Platform_version_future_codenames []string `json:",omitempty"` DeviceName *string `json:",omitempty"` DeviceArch *string `json:",omitempty"` diff --git a/cc/ndk_library.go b/cc/ndk_library.go index dbfc5be3c..8fbffcf00 100644 --- a/cc/ndk_library.go +++ b/cc/ndk_library.go @@ -205,7 +205,7 @@ func generateStubApiVariants(mctx android.BottomUpMutatorContext, c *stubDecorat for version := firstGenVersion; version <= platformVersion; version++ { versionStrs = append(versionStrs, strconv.Itoa(version)) } - versionStrs = append(versionStrs, mctx.AConfig().PlatformVersionAllCodenames()...) + versionStrs = append(versionStrs, mctx.AConfig().PlatformVersionActiveCodenames()...) versionStrs = append(versionStrs, "current") modules := mctx.CreateVariations(versionStrs...)