SdkSpec = Scope + ApiLevel
SdkSpec.Version was an int type. Now it becomes ApiLevel type which
is a better abstraction of the version (or api level).
Bug: 1655587
Test: m
Change-Id: I4d67b9b9eae45f653b6af4f5b73da9e091b3dfab
diff --git a/java/sdk_library.go b/java/sdk_library.go
index ebb2154..37b8d9f 100644
--- a/java/sdk_library.go
+++ b/java/sdk_library.go
@@ -817,7 +817,7 @@
func (c *commonToSdkLibraryAndImport) selectHeaderJarsForSdkVersion(ctx android.BaseModuleContext, sdkVersion android.SdkSpec) android.Paths {
// If a specific numeric version has been requested then use prebuilt versions of the sdk.
- if sdkVersion.Version.IsNumbered() {
+ if !sdkVersion.ApiLevel.IsPreview() {
return PrebuiltJars(ctx, c.moduleBase.BaseModuleName(), sdkVersion)
}
@@ -1466,15 +1466,15 @@
}
func PrebuiltJars(ctx android.BaseModuleContext, baseName string, s android.SdkSpec) android.Paths {
- var ver android.SdkVersion
+ var ver android.ApiLevel
var kind android.SdkKind
if s.UsePrebuilt(ctx) {
- ver = s.Version
+ ver = s.ApiLevel
kind = s.Kind
} else {
// We don't have prebuilt SDK for the specific sdkVersion.
// Instead of breaking the build, fallback to use "system_current"
- ver = android.SdkVersionCurrent
+ ver = android.FutureApiLevel
kind = android.SdkSystem
}