SdkSpec is fully using ApiLevel
Previously, SdkSpec was constructed only from the user string. It didn't make use of the Config struct where information about the latest stable SDK version, etc. is recorded. As a result, the build system couldn't check if the sdk version "current" is referring to the in-development (i.e. not-yet-frozen) SDK version or the latest stable version. "current" was always assumed to be in-development (IsPreview() returns true) even when Platform_sdk_final == true. As the first step for fixing that, this change requires android.EarlyModuleContext to be passed when constructing SdkSpec from the user string. In the following changes, "current" will be mapped to either FutureApiLevel (10000) or one of the FinalApiLevels() depending on whether the platform SDK was finalized or not. Bug: 175678607 Test: m Change-Id: Ifea12ebf147ecccf12e7266dd382819806571543
This commit is contained in:
@@ -1508,7 +1508,7 @@ func (module *SdkLibrary) sdkJars(ctx android.BaseModuleContext, sdkVersion andr
|
||||
// force override sdk_version to module_current so that the closest possible API
|
||||
// surface could be found in selectHeaderJarsForSdkVersion
|
||||
if module.defaultsToStubs() && !sdkVersion.Specified() {
|
||||
sdkVersion = android.SdkSpecFrom("module_current")
|
||||
sdkVersion = android.SdkSpecFrom(ctx, "module_current")
|
||||
}
|
||||
|
||||
// Only provide access to the implementation library if it is actually built.
|
||||
|
Reference in New Issue
Block a user