Remove BootControlInterface::Cleanup
It is just a wrapper around GetDynamicPartitionControl()->Cleanup().
Delete it and let callers call it instead.
Test: update_engine_unittests
Change-Id: I068228a43dac122828c28bbc49a0f6f77e5b6ff2
diff --git a/boot_control_android.cc b/boot_control_android.cc
index 43b2c59..9f736b7 100644
--- a/boot_control_android.cc
+++ b/boot_control_android.cc
@@ -74,10 +74,6 @@
return true;
}
-void BootControlAndroid::Cleanup() {
- dynamic_control_->Cleanup();
-}
-
unsigned int BootControlAndroid::GetNumSlots() const {
return module_->getNumberSlots();
}
diff --git a/boot_control_android.h b/boot_control_android.h
index 5de9fff..c909134 100644
--- a/boot_control_android.h
+++ b/boot_control_android.h
@@ -51,7 +51,6 @@
bool MarkSlotUnbootable(BootControlInterface::Slot slot) override;
bool SetActiveBootSlot(BootControlInterface::Slot slot) override;
bool MarkBootSuccessfulAsync(base::Callback<void(bool)> callback) override;
- void Cleanup() override;
DynamicPartitionControlInterface* GetDynamicPartitionControl() override;
private:
diff --git a/boot_control_chromeos.cc b/boot_control_chromeos.cc
index 6f50176..e972d41 100644
--- a/boot_control_chromeos.cc
+++ b/boot_control_chromeos.cc
@@ -329,8 +329,6 @@
return -1;
}
-void BootControlChromeOS::Cleanup() {}
-
DynamicPartitionControlInterface*
BootControlChromeOS::GetDynamicPartitionControl() {
return dynamic_partition_control_.get();
diff --git a/boot_control_chromeos.h b/boot_control_chromeos.h
index 7fe4570..10454be 100644
--- a/boot_control_chromeos.h
+++ b/boot_control_chromeos.h
@@ -52,7 +52,6 @@
bool MarkSlotUnbootable(BootControlInterface::Slot slot) override;
bool SetActiveBootSlot(BootControlInterface::Slot slot) override;
bool MarkBootSuccessfulAsync(base::Callback<void(bool)> callback) override;
- void Cleanup() override;
DynamicPartitionControlInterface* GetDynamicPartitionControl() override;
private:
diff --git a/common/boot_control_interface.h b/common/boot_control_interface.h
index 1242393..41fe4ea 100644
--- a/common/boot_control_interface.h
+++ b/common/boot_control_interface.h
@@ -85,9 +85,6 @@
// of the operation.
virtual bool MarkBootSuccessfulAsync(base::Callback<void(bool)> callback) = 0;
- // Do necessary clean-up operations after the whole update.
- virtual void Cleanup() = 0;
-
// Return the dynamic partition control interface.
virtual DynamicPartitionControlInterface* GetDynamicPartitionControl() = 0;
diff --git a/common/boot_control_stub.cc b/common/boot_control_stub.cc
index 3d2b6d0..d198e9d 100644
--- a/common/boot_control_stub.cc
+++ b/common/boot_control_stub.cc
@@ -63,10 +63,6 @@
return false;
}
-void BootControlStub::Cleanup() {
- LOG(ERROR) << __FUNCTION__ << " should never be called.";
-}
-
DynamicPartitionControlInterface*
BootControlStub::GetDynamicPartitionControl() {
return dynamic_partition_control_.get();
diff --git a/common/boot_control_stub.h b/common/boot_control_stub.h
index 24e5f05..1dfd08b 100644
--- a/common/boot_control_stub.h
+++ b/common/boot_control_stub.h
@@ -47,7 +47,6 @@
bool MarkSlotUnbootable(BootControlInterface::Slot slot) override;
bool SetActiveBootSlot(BootControlInterface::Slot slot) override;
bool MarkBootSuccessfulAsync(base::Callback<void(bool)> callback) override;
- void Cleanup() override;
DynamicPartitionControlInterface* GetDynamicPartitionControl() override;
private:
diff --git a/common/fake_boot_control.h b/common/fake_boot_control.h
index d621aae..e031fc6 100644
--- a/common/fake_boot_control.h
+++ b/common/fake_boot_control.h
@@ -78,8 +78,6 @@
return true;
}
- void Cleanup() override {}
-
// Setters
void SetNumSlots(unsigned int num_slots) {
num_slots_ = num_slots;
diff --git a/update_attempter_android.cc b/update_attempter_android.cc
index 5bffc42..b76e05b 100644
--- a/update_attempter_android.cc
+++ b/update_attempter_android.cc
@@ -597,7 +597,7 @@
return;
}
- boot_control_->Cleanup();
+ boot_control_->GetDynamicPartitionControl()->Cleanup();
download_progress_ = 0;
UpdateStatus new_status =