diff options
Diffstat (limited to 'bootctrl/LegacyBootControl.cpp')
-rw-r--r-- | bootctrl/LegacyBootControl.cpp | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/bootctrl/LegacyBootControl.cpp b/bootctrl/LegacyBootControl.cpp index a5f29f8..83254e9 100644 --- a/bootctrl/LegacyBootControl.cpp +++ b/bootctrl/LegacyBootControl.cpp @@ -97,22 +97,6 @@ Return<void> BootControl::getSuffix(uint32_t slot, getSuffix_cb _hidl_cb) { return Void(); } -#ifdef BOOT_CONTROL_RECOVERY -IBootControl *HIDL_FETCH_IBootControl(const char * /* hal */) { - boot_control_module_t *module; - - // For devices that don't build a standalone libhardware bootctrl impl for recovery, - // we simulate the hw_get_module() by accessing it from the current process directly. - const hw_module_t *hw_module = &HAL_MODULE_INFO_SYM; - if (!hw_module || strcmp(BOOT_CONTROL_HARDWARE_MODULE_ID, hw_module->id) != 0) { - ALOGE("Error loading boot_control HAL implementation: %d.", -EINVAL); - return nullptr; - } - module = reinterpret_cast<boot_control_module_t *>(const_cast<hw_module_t *>(hw_module)); - module->init(module); - return new BootControl(module); -} -#else IBootControl *HIDL_FETCH_IBootControl(const char * /* hal */) { int ret = 0; boot_control_module_t *module = NULL; @@ -123,9 +107,14 @@ IBootControl *HIDL_FETCH_IBootControl(const char * /* hal */) { return nullptr; } module->init(module); - return new BootControl(module); + + auto hal = new BootControl(module); + if (!hal->Init()) { + ALOGE("Failed to initialize boot control HAL"); + } + return hal; } -#endif + } // namespace implementation } // namespace V1_1 } // namespace boot |