Merge "Don't disable dexpreopt for an unbundled build."
diff --git a/core/config.mk b/core/config.mk
index 025a3a1..d016501 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -502,6 +502,10 @@
   DISABLE_PREOPT := true
 endif
 ifeq (true,$(TARGET_BUILD_UNBUNDLED))
+  # Don't disable dexpreopt for an unbundled build. Dexpreopt generates profiles that need to be
+  # installed in the APEX. Soong will skip the dex2oat step after it generates the build rule for
+  # profiles.
+  DISABLE_PREOPT :=
   ifneq (true,$(UNBUNDLED_BUILD_SDKS_FROM_SOURCE))
     TARGET_BUILD_USE_PREBUILT_SDKS := true
   endif