Merge "Don't verify dex file when the runtime is in NoVerify mode."
diff --git a/runtime/class_loader_context.cc b/runtime/class_loader_context.cc
index 5510743..38f59ef 100644
--- a/runtime/class_loader_context.cc
+++ b/runtime/class_loader_context.cc
@@ -230,7 +230,7 @@
       // contents. So pass true to verify_checksum.
       if (!DexFileLoader::Open(location.c_str(),
                                location.c_str(),
-                               /*verify*/ true,
+                               Runtime::Current()->IsVerificationEnabled(),
                                /*verify_checksum*/ true,
                                &error_msg,
                                &info.opened_dex_files)) {
diff --git a/runtime/oat_file_manager.cc b/runtime/oat_file_manager.cc
index a3cbe95..940195c 100644
--- a/runtime/oat_file_manager.cc
+++ b/runtime/oat_file_manager.cc
@@ -599,7 +599,7 @@
         static constexpr bool kVerifyChecksum = true;
         if (!DexFileLoader::Open(dex_location,
                                  dex_location,
-                                 /*verify*/ true,
+                                 Runtime::Current()->IsVerificationEnabled(),
                                  kVerifyChecksum,
                                  /*out*/ &error_msg,
                                  &dex_files)) {
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 9d16f57..c88799c 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -1024,8 +1024,12 @@
       LOG(WARNING) << "Skipping non-existent dex file '" << dex_filename << "'";
       continue;
     }
-    if (!DexFileLoader::Open(
-          dex_filename, dex_location, /* verify */ true, kVerifyChecksum, &error_msg, dex_files)) {
+    if (!DexFileLoader::Open(dex_filename,
+                             dex_location,
+                             Runtime::Current()->IsVerificationEnabled(),
+                             kVerifyChecksum,
+                             &error_msg,
+                             dex_files)) {
       LOG(WARNING) << "Failed to open .dex from file '" << dex_filename << "': " << error_msg;
       ++failure_count;
     }