Add property to prevent dex preopting

Add dex_preopt property and pass it through to make as
LOCAL_DEX_PREOPT.

Test: m checkbuild
Change-Id: I6f19d097d1769068b7e4093f011574c540c137f3
diff --git a/java/androidmk.go b/java/androidmk.go
index e349de4..97924f3 100644
--- a/java/androidmk.go
+++ b/java/androidmk.go
@@ -36,6 +36,9 @@
 				}
 				if library.dexJarFile != nil {
 					fmt.Fprintln(w, "LOCAL_SOONG_DEX_JAR :=", library.dexJarFile.String())
+					if library.deviceProperties.Dex_preopt == nil || *library.deviceProperties.Dex_preopt == false {
+						fmt.Fprintln(w, "LOCAL_DEX_PREOPT := false")
+					}
 				}
 				fmt.Fprintln(w, "LOCAL_SDK_VERSION :=", library.deviceProperties.Sdk_version)
 			},
diff --git a/java/java.go b/java/java.go
index 5310bc8..6973915 100644
--- a/java/java.go
+++ b/java/java.go
@@ -143,6 +143,10 @@
 	// If true, export a copy of the module as a -hostdex module for host testing.
 	Hostdex *bool
 
+	// If false, prevent dexpreopting and stripping the dex file from the final jar.  Defaults to
+	// true.
+	Dex_preopt *bool
+
 	// When targeting 1.9, override the modules to use with --system
 	System_modules *string
 }