Refresh existing artifacts in the compilation phase.
This allows odsign to call `odrefresh --check` without refreshing the
existing artifacts.
Bug: 206090748
Test: atest odsign_e2e_tests
Change-Id: I2207330f4eaeed917095e8883816f4c96fdeb4f9
diff --git a/odrefresh/odrefresh.h b/odrefresh/odrefresh.h
index 7969aa4..81704c2 100644
--- a/odrefresh/odrefresh.h
+++ b/odrefresh/odrefresh.h
@@ -101,11 +101,14 @@
std::string GetSystemServerImagePath(bool on_system, const std::string& jar_path) const;
- // Loads artifacts to memory and writes them back. Also cleans up other files in the artifact
- // directory. This essentially removes the existing artifacts from fs-verity so that odsign will
- // not encounter "file exists" error when it adds the existing artifacts to fs-verity.
- android::base::Result<void> RefreshExistingArtifactsAndCleanup(
- const std::vector<std::string>& artifacts) const;
+ // Removes files that are not in the list.
+ android::base::Result<void> CleanupArtifactDirectory(
+ const std::vector<std::string>& artifacts_to_keep) const;
+
+ // Loads artifacts to memory and writes them back. This essentially removes the existing artifacts
+ // from fs-verity so that odsign will not encounter "file exists" error when it adds the existing
+ // artifacts to fs-verity.
+ android::base::Result<void> RefreshExistingArtifacts() const;
// Checks whether all boot extension artifacts are present. Returns true if all are present, false
// otherwise.