Merge changes Ib07d4410,I0b306292

* changes:
  ApexInfo doesn't pass MinSdkVersion as string, but as ApiLevel
  Remove nativeApiLevelFromUserWithDefault
This commit is contained in:
Jiyong Park
2021-04-15 23:21:55 +00:00
committed by Gerrit Code Review
6 changed files with 29 additions and 44 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

@@ -2499,7 +2499,7 @@ func (c *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
c.apexSdkVersion = android.FutureApiLevel
apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo)
if !apexInfo.IsForPlatform() {
c.apexSdkVersion = apexInfo.MinSdkVersion(ctx)
c.apexSdkVersion = apexInfo.MinSdkVersion
}
if android.InList("hwaddress", ctx.Config().SanitizeDevice()) {

View File

@@ -20,6 +20,7 @@ import (
"sync"
"github.com/google/blueprint"
"github.com/google/blueprint/proptools"
"android/soong/android"
)
@@ -142,8 +143,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