Disable dex_preopt on individual app's basis

Instead of relying on the global variable WITH_DEXPREOPT,
or the old fact that we align the apk before we remove clases.dex from
the apk if dex_reopt is enabled. That's not true any more.

Bug: 9760867
Change-Id: I816c44393a8a1a1a719b1d3503c264a12f724b52
diff --git a/CtsCoverage.mk b/CtsCoverage.mk
index 8d67a99..4689bae 100644
--- a/CtsCoverage.mk
+++ b/CtsCoverage.mk
@@ -78,8 +78,6 @@
 	$(hide) echo $(1): file://$(ANDROID_BUILD_TOP)/$(coverage_out)/$(5)
 endef
 
-# classes.dex is stripped from package.apk if dex-preopt is enabled,
-# so we use the copy that definitely includes classes.dex.
 define add-testcase-apk
-	$(1) += $(call intermediates-dir-for,APPS,$(2))/package.apk.unaligned
+	$(1) += $(call intermediates-dir-for,APPS,$(2))/package.apk
 endef
diff --git a/apps/CtsVerifier/Android.mk b/apps/CtsVerifier/Android.mk
index 3b1674e..834320b 100644
--- a/apps/CtsVerifier/Android.mk
+++ b/apps/CtsVerifier/Android.mk
@@ -32,6 +32,8 @@
 
 LOCAL_SDK_VERSION := current
 
+LOCAL_DEX_PREOPT := false
+
 include $(BUILD_PACKAGE)
 
 # Builds and launches CTS Verifier on a device.
diff --git a/suite/audio_quality/client/Android.mk b/suite/audio_quality/client/Android.mk
index 090c758..6d60541 100644
--- a/suite/audio_quality/client/Android.mk
+++ b/suite/audio_quality/client/Android.mk
@@ -30,4 +30,6 @@
 # intentional to keep compatibility with ICS
 LOCAL_SDK_VERSION := 15
 
+LOCAL_DEX_PREOPT := false
+
 include $(BUILD_PACKAGE)
diff --git a/tests/ProcessTest/Android.mk b/tests/ProcessTest/Android.mk
index ba58e87..4f23fac 100644
--- a/tests/ProcessTest/Android.mk
+++ b/tests/ProcessTest/Android.mk
@@ -28,6 +28,8 @@
 
 LOCAL_PACKAGE_NAME := ProcessTests
 
+LOCAL_DEX_PREOPT := false
+
 include $(BUILD_PACKAGE)
 
 include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/ProcessTest/NoShareUidApp/Android.mk b/tests/ProcessTest/NoShareUidApp/Android.mk
index 66bf8ce..c57d71d 100644
--- a/tests/ProcessTest/NoShareUidApp/Android.mk
+++ b/tests/ProcessTest/NoShareUidApp/Android.mk
@@ -26,5 +26,6 @@
 LOCAL_PACKAGE_NAME := NoShareUidApp
 
 LOCAL_PROGUARD_ENABLED := disabled
+LOCAL_DEX_PREOPT := false
 
 include $(BUILD_PACKAGE)
diff --git a/tests/ProcessTest/ShareUidApp/Android.mk b/tests/ProcessTest/ShareUidApp/Android.mk
index aeb4661..131f768 100644
--- a/tests/ProcessTest/ShareUidApp/Android.mk
+++ b/tests/ProcessTest/ShareUidApp/Android.mk
@@ -26,5 +26,6 @@
 LOCAL_PACKAGE_NAME := ShareUidApp
 
 LOCAL_PROGUARD_ENABLED := disabled
+LOCAL_DEX_PREOPT := false
 
 include $(BUILD_PACKAGE)
diff --git a/tests/SignatureTest/tests/Android.mk b/tests/SignatureTest/tests/Android.mk
index b458aad..bdd0a90 100644
--- a/tests/SignatureTest/tests/Android.mk
+++ b/tests/SignatureTest/tests/Android.mk
@@ -17,4 +17,6 @@
 
 LOCAL_PROGUARD_FLAGS := -ignorewarnings
 
+LOCAL_DEX_PREOPT := false
+
 include $(BUILD_PACKAGE)
diff --git a/tests/uiautomator/test-apps/CtsUiAutomatorApp/Android.mk b/tests/uiautomator/test-apps/CtsUiAutomatorApp/Android.mk
index fe4342a..90bdb61 100644
--- a/tests/uiautomator/test-apps/CtsUiAutomatorApp/Android.mk
+++ b/tests/uiautomator/test-apps/CtsUiAutomatorApp/Android.mk
@@ -28,4 +28,6 @@
 
 LOCAL_PROGUARD_ENABLED := disabled
 
+LOCAL_DEX_PREOPT := false
+
 include $(BUILD_PACKAGE)