summaryrefslogtreecommitdiffstats
path: root/runtime/class_linker.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/class_linker.cc')
-rw-r--r--runtime/class_linker.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index ee66b49e7d..327875195d 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -1008,10 +1008,15 @@ bool ClassLinker::OpenDexFilesFromOat(const char* dex_location, const char* oat_
// Failed, bail.
if (open_oat_file.get() == nullptr) {
- std::string error_msg;
// dex2oat was disabled or crashed. Add the dex file in the list of dex_files to make progress.
- DexFile::Open(dex_location, dex_location, &error_msg, dex_files);
- error_msgs->push_back(error_msg);
+ if (Runtime::Current()->IsDexFileFallbackEnabled()) {
+ std::string error_msg;
+ if (!DexFile::Open(dex_location, dex_location, &error_msg, dex_files)) {
+ error_msgs->push_back(error_msg);
+ }
+ } else {
+ error_msgs->push_back("Fallback mode disabled, skipping dex files.");
+ }
return false;
}