Remove BootControlInterface::PreparePartitionsForUpdate
Replace with GetDynamicPartitionControl()->PreparePartitionsForUpdate(
GetCurrentSlot(), ...).
Test: update_engine_unittests
Change-Id: Ib03ee97a25727a9292cbb0c9aab5dbe75a2b6913
diff --git a/common/boot_control_interface.h b/common/boot_control_interface.h
index 2f8e9e3..1242393 100644
--- a/common/boot_control_interface.h
+++ b/common/boot_control_interface.h
@@ -57,9 +57,10 @@
// The |slot| number must be between 0 and GetNumSlots() - 1 and the
// |partition_name| is a platform-specific name that identifies a partition on
// every slot. In order to access the dynamic partitions in the target slot,
- // PreparePartitionsForUpdate() must be called (once per payload) prior to
- // calling this function. On success, returns true and stores the block device
- // in |device|.
+ // GetDynamicPartitionControl()->PreparePartitionsForUpdate() must be called
+ // (with |update| == true for the first time for a payload, and |false| for
+ // for the rest of the times) prior to calling this function. On success,
+ // returns true and stores the block device in |device|.
virtual bool GetPartitionDevice(const std::string& partition_name,
Slot slot,
std::string* device) const = 0;
@@ -84,14 +85,6 @@
// of the operation.
virtual bool MarkBootSuccessfulAsync(base::Callback<void(bool)> callback) = 0;
- // Initializes the metadata of the underlying partitions for a given |slot|
- // and sets up the states for accessing dynamic partitions.
- // Metadata will be written to the specified |slot| if
- // |update_metadata| is set.
- virtual bool PreparePartitionsForUpdate(Slot slot,
- const DeltaArchiveManifest& manifest,
- bool update_metadata) = 0;
-
// Do necessary clean-up operations after the whole update.
virtual void Cleanup() = 0;
diff --git a/common/boot_control_stub.cc b/common/boot_control_stub.cc
index 6ae88f1..3d2b6d0 100644
--- a/common/boot_control_stub.cc
+++ b/common/boot_control_stub.cc
@@ -63,12 +63,6 @@
return false;
}
-bool BootControlStub::PreparePartitionsForUpdate(
- Slot slot, const DeltaArchiveManifest& manifest, bool update_metadata) {
- LOG(ERROR) << __FUNCTION__ << " should never be called.";
- return false;
-}
-
void BootControlStub::Cleanup() {
LOG(ERROR) << __FUNCTION__ << " should never be called.";
}
diff --git a/common/boot_control_stub.h b/common/boot_control_stub.h
index 3307813..24e5f05 100644
--- a/common/boot_control_stub.h
+++ b/common/boot_control_stub.h
@@ -47,9 +47,6 @@
bool MarkSlotUnbootable(BootControlInterface::Slot slot) override;
bool SetActiveBootSlot(BootControlInterface::Slot slot) override;
bool MarkBootSuccessfulAsync(base::Callback<void(bool)> callback) override;
- bool PreparePartitionsForUpdate(Slot slot,
- const DeltaArchiveManifest& manifest,
- bool update_metadata) override;
void Cleanup() override;
DynamicPartitionControlInterface* GetDynamicPartitionControl() override;
diff --git a/common/fake_boot_control.h b/common/fake_boot_control.h
index 1d6d979..d621aae 100644
--- a/common/fake_boot_control.h
+++ b/common/fake_boot_control.h
@@ -78,12 +78,6 @@
return true;
}
- bool PreparePartitionsForUpdate(Slot slot,
- const DeltaArchiveManifest& manifest,
- bool update_metadata) override {
- return true;
- }
-
void Cleanup() override {}
// Setters