diff options
author | 2021-04-15 16:53:05 +0900 | |
---|---|---|
committer | 2021-04-15 16:53:23 +0900 | |
commit | c702204306be36149db4a8014490b5528e31f1c8 (patch) | |
tree | 9479aad7f4a0a6c6bbedc9e3f775f46b23acc8c6 /android/sdk_version.go | |
parent | 4eab21d5a29d21c86b8b6662150064b455d3cc92 (diff) |
ApiLevel of "" and "core_platform" is FutureApiLevel
If sdk_version is set to "", it means the module is built with the
in-development version of the platform APIs. "core_platform" means the
in-development version of the core Java APIs. In both cases, the API
level (i.e. which version to use) is the in-development version.
Bug: 1663140
Test: m
Change-Id: Ia184190341223e9ac12710a8bb3a25004fd4f539
Diffstat (limited to 'android/sdk_version.go')
-rw-r--r-- | android/sdk_version.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/android/sdk_version.go b/android/sdk_version.go index 98db82496..c6c75a399 100644 --- a/android/sdk_version.go +++ b/android/sdk_version.go @@ -147,6 +147,11 @@ func (s SdkSpec) ForVendorPartition(ctx EarlyModuleContext) SdkSpec { // UsePrebuilt determines whether prebuilt SDK should be used for this SdkSpec with the given context. func (s SdkSpec) UsePrebuilt(ctx EarlyModuleContext) bool { + switch s { + case SdkSpecNone, SdkSpecCorePlatform, SdkSpecPrivate: + return false + } + if s.ApiLevel.IsCurrent() { // "current" can be built from source and be from prebuilt SDK return ctx.Config().AlwaysUsePrebuiltSdks() @@ -159,7 +164,6 @@ func (s SdkSpec) UsePrebuilt(ctx EarlyModuleContext) bool { // numbered SDKs are always from prebuilt return true } - // "", "none", "core_platform" fall here return false } @@ -202,11 +206,9 @@ func (s SdkSpec) EffectiveVersionString(ctx EarlyModuleContext) (string, error) } var ( - SdkSpecNone = SdkSpec{SdkNone, NoneApiLevel, "(no version)"} - // TODO(b/175678607) ApiLevel of SdkSpecPrivate should be FutureApiLevel - SdkSpecPrivate = SdkSpec{SdkPrivate, NoneApiLevel, ""} - // TODO(b/175678607) ApiLevel of SdkSpecCorePlatform should be FutureApiLevel - SdkSpecCorePlatform = SdkSpec{SdkCorePlatform, NoneApiLevel, "core_platform"} + SdkSpecNone = SdkSpec{SdkNone, NoneApiLevel, "(no version)"} + SdkSpecPrivate = SdkSpec{SdkPrivate, FutureApiLevel, ""} + SdkSpecCorePlatform = SdkSpec{SdkCorePlatform, FutureApiLevel, "core_platform"} ) func SdkSpecFrom(ctx EarlyModuleContext, str string) SdkSpec { |