Merge "Installd: Check for dex2oatd before running it"
diff --git a/cmds/installd/dexopt.cpp b/cmds/installd/dexopt.cpp
index 1882771..230853d 100644
--- a/cmds/installd/dexopt.cpp
+++ b/cmds/installd/dexopt.cpp
@@ -308,10 +308,11 @@
 
     // If the runtime was requested to use libartd.so, we'll run dex2oatd, otherwise dex2oat.
     const char* dex2oat_bin = "/system/bin/dex2oat";
-    static const char* kDex2oatDebugPath = "/system/bin/dex2oatd";
+    constexpr const char* kDex2oatDebugPath = "/system/bin/dex2oatd";
     if (is_debug_runtime() || (background_job_compile && is_debuggable_build())) {
-        DCHECK(access(kDex2oatDebugPath, X_OK) == 0);
-        dex2oat_bin = kDex2oatDebugPath;
+        if (access(kDex2oatDebugPath, X_OK) == 0) {
+            dex2oat_bin = kDex2oatDebugPath;
+        }
     }
 
     bool generate_minidebug_info = kEnableMinidebugInfo &&