BootControlAndroid: Implement using libhardware.
This simply calls into the a boot_control HAL implementation loaded with
libhardware. I've tested it with the implementation located in
system/extras/boot_control_copy.
The only non-trivial routine here is GetPartitionDevice() which I've
hand-tested on a device using the following snippet of code:
string names[] = {"boot", "system", "nope_enoent"};
for (string name : names) {
for (int slot = 0; slot <= 2; slot++) {
string device;
if (!GetPartitionDevice(name, slot, &device))
device = "NOTHERE";
LOG(INFO) << "slot:" << slot << " part:" << name << " -> " << device;
}
}
Change-Id: I1280325bd7cd4cf1cc9a33ef13c2f46f215da6e6
diff --git a/boot_control.h b/boot_control.h
index d6c403b..ae90f82 100644
--- a/boot_control.h
+++ b/boot_control.h
@@ -25,7 +25,8 @@
namespace boot_control {
// The real BootControlInterface is platform-specific. This factory function
-// creates a new BootControlInterface instance for the current platform.
+// creates a new BootControlInterface instance for the current platform. If
+// this fails nullptr is returned.
std::unique_ptr<BootControlInterface> CreateBootControl();
} // namespace boot_control