Export dex jars from java binaries

Set LOCAL_SOONG_DEX_JAR and LOCAL_SOONG_BUILT_INSTALLED for
java binaries to install the jar with classes.dex and the
preopted files.

Bug: 122831369
Test: m deployagent
Change-Id: I6018aee25491e0c77a5f6dc464668d2bf6c317c0
diff --git a/java/androidmk.go b/java/androidmk.go
index 70d0f7f..4d3af12 100644
--- a/java/androidmk.go
+++ b/java/androidmk.go
@@ -157,6 +157,12 @@
 				func(w io.Writer, outputFile android.Path) {
 					fmt.Fprintln(w, "LOCAL_SOONG_HEADER_JAR :=", binary.headerJarFile.String())
 					fmt.Fprintln(w, "LOCAL_SOONG_CLASSES_JAR :=", binary.implementationAndResourcesJar.String())
+					if binary.dexJarFile != nil {
+						fmt.Fprintln(w, "LOCAL_SOONG_DEX_JAR :=", binary.dexJarFile.String())
+					}
+					if len(binary.dexpreopter.builtInstalled) > 0 {
+						fmt.Fprintln(w, "LOCAL_SOONG_BUILT_INSTALLED :=", strings.Join(binary.dexpreopter.builtInstalled, " "))
+					}
 				},
 			},
 			Custom: func(w io.Writer, name, prefix, moduleDir string, data android.AndroidMkData) {