Mark current slot successful after cancelling an update. am: 5259033d23
am: 81c8676f21
Change-Id: I63cb9f62de023dddacbbc44ee3ee10409e61a4ec
diff --git a/update_attempter.cc b/update_attempter.cc
index 8afc395..4e300d7 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -1140,6 +1140,12 @@
if (!boot_control->SetActiveBootSlot(boot_control->GetCurrentSlot()))
ret_value = false;
+ // Mark the current slot as successful again, since marking it as active
+ // may reset the successful bit. We ignore the result of whether marking
+ // the current slot as successful worked.
+ if (!boot_control_->MarkBootSuccessfulAsync(Bind([](bool successful){})))
+ ret_value = false;
+
// Notify the PayloadState that the successful payload was canceled.
system_state_->payload_state()->ResetUpdateStatus();
diff --git a/update_attempter_android.cc b/update_attempter_android.cc
index 2de2667..a5c25c0 100644
--- a/update_attempter_android.cc
+++ b/update_attempter_android.cc
@@ -257,6 +257,12 @@
if (!boot_control_->SetActiveBootSlot(boot_control_->GetCurrentSlot()))
ret_value = false;
+ // Mark the current slot as successful again, since marking it as active
+ // may reset the successful bit. We ignore the result of whether marking
+ // the current slot as successful worked.
+ if (!boot_control_->MarkBootSuccessfulAsync(Bind([](bool successful){})))
+ ret_value = false;
+
if (!ret_value) {
return LogAndSetError(
error,