From ee9b117038367bfd137846150f9eccf372cb2676 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Tue, 6 Apr 2021 17:40:32 +0900 Subject: [PATCH] Remove nativeApiLevelFromUserWithDefault ... in favor of proptools.StringDefault Bug: 1663140 Test: m Change-Id: I0b3062921b25179cd1bf53856973fb67fe5cfc05 --- cc/api_level.go | 8 -------- cc/ndk_library.go | 5 +++-- 2 files changed, 3 insertions(+), 10 deletions(-) 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