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:
@@ -394,12 +394,12 @@ func (a *AndroidAppImport) DepIsInSameApex(_ android.BaseModuleContext, _ androi
|
||||
return false
|
||||
}
|
||||
|
||||
func (a *AndroidAppImport) SdkVersion() android.SdkSpec {
|
||||
return android.SdkSpecFrom("")
|
||||
func (a *AndroidAppImport) SdkVersion(ctx android.EarlyModuleContext) android.SdkSpec {
|
||||
return android.SdkSpecPrivate
|
||||
}
|
||||
|
||||
func (a *AndroidAppImport) MinSdkVersion() android.SdkSpec {
|
||||
return android.SdkSpecFrom("")
|
||||
func (a *AndroidAppImport) MinSdkVersion(ctx android.EarlyModuleContext) android.SdkSpec {
|
||||
return android.SdkSpecPrivate
|
||||
}
|
||||
|
||||
var _ android.ApexModule = (*AndroidAppImport)(nil)
|
||||
|
Reference in New Issue
Block a user