Set trigger for generating the cache info.

Before this change, if artifacts on /system are good so that we only
need to generate the cache info, the trigger is kUnknown. After the
change, the trigger is set to the correct value.

Bug: 271875098
Test: atest odsign_e2e_tests_full
Change-Id: Ib8fecab91f4342ae6975005634b6de49c186c970
diff --git a/odrefresh/odrefresh.cc b/odrefresh/odrefresh.cc
index 0d098cff..346313e 100644
--- a/odrefresh/odrefresh.cc
+++ b/odrefresh/odrefresh.cc
@@ -1415,10 +1415,14 @@
                                           &checked_artifacts);
   }
 
-  // Return kCompilationRequired to generate the cache info even if there's nothing to compile.
   bool compilation_required = !compilation_options->compile_boot_classpath_for_isas.empty() ||
-                              !compilation_options->system_server_jars_to_compile.empty() ||
-                              !data_result.IsAllOk();
+                              !compilation_options->system_server_jars_to_compile.empty();
+
+  if (!compilation_required && !data_result.IsAllOk()) {
+    // Return kCompilationRequired to generate the cache info even if there's nothing to compile.
+    compilation_required = true;
+    metrics.SetTrigger(data_result.GetTrigger());
+  }
 
   // If partial compilation is disabled, we should compile everything regardless of what's in
   // `compilation_options`.