Introduce a whitelist for core apps used by system server.

And by default 'speed' compile those apps at build time.

bug:33799337
Test: m -j32

(cherry picked from commit 9af483488a5d0fab89db626fc4d73c993b6d7d2a)

Change-Id: I66f1c675369fccc03b6529c08cb030264d15ba1c
diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk
index 68c46f5..a347d05 100644
--- a/core/dex_preopt_odex_install.mk
+++ b/core/dex_preopt_odex_install.mk
@@ -151,6 +151,13 @@
 LOCAL_DEX_PREOPT_FLAGS := $(PRODUCT_DEX_PREOPT_DEFAULT_FLAGS)
 endif
 endif
+
+# Jars of system server, and apps loaded into system server should be
+# compiled with the 'speed' compiler filter.
+ifneq (,$(filter $(PRODUCT_SYSTEM_SERVER_JARS) $(PRODUCT_SYSTEM_SERVER_APPS),$(LOCAL_MODULE)))
+  LOCAL_DEX_PREOPT_FLAGS += --compiler-filter=speed
+endif
+
 $(built_odex): PRIVATE_DEX_PREOPT_FLAGS := $(LOCAL_DEX_PREOPT_FLAGS)
 $(built_vdex): $(built_odex)
 $(built_art): $(built_odex)