Also CancelUpdate when UpdateState::None.
Test: pass
Bug: 147696014
Change-Id: Ie98207d897a47edbb52b51252fa71f8c7577508c
diff --git a/cleanup_previous_update_action.cc b/cleanup_previous_update_action.cc
index f104970..6c5cd1c 100644
--- a/cleanup_previous_update_action.cc
+++ b/cleanup_previous_update_action.cc
@@ -172,7 +172,12 @@
switch (state) {
case UpdateState::None: {
LOG(INFO) << "Can't find any snapshot to merge.";
- processor_->ActionComplete(this, ErrorCode::kSuccess);
+ ErrorCode error_code = ErrorCode::kSuccess;
+ if (!snapshot_->CancelUpdate()) {
+ error_code = ErrorCode::kError;
+ LOG(INFO) << "Failed to call SnapshotManager::CancelUpdate().";
+ }
+ processor_->ActionComplete(this, error_code);
return;
}