Replace ApiStrToNum uses with ApiLevel.
Test: treehugger Bug: http://b/154667674 Change-Id: I2954bb21c1cfdeb305f25cfb6c8711c930f6ed50
This commit is contained in:
11
java/java.go
11
java/java.go
@@ -1876,7 +1876,8 @@ func (j *Module) DepIsInSameApex(ctx android.BaseModuleContext, dep android.Modu
|
||||
return j.depIsInSameApex(ctx, dep)
|
||||
}
|
||||
|
||||
func (j *Module) ShouldSupportSdkVersion(ctx android.BaseModuleContext, sdkVersion int) error {
|
||||
func (j *Module) ShouldSupportSdkVersion(ctx android.BaseModuleContext,
|
||||
sdkVersion android.ApiLevel) error {
|
||||
sdkSpec := j.minSdkVersion()
|
||||
if !sdkSpec.specified() {
|
||||
return fmt.Errorf("min_sdk_version is not specified")
|
||||
@@ -1888,7 +1889,7 @@ func (j *Module) ShouldSupportSdkVersion(ctx android.BaseModuleContext, sdkVersi
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if int(ver) > sdkVersion {
|
||||
if ver.ApiLevel(ctx).GreaterThan(sdkVersion) {
|
||||
return fmt.Errorf("newer SDK(%v)", ver)
|
||||
}
|
||||
return nil
|
||||
@@ -2753,7 +2754,8 @@ func (j *Import) DepIsInSameApex(ctx android.BaseModuleContext, dep android.Modu
|
||||
return j.depIsInSameApex(ctx, dep)
|
||||
}
|
||||
|
||||
func (j *Import) ShouldSupportSdkVersion(ctx android.BaseModuleContext, sdkVersion int) error {
|
||||
func (j *Import) ShouldSupportSdkVersion(ctx android.BaseModuleContext,
|
||||
sdkVersion android.ApiLevel) error {
|
||||
// Do not check for prebuilts against the min_sdk_version of enclosing APEX
|
||||
return nil
|
||||
}
|
||||
@@ -2936,7 +2938,8 @@ func (j *DexImport) DexJarBuildPath() android.Path {
|
||||
return j.dexJarFile
|
||||
}
|
||||
|
||||
func (j *DexImport) ShouldSupportSdkVersion(ctx android.BaseModuleContext, sdkVersion int) error {
|
||||
func (j *DexImport) ShouldSupportSdkVersion(ctx android.BaseModuleContext,
|
||||
sdkVersion android.ApiLevel) error {
|
||||
// we don't check prebuilt modules for sdk_version
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user