Revert "Revert "Use compiler filter to determine oat file status.""

This reverts commit 845e5064580bd37ad5014f7aa0d078be7265464d.

Add an option to change what OatFileManager considers up-to-date.
In our tests we're allowed to write to the dalvik-cache, so it
cannot be kSpeed.

Bug: 27689078
Change-Id: I0c578705a9921114ed1fb00d360cc7448addc93a
diff --git a/runtime/oat_file_manager.h b/runtime/oat_file_manager.h
index a541d10..574d0e2 100644
--- a/runtime/oat_file_manager.h
+++ b/runtime/oat_file_manager.h
@@ -25,6 +25,7 @@
 
 #include "base/macros.h"
 #include "base/mutex.h"
+#include "compiler_filter.h"
 #include "jni.h"
 
 namespace art {
@@ -110,6 +111,10 @@
 
   void DumpForSigQuit(std::ostream& os);
 
+  static void SetCompilerFilter(CompilerFilter::Filter filter) {
+    filter_ = filter;
+  }
+
  private:
   // Check for duplicate class definitions of the given oat file against all open oat files.
   // Return true if there are any class definition collisions in the oat_file.
@@ -122,6 +127,10 @@
   std::set<std::unique_ptr<const OatFile>> oat_files_ GUARDED_BY(Locks::oat_file_manager_lock_);
   std::unordered_map<std::string, size_t> oat_file_count_ GUARDED_BY(Locks::oat_file_count_lock_);
   bool have_non_pic_oat_file_;
+
+  // The compiler filter used for oat files loaded by the oat file manager.
+  static CompilerFilter::Filter filter_;
+
   DISALLOW_COPY_AND_ASSIGN(OatFileManager);
 };