Initialize DEX_PREOPT_DEFAULT based on global dexpreopt settings.

Bug: 177214554
Test: lunch cf_x86_phone-userdebug && m
Test: Ensure that `find out -name dexpreopt.config` lists before and
    after the fix are identical (for target cf_x86_phone-userdebug).
Test: TARGET_PRODUCT=mainline_modules_x86_64 \
    TARGET_BUILD_VARIANT=userdebug \
    build/soong/soong_ui.bash --make-mode UipbUtil
Change-Id: I28b38c08ad570d53dc679f9b42975545d457416e
diff --git a/core/dex_preopt_config.mk b/core/dex_preopt_config.mk
index f72752c..1223694 100644
--- a/core/dex_preopt_config.mk
+++ b/core/dex_preopt_config.mk
@@ -10,7 +10,7 @@
 endif
 
 # The default value for LOCAL_DEX_PREOPT
-DEX_PREOPT_DEFAULT ?= true
+DEX_PREOPT_DEFAULT ?= $(ENABLE_PREOPT)
 
 # The default filter for which files go into the system_other image (if it is
 # being used). Note that each pattern p here matches both '/<p>' and /system/<p>'.