Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee9b1170 authored by Jiyong Park's avatar Jiyong Park
Browse files

Remove nativeApiLevelFromUserWithDefault

... in favor of proptools.StringDefault

Bug: 1663140
Test: m
Change-Id: I0b3062921b25179cd1bf53856973fb67fe5cfc05
parent d820c374
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -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)
+3 −2
Original line number Diff line number Diff line
@@ -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