Merge changes from topic "apk-jni-enforce" into rvc-dev am: de58c39bd6

Change-Id: Ib163e2407527c33c773179f1109b705c4f5202e5
This commit is contained in:
Jooyung Han 2020-05-29 10:48:21 +00:00 committed by Automerger Merge Worker
commit 0441ceb569
1 changed files with 5 additions and 2 deletions

View File

@ -445,8 +445,11 @@ func (a *AndroidApp) checkJniLibsSdkVersion(ctx android.ModuleContext, minSdkVer
return
}
dep, _ := m.(*cc.Module)
jniSdkVersion, err := android.ApiStrToNum(ctx, dep.SdkVersion())
if err != nil || int(minSdkVersion) < jniSdkVersion {
// The domain of cc.sdk_version is "current" and <number>
// We can rely on sdkSpec to convert it to <number> so that "current" is handled
// properly regardless of sdk finalization.
jniSdkVersion, err := sdkSpecFrom(dep.SdkVersion()).effectiveVersion(ctx)
if err != nil || minSdkVersion < jniSdkVersion {
ctx.OtherModuleErrorf(dep, "sdk_version(%v) is higher than min_sdk_version(%v) of the containing android_app(%v)",
dep.SdkVersion(), minSdkVersion, ctx.ModuleName())
return