diff options
author | David Anderson <dvander@google.com> | 2019-11-09 16:04:52 +0100 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-11-09 16:04:52 +0100 |
commit | 405f4d3552803077fab8e5b184f1da475efef90c (patch) | |
tree | 3ffdee4d6d56e0b6c5681413927e34a42f6d7e21 /boot_control/include/libboot_control/libboot_control.h | |
parent | Merge "Stop setting usb config from recovery init script" (diff) | |
parent | bootloader_message: Add helpers for handling IBootControl MergeStatus. (diff) | |
download | android_bootable_recovery-405f4d3552803077fab8e5b184f1da475efef90c.tar android_bootable_recovery-405f4d3552803077fab8e5b184f1da475efef90c.tar.gz android_bootable_recovery-405f4d3552803077fab8e5b184f1da475efef90c.tar.bz2 android_bootable_recovery-405f4d3552803077fab8e5b184f1da475efef90c.tar.lz android_bootable_recovery-405f4d3552803077fab8e5b184f1da475efef90c.tar.xz android_bootable_recovery-405f4d3552803077fab8e5b184f1da475efef90c.tar.zst android_bootable_recovery-405f4d3552803077fab8e5b184f1da475efef90c.zip |
Diffstat (limited to '')
-rw-r--r-- | boot_control/include/libboot_control/libboot_control.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/boot_control/include/libboot_control/libboot_control.h b/boot_control/include/libboot_control/libboot_control.h index 34a9affe1..546865887 100644 --- a/boot_control/include/libboot_control/libboot_control.h +++ b/boot_control/include/libboot_control/libboot_control.h @@ -62,5 +62,28 @@ class BootControl { unsigned int current_slot_ = 0; }; +// Helper functions to write the Virtual A/B merge status message. These are +// separate because BootControl uses bootloader_control_ab in vendor space, +// whereas the Virtual A/B merge status is in system space. A HAL might not +// use bootloader_control_ab, but may want to use the AOSP method of maintaining +// the merge status. + +// If the Virtual A/B message has not yet been initialized, then initialize it. +// This should be called when the BootControl HAL first loads. +// +// If the Virtual A/B message in misc was already initialized, true is returned. +// If initialization was attempted, but failed, false is returned, and the HAL +// should fail to load. +bool InitMiscVirtualAbMessageIfNeeded(); + +// Save the current merge status as well as the current slot. +bool SetMiscVirtualAbMergeStatus(unsigned int current_slot, + android::hardware::boot::V1_1::MergeStatus status); + +// Return the current merge status. If the saved status is SNAPSHOTTED but the +// slot hasn't changed, the status returned will be NONE. +bool GetMiscVirtualAbMergeStatus(unsigned int current_slot, + android::hardware::boot::V1_1::MergeStatus* status); + } // namespace bootable } // namespace android |