Add a Compilation OS mode to odrefresh.
When the --compilation-os-mode is set, odrefresh should:
- Unconditionally compile everything
- Write `compilationOsMode="true"` to the cache info and omit
`lastUpdateMillis`
- On the next boot, `--check` returns `kCompilationRequired`, and
`--compile` updates the cache info to fill `lastUpdateMillis` but does
not actually re-compile anything
Bug: 211458160
Test: odsign_e2e_tests
Change-Id: Ie913846d2000f9b57aa0e5133f9d25eb24aa0052
diff --git a/odrefresh/odrefresh.h b/odrefresh/odrefresh.h
index 0319094..bc6a68f 100644
--- a/odrefresh/odrefresh.h
+++ b/odrefresh/odrefresh.h
@@ -40,6 +40,9 @@
namespace odrefresh {
struct CompilationOptions {
+ // If true, update the cache info only and do not compile anything.
+ bool update_cache_info_only;
+
// If not empty, compile the bootclasspath extensions for ISAs in the list.
std::vector<InstructionSet> compile_boot_extensions_for_isas;
@@ -86,8 +89,8 @@
// Reads the ART APEX cache information (if any) found in the output artifact directory.
std::optional<com::android::art::CacheInfo> ReadCacheInfo() const;
- // Write ART APEX cache information to `kOnDeviceRefreshOdrefreshArtifactDirectory`.
- void WriteCacheInfo() const;
+ // Writes ART APEX cache information to `kOnDeviceRefreshOdrefreshArtifactDirectory`.
+ android::base::Result<void> WriteCacheInfo() const;
std::vector<com::android::art::Component> GenerateBootClasspathComponents() const;