odrefresh: Disable partial compilation on devices without security fix

Bug: 206090748
Test: atest art_standalone_odrefresh_tests
Ignore-AOSP-First: Security fix
Change-Id: I96e28d2284a3a0d275fc6556681dd5f3537e433b
diff --git a/odrefresh/odrefresh_main.cc b/odrefresh/odrefresh_main.cc
index c2298f0..ffce81c 100644
--- a/odrefresh/odrefresh_main.cc
+++ b/odrefresh/odrefresh_main.cc
@@ -41,6 +41,7 @@
 using ::art::odrefresh::OdrMetrics;
 using ::art::odrefresh::OnDeviceRefresh;
 using ::art::odrefresh::QuotePath;
+using ::art::odrefresh::ShouldDisablePartialCompilation;
 using ::art::odrefresh::ShouldDisableRefresh;
 using ::art::odrefresh::ZygoteKind;
 
@@ -169,6 +170,12 @@
     config->SetSystemServerCompilerFilter(filter);
   }
 
+  if (!config->HasPartialCompilation() &&
+      ShouldDisablePartialCompilation(
+          android::base::GetProperty("ro.build.version.security_patch", /*default_value=*/""))) {
+    config->SetPartialCompilation(false);
+  }
+
   if (ShouldDisableRefresh(
           android::base::GetProperty("ro.build.version.sdk", /*default_value=*/""))) {
     config->SetRefresh(false);