From 8e0c3e5ad54c3c8442cfec9fe0a3256d16f52892 Mon Sep 17 00:00:00 2001 From: Shelley Chen Date: Thu, 31 Aug 2017 14:10:12 -0700 Subject: detachables: Power button turns off device on RECOVERY_INSERT screen BUG=b:64400325 BRANCH=None TEST=boot up into recovery, press power button ensure device shuts down. Change-Id: Ia8e6e91921e81692a2e57b1f77163c656b56ea85 Signed-off-by: Shelley Chen Reviewed-on: https://chromium-review.googlesource.com/646488 Reviewed-by: Julius Werner --- firmware/lib/vboot_ui_menu.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/firmware/lib/vboot_ui_menu.c b/firmware/lib/vboot_ui_menu.c index 3bda0c01..89865eeb 100644 --- a/firmware/lib/vboot_ui_menu.c +++ b/firmware/lib/vboot_ui_menu.c @@ -1122,16 +1122,6 @@ VbError_t vb2_recovery_menu(struct vb2_context *ctx, VbCommonParams *cparams) case '\r': selected = 1; - /* - * Need to update locale before updating the - * menu or we'll lose the previous state - */ - vb2_update_locale(ctx); - - ret = vb2_update_menu(ctx); - - vb2_set_disabled_idx_mask(shared->flags); - /* * If user hits power button in * initial recovery screen (ie: @@ -1141,9 +1131,19 @@ VbError_t vb2_recovery_menu(struct vb2_context *ctx, VbCommonParams *cparams) */ if (current_menu == VB_MENU_RECOVERY_INSERT) { ret = VBERROR_SHUTDOWN_REQUESTED; - } + } else { + /* + * Need to update locale + * before updating the menu or + * we'll lose the previous state + */ + vb2_update_locale(ctx); + ret = vb2_update_menu(ctx); + vb2_set_disabled_idx_mask(shared-> + flags); + } if (current_menu != VB_MENU_RECOVERY || current_menu_idx != VB_RECOVERY_DBG_INFO) { /* -- cgit v1.2.1