Introduce system_modules property to java_api_library

System_modules property provides the jars passed as bootclasspath when
compiling the stubs in the java_api_library where its creating
java_sdk_library's sdk_version is none, as the jars will not be provided
from the full_surface_stub_libs but compiled by itself in the child
change.

The jar provided by the system_modules will also be passed to metalava
to resolve hierarchy coming from outer dependencies.

Test: m --build-from-text-stub
Bug: 288624417
Change-Id: I8f3b89efa24bceb070d7a37fae3c7334dd7f0868
diff --git a/java/sdk_library.go b/java/sdk_library.go
index e410a41..f72c608 100644
--- a/java/sdk_library.go
+++ b/java/sdk_library.go
@@ -1837,6 +1837,7 @@
 		Libs                  []string
 		Static_libs           []string
 		Full_api_surface_stub *string
+		System_modules        *string
 	}{}
 
 	props.Name = proptools.StringPtr(module.apiLibraryModuleName(apiScope))
@@ -1875,6 +1876,8 @@
 		props.Full_api_surface_stub = proptools.StringPtr(apiScope.kind.DefaultJavaLibraryName() + "_full.from-text")
 	}
 
+	props.System_modules = module.deviceProperties.System_modules
+
 	mctx.CreateModule(ApiLibraryFactory, &props)
 }