diff options
author | David Anderson <dvander@google.com> | 2019-10-30 13:07:33 -0700 |
---|---|---|
committer | David Anderson <dvander@google.com> | 2019-11-10 17:17:45 -0800 |
commit | 953ea5dac0ca5aa3986bea47c157554cb2f96bd5 (patch) | |
tree | 13c081aba88c64517dec7fc03f3d4922688a08ce /bootctrl/LegacyBootControl.cpp | |
parent | 82f2f39a0d0b718c2975ef886f9a8d48470034e1 (diff) |
bootctrl: Fix vendor space usage to not conflict with theme data.
Pixel writes theme data to the first bytes of vendor space, and reserves
the first 32x32 bytes for other such flags (such as the SOTA flag). To
avoid conflicts, instead use new AOSP-generic methods in
bootloader_message and libboot_control.
Bug: 139156011
Test: manual test
Change-Id: I7f31847acc21a0eeb46640cb9ed70be2a3f9531c
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 |