Update usages of min_sdk_version that relies on (kind+level)

The type of min_sdk_version is being migrated from
android.SdkSpec(kind+level) to android.ApiLevel(level). This affects
`ShouldSupportSdkVersion` for java modules. This function skips the
check for modules compiling against `core`, and that requires access to
SdkVersion and not MinSdkVersion after the migration.

Skip the check explicitly using SdkVersion.

Test: go test ./java
Test: No change in ninja file
Bug: 208456999
Change-Id: I14eca4f8e8c5d7477ded00c4fe54097323fab4a2
diff --git a/java/base.go b/java/base.go
index e7e3d8f..2e77c1e 100644
--- a/java/base.go
+++ b/java/base.go
@@ -1845,15 +1845,18 @@
 
 // Implements android.ApexModule
 func (j *Module) ShouldSupportSdkVersion(ctx android.BaseModuleContext, sdkVersion android.ApiLevel) error {
-	sdkSpec := j.MinSdkVersion(ctx)
-	if !sdkSpec.Specified() {
+	sdkVersionSpec := j.SdkVersion(ctx)
+	minSdkVersionSpec := j.MinSdkVersion(ctx)
+	if !minSdkVersionSpec.Specified() {
 		return fmt.Errorf("min_sdk_version is not specified")
 	}
-	if sdkSpec.Kind == android.SdkCore {
+	// If the module is compiling against core (via sdk_version), skip comparison check.
+	if sdkVersionSpec.Kind == android.SdkCore {
 		return nil
 	}
-	if sdkSpec.ApiLevel.GreaterThan(sdkVersion) {
-		return fmt.Errorf("newer SDK(%v)", sdkSpec.ApiLevel)
+	minSdkVersion := minSdkVersionSpec.ApiLevel
+	if minSdkVersion.GreaterThan(sdkVersion) {
+		return fmt.Errorf("newer SDK(%v)", minSdkVersion)
 	}
 	return nil
 }