Replace ApiStrToNum uses with ApiLevel.

Test: treehugger
Bug: http://b/154667674
Change-Id: I2954bb21c1cfdeb305f25cfb6c8711c930f6ed50
This commit is contained in:
Dan Albert
2020-07-22 22:32:17 -07:00
parent af6073f78d
commit c8060536e8
17 changed files with 134 additions and 125 deletions

View File

@@ -133,6 +133,10 @@ func (v sdkVersion) String() string {
return "(no version)"
}
func (v sdkVersion) ApiLevel(ctx android.EarlyModuleContext) android.ApiLevel {
return android.ApiLevelOrPanic(ctx, v.String())
}
// asNumberString directly converts the numeric value of this sdk version as a string.
// When isNumbered() is true, this method is the same as String(). However, for sdkVersionCurrent
// and sdkVersionNone, this returns 10000 and 0 while String() returns "current" and "(no version"),