Update min_sdk_version from SdkSpec to ApiLevel
min_sdk_version signifies device version and does not need an sdkKind to describe it fully. Update the type and cleanup existing usages. As a side benefit, we also get better error handling since users can no longer enter something like `public_30` as a valid min_sdk_version in bp files Will do a similar cleanup for targetSdkVersion and maxSdkVersion in a followup CL Test: m nothing Test: no change in ninja files (this should be a no-op) Bug: 208456999 Change-Id: Ie6ae7e267d093c5e4787e82685daaca1021d202e
This commit is contained in:
@@ -1231,7 +1231,7 @@ func (module *SdkLibrary) getGeneratedApiScopes(ctx android.EarlyModuleContext)
|
||||
var _ android.ModuleWithMinSdkVersionCheck = (*SdkLibrary)(nil)
|
||||
|
||||
func (module *SdkLibrary) CheckMinSdkVersion(ctx android.ModuleContext) {
|
||||
android.CheckMinSdkVersion(ctx, module.MinSdkVersion(ctx).ApiLevel, func(c android.ModuleContext, do android.PayloadDepsCallback) {
|
||||
android.CheckMinSdkVersion(ctx, module.MinSdkVersion(ctx), func(c android.ModuleContext, do android.PayloadDepsCallback) {
|
||||
ctx.WalkDeps(func(child android.Module, parent android.Module) bool {
|
||||
isExternal := !module.depIsInSameApex(ctx, child)
|
||||
if am, ok := child.(android.ApexModule); ok {
|
||||
@@ -1775,7 +1775,7 @@ func (module *SdkLibrary) UniqueApexVariations() bool {
|
||||
|
||||
// Creates the xml file that publicizes the runtime library
|
||||
func (module *SdkLibrary) createXmlFile(mctx android.DefaultableHookContext) {
|
||||
moduleMinApiLevel := module.Library.MinSdkVersion(mctx).ApiLevel
|
||||
moduleMinApiLevel := module.Library.MinSdkVersion(mctx)
|
||||
var moduleMinApiLevelStr = moduleMinApiLevel.String()
|
||||
if moduleMinApiLevel == android.NoneApiLevel {
|
||||
moduleMinApiLevelStr = "current"
|
||||
@@ -2414,8 +2414,8 @@ func (module *SdkLibraryImport) UniqueApexVariations() bool {
|
||||
}
|
||||
|
||||
// MinSdkVersion - Implements hiddenAPIModule
|
||||
func (module *SdkLibraryImport) MinSdkVersion(ctx android.EarlyModuleContext) android.SdkSpec {
|
||||
return android.SdkSpecNone
|
||||
func (module *SdkLibraryImport) MinSdkVersion(ctx android.EarlyModuleContext) android.ApiLevel {
|
||||
return android.NoneApiLevel
|
||||
}
|
||||
|
||||
var _ hiddenAPIModule = (*SdkLibraryImport)(nil)
|
||||
|
Reference in New Issue
Block a user