Remove nativeApiLevelFromUserWithDefault

... in favor of proptools.StringDefault

Bug: 1663140
Test: m
Change-Id: I0b3062921b25179cd1bf53856973fb67fe5cfc05
This commit is contained in:
Jiyong Park 2021-04-06 17:40:32 +09:00
parent d820c37425
commit ee9b117038
2 changed files with 3 additions and 10 deletions

View File

@ -53,14 +53,6 @@ func nativeApiLevelFromUser(ctx android.BaseModuleContext,
return value, nil
}
func nativeApiLevelFromUserWithDefault(ctx android.BaseModuleContext,
raw string, defaultValue string) (android.ApiLevel, error) {
if raw == "" {
raw = defaultValue
}
return nativeApiLevelFromUser(ctx, raw)
}
func nativeApiLevelOrPanic(ctx android.BaseModuleContext,
raw string) android.ApiLevel {
value, err := nativeApiLevelFromUser(ctx, raw)

View File

@ -20,6 +20,7 @@ import (
"sync"
"github.com/google/blueprint"
"github.com/google/blueprint/proptools"
"android/soong/android"
)
@ -147,8 +148,8 @@ func (this *stubDecorator) initializeProperties(ctx BaseModuleContext) bool {
return false
}
this.unversionedUntil, err = nativeApiLevelFromUserWithDefault(ctx,
String(this.properties.Unversioned_until), "minimum")
str := proptools.StringDefault(this.properties.Unversioned_until, "minimum")
this.unversionedUntil, err = nativeApiLevelFromUser(ctx, str)
if err != nil {
ctx.PropertyErrorf("unversioned_until", err.Error())
return false