From 424175d72a497aed8c2d83cdcb00131ff639c043 Mon Sep 17 00:00:00 2001 From: Jooyung Han Date: Wed, 8 Apr 2020 09:22:26 +0900 Subject: [PATCH] Remove PLATFORM_VERSION_FUTURE_CODENAMES It has been wrong to split ALL_VERSIONS into exclusive two sets of before/after TARGET_PLATFORM_VERSION. And PLATFORM_VERSION_ALL_CODENAMES supports all *active* list of non-finalized codenames. Bug: 152960049 Test: m Change-Id: I78ca88758998e440bea72ba2d56d90eea3ec99ae --- android/api_levels.go | 2 +- android/config.go | 16 ---------------- android/variable.go | 4 +--- cc/cc.go | 2 +- cc/llndk_library.go | 2 +- 5 files changed, 4 insertions(+), 22 deletions(-) diff --git a/android/api_levels.go b/android/api_levels.go index 62a5fce32..b6296d815 100644 --- a/android/api_levels.go +++ b/android/api_levels.go @@ -74,7 +74,7 @@ func getApiLevelsMap(config Config) map[string]int { "P": 28, "Q": 29, } - for i, codename := range config.PlatformVersionCombinedCodenames() { + for i, codename := range config.PlatformVersionActiveCodenames() { apiLevelsMap[codename] = baseApiLevel + i } diff --git a/android/config.go b/android/config.go index c9d7dabc4..5e09214d8 100644 --- a/android/config.go +++ b/android/config.go @@ -649,22 +649,6 @@ 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) ProductAAPTConfig() []string { return c.productVariables.AAPTConfig } diff --git a/android/variable.go b/android/variable.go index 06bd4ed8c..4bc3d8a14 100644 --- a/android/variable.go +++ b/android/variable.go @@ -149,7 +149,6 @@ type productVariables struct { Platform_sdk_codename *string `json:",omitempty"` Platform_sdk_final *bool `json:",omitempty"` Platform_version_active_codenames []string `json:",omitempty"` - Platform_version_future_codenames []string `json:",omitempty"` Platform_vndk_version *string `json:",omitempty"` Platform_systemsdk_versions []string `json:",omitempty"` Platform_security_patch *string `json:",omitempty"` @@ -251,7 +250,7 @@ type productVariables struct { ClangTidy *bool `json:",omitempty"` TidyChecks *string `json:",omitempty"` - SamplingPGO *bool `json:",omitempty"` + SamplingPGO *bool `json:",omitempty"` NativeLineCoverage *bool `json:",omitempty"` Native_coverage *bool `json:",omitempty"` @@ -354,7 +353,6 @@ func (v *productVariables) SetDefaultConfig() { Platform_sdk_codename: stringPtr("Q"), Platform_sdk_final: boolPtr(false), Platform_version_active_codenames: []string{"Q"}, - Platform_version_future_codenames: []string{"Q"}, Platform_vndk_version: stringPtr("Q"), HostArch: stringPtr("x86_64"), diff --git a/cc/cc.go b/cc/cc.go index 930c19c8e..cb71c3bd8 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -1076,7 +1076,7 @@ func (ctx *moduleContextImpl) sdkVersion() string { if ctx.ctx.Device() { if ctx.useVndk() { vndkVer := ctx.mod.VndkVersion() - if inList(vndkVer, ctx.ctx.Config().PlatformVersionCombinedCodenames()) { + if inList(vndkVer, ctx.ctx.Config().PlatformVersionActiveCodenames()) { return "current" } return vndkVer diff --git a/cc/llndk_library.go b/cc/llndk_library.go index 09050aa34..7ff20f472 100644 --- a/cc/llndk_library.go +++ b/cc/llndk_library.go @@ -83,7 +83,7 @@ func (stub *llndkStubDecorator) compilerFlags(ctx ModuleContext, flags Flags, de func (stub *llndkStubDecorator) compile(ctx ModuleContext, flags Flags, deps PathDeps) Objects { vndkVer := ctx.Module().(*Module).VndkVersion() - if !inList(vndkVer, ctx.Config().PlatformVersionCombinedCodenames()) || vndkVer == "" { + if !inList(vndkVer, ctx.Config().PlatformVersionActiveCodenames()) || vndkVer == "" { // For non-enforcing devices, vndkVer is empty. Use "current" in that case, too. vndkVer = "current" }