Snap for 7633965 from 7b4fead5e9441eeb9ff5a9336d500b49ffae8d97 to sc-release

Change-Id: I8bbe1e1ab79facdba296e94f3da0eb142a5d153f
diff --git a/odrefresh/odrefresh.cc b/odrefresh/odrefresh.cc
index cda39ee..2cef50d 100644
--- a/odrefresh/odrefresh.cc
+++ b/odrefresh/odrefresh.cc
@@ -1139,7 +1139,13 @@
       AddDex2OatInstructionSet(&args, isa);
       const std::string jar_name(android::base::Basename(jar));
       const std::string profile = Concatenate({GetAndroidRoot(), "/framework/", jar_name, ".prof"});
-      AddDex2OatProfileAndCompilerFilter(&args, profile);
+      std::string compiler_filter =
+          android::base::GetProperty("dalvik.vm.systemservercompilerfilter", "speed");
+      if (compiler_filter == "speed-profile") {
+        AddDex2OatProfileAndCompilerFilter(&args, profile);
+      } else {
+        args.emplace_back("--compiler-filter=" + compiler_filter);
+      }
 
       const std::string image_location = GetSystemServerImagePath(/*on_system=*/false, jar);
       const std::string install_location = android::base::Dirname(image_location);