diff options
author | Shelley Chen <shchen@chromium.org> | 2017-07-10 10:31:20 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-08-01 13:01:42 -0700 |
commit | fc7b3972bc43da9f1b33ca8d3fd1eddf854a3635 (patch) | |
tree | b2e9674e92f1111f3d640dcbd9f52fabb76c74a4 /firmware | |
parent | 356eab1c8ea5310889e9fcaa95089cc742c8ef24 (diff) | |
download | vboot-fc7b3972bc43da9f1b33ca8d3fd1eddf854a3635.tar.gz |
detachables: Select power off after language selection
Set current selection to power off after exiting the languages menu.
Previously, we were just defaulting to selecting the 0 index. However,
this won't work anymore if we hide the "Enable Developer Mode" entry
in the recovery menu due to that entry being at the 0th index.
BUG=b:63078243, b:35585623
BRANCH=None
TEST=Boot into recovery when machine in normal mode.
Select languages menu, make language selection and make sure
that when return to recovery menu, power off item is selected.
Change-Id: I479c2270ca99197fd8c44386ab1ca4526ae7d64a
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/565527
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/lib/vboot_ui_menu.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/firmware/lib/vboot_ui_menu.c b/firmware/lib/vboot_ui_menu.c index deab020f..29c561b5 100644 --- a/firmware/lib/vboot_ui_menu.c +++ b/firmware/lib/vboot_ui_menu.c @@ -572,10 +572,29 @@ VbError_t vb2_update_menu(struct vb2_context *ctx) * because need to do in different order. */ current_menu = prev_menu; - current_menu_idx = 0; prev_menu = VB_MENU_LANGUAGES; - selected = 0; - + /* default to power off index */ + switch (current_menu) { + case VB_MENU_DEV_WARNING: + current_menu_idx = VB_WARN_POWER_OFF; + break; + case VB_MENU_DEV: + current_menu_idx = VB_DEV_POWER_OFF; + break; + case VB_MENU_TO_NORM: + current_menu_idx = VB_TO_NORM_POWER_OFF; + break; + case VB_MENU_RECOVERY: + current_menu_idx = VB_RECOVERY_POWER_OFF; + break; + case VB_MENU_TO_DEV: + current_menu_idx = VB_TO_DEV_POWER_OFF; + break; + default: + current_menu_idx = 0; + break; + } + selected = current_menu_idx; break; } default: |