Move MarkBootSuccessful to BootControlInterface.
Updating the boot flags to mark the current boot as successful is
platform-specific and part of the BootControlInterface's job. This
patch moves this to a new async method in this interface.
Bug: 24077637
Test: FEATURES=test emerge-link update_engine; cros flash in Chrome OS; tested on a dragonboard.
Change-Id: I23c3ed915dd8d2588a90d84b212bb04977957975
diff --git a/boot_control_interface.h b/boot_control_interface.h
index 135d2eb..36f2caf 100644
--- a/boot_control_interface.h
+++ b/boot_control_interface.h
@@ -20,6 +20,7 @@
#include <climits>
#include <string>
+#include <base/callback.h>
#include <base/macros.h>
namespace chromeos_update_engine {
@@ -64,6 +65,12 @@
// Returns true on success.
virtual bool MarkSlotUnbootable(Slot slot) = 0;
+ // Mark the current slot as successfully booted asynchronously. No other slot
+ // flags are modified. Returns false if it was not able to schedule the
+ // operation, otherwise, returns true and calls the |callback| with the result
+ // of the operation.
+ virtual bool MarkBootSuccessfulAsync(base::Callback<void(bool)> callback) = 0;
+
// Return a human-readable slot name used for logging.
static std::string SlotName(Slot slot) {
if (slot == kInvalidSlot)