Link type check for Android.bp defined Java modules

Link-type is also checked among Java modules defined in Soong. Until
now, the check has been done in between Soong/Make and Make/Make.

With this, a Java module can't depend on another Java module built with
larger API surface. For example, a java library built with Android SDK
(sdk_version: "current") can't link to a library built without SDK.

Bug: 73829976
Test: m -j

Change-Id: I64277be6e65e8535aad951b4f08f8d10b67abe66
Merged-In: I64277be6e65e8535aad951b4f08f8d10b67abe66
(cherry picked from commit f3586661e8525125f529082fee14edec32d73e04)
diff --git a/java/java_test.go b/java/java_test.go
index 6e3ada4..6b730da 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -818,12 +818,14 @@
 		java_library {
 			name: "foo",
 			srcs: ["a.java"],
+			sdk_version: "14",
 		}
 
 		java_library {
 			name: "bar",
 			srcs: ["b.java"],
 			static_libs: ["foo"],
+			sdk_version: "14",
 		}
 
 		java_library {