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

Commit d8b3df07 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Use sdkSpec to compare sdk_versions of APK/JNI" am: 8a624337

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1322146

Change-Id: Ieffbf61a1fb792e410e78c261662c80e15c2a05d
parents ab24ae3b 8a624337
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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