diff options
author | Yifan Hong <elsk@google.com> | 2020-01-13 18:33:00 -0800 |
---|---|---|
committer | Yifan Hong <elsk@google.com> | 2020-01-22 03:13:12 +0000 |
commit | 2257ee178b66938bb8b166342727c429297acae2 (patch) | |
tree | e8e0e606e805138ee25d4221da6169d923c2ce16 /common/dynamic_partition_control_interface.h | |
parent | 0850bcab2bc7fe14de3b16fe5b6603d586a8597a (diff) |
Add DynamicPartitionControlInterface::CleanupSuccessfulUpdate
This is a wrapper over SnapshotManager::WaitForMerge. It waits until the
previous update is merged, then return.
Bug: 138808328
Test: manual with update_engine_client
Change-Id: If44854810f37dd959ffdf3f62f26528867a71fc8
Diffstat (limited to 'common/dynamic_partition_control_interface.h')
-rw-r--r-- | common/dynamic_partition_control_interface.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/common/dynamic_partition_control_interface.h b/common/dynamic_partition_control_interface.h index 19bb5231..48cd9be1 100644 --- a/common/dynamic_partition_control_interface.h +++ b/common/dynamic_partition_control_interface.h @@ -22,6 +22,7 @@ #include <memory> #include <string> +#include "update_engine/common/error_code.h" #include "update_engine/update_metadata.pb.h" namespace chromeos_update_engine { @@ -77,6 +78,14 @@ class DynamicPartitionControlInterface { // After writing to new partitions, before rebooting into the new slot, call // this function to indicate writes to new partitions are done. virtual bool FinishUpdate() = 0; + + // Before applying the next update, call this function to clean up previous + // update files. This function blocks until delta files are merged into + // current OS partitions and finished cleaning up. + // - If successful, return kSuccess. + // - If any error, but caller should retry after reboot, return kError. + // - If any irrecoverable failures, return kDeviceCorrupted. + virtual ErrorCode CleanupSuccessfulUpdate() = 0; }; } // namespace chromeos_update_engine |