BootControl exposes DynamicPartitionControl.
Add BootControlInterface::GetDynamicPartitionControl, which
exposes the internal DynamicPartitionControlInterface object.
BootControlStub / FakeBootControl / BootControlChromeOS uses
DynamicPartitionControlStub (all functions succeeds).
BootControlAndroid uses DynamicPartitionControlAndroid.
GetPartitionDevice is exposed so that BootControlAndroid can use it.
Follow-up CLs delete duplicated PreparePartitionsForUpdate
and Cleanup from BootControlInterface so that BootControlAndroid remains
a thin wrapper of the HAL (+GetPartitionDevice, which exists before
dynamic partitions.)
Test: update_engine_unittests
Change-Id: Ifc2aa2ee8a63ef581c8ebc562ec158794ac51dfd
diff --git a/common/boot_control_stub.cc b/common/boot_control_stub.cc
index b10e82f..6ae88f1 100644
--- a/common/boot_control_stub.cc
+++ b/common/boot_control_stub.cc
@@ -15,6 +15,7 @@
//
#include "update_engine/common/boot_control_stub.h"
+#include "update_engine/common/dynamic_partition_control_stub.h"
#include <base/logging.h>
@@ -22,6 +23,9 @@
namespace chromeos_update_engine {
+BootControlStub::BootControlStub()
+ : dynamic_partition_control_(new DynamicPartitionControlStub()) {}
+
unsigned int BootControlStub::GetNumSlots() const {
return 0;
}
@@ -69,4 +73,9 @@
LOG(ERROR) << __FUNCTION__ << " should never be called.";
}
+DynamicPartitionControlInterface*
+BootControlStub::GetDynamicPartitionControl() {
+ return dynamic_partition_control_.get();
+}
+
} // namespace chromeos_update_engine