diff --git a/cc/api_level.go b/cc/api_level.go index c93d6eda3..fd145a9e2 100644 --- a/cc/api_level.go +++ b/cc/api_level.go @@ -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) diff --git a/cc/ndk_library.go b/cc/ndk_library.go index 10de889d1..a32ef1fc0 100644 --- a/cc/ndk_library.go +++ b/cc/ndk_library.go @@ -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