Remove nativeApiLevelFromUserWithDefault
... in favor of proptools.StringDefault Bug: 1663140 Test: m Change-Id: I0b3062921b25179cd1bf53856973fb67fe5cfc05
This commit is contained in:
parent
d820c37425
commit
ee9b117038
|
@ -53,14 +53,6 @@ func nativeApiLevelFromUser(ctx android.BaseModuleContext,
|
||||||
return value, nil
|
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,
|
func nativeApiLevelOrPanic(ctx android.BaseModuleContext,
|
||||||
raw string) android.ApiLevel {
|
raw string) android.ApiLevel {
|
||||||
value, err := nativeApiLevelFromUser(ctx, raw)
|
value, err := nativeApiLevelFromUser(ctx, raw)
|
||||||
|
|
|
@ -20,6 +20,7 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/google/blueprint"
|
"github.com/google/blueprint"
|
||||||
|
"github.com/google/blueprint/proptools"
|
||||||
|
|
||||||
"android/soong/android"
|
"android/soong/android"
|
||||||
)
|
)
|
||||||
|
@ -147,8 +148,8 @@ func (this *stubDecorator) initializeProperties(ctx BaseModuleContext) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
this.unversionedUntil, err = nativeApiLevelFromUserWithDefault(ctx,
|
str := proptools.StringDefault(this.properties.Unversioned_until, "minimum")
|
||||||
String(this.properties.Unversioned_until), "minimum")
|
this.unversionedUntil, err = nativeApiLevelFromUser(ctx, str)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.PropertyErrorf("unversioned_until", err.Error())
|
ctx.PropertyErrorf("unversioned_until", err.Error())
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in New Issue