Merge "Disable cdex for non background dexopt"
diff --git a/cmds/installd/dexopt.cpp b/cmds/installd/dexopt.cpp
index 944aeb9..6c069b2 100644
--- a/cmds/installd/dexopt.cpp
+++ b/cmds/installd/dexopt.cpp
@@ -412,7 +412,9 @@
 
     // Disable cdex if update input vdex is true since this combination of options is not
     // supported.
-    const bool disable_cdex = input_vdex_fd == output_vdex_fd;
+    // Disable cdex for non-background compiles since we don't want to regress app install until
+    // there are enough benefits to justify the tradeoff.
+    const bool disable_cdex = !background_job_compile || (input_vdex_fd == output_vdex_fd);
 
     const char* argv[9  // program name, mandatory arguments and the final NULL
                      + (have_dex2oat_isa_variant ? 1 : 0)