From 6014de9844835472b821d8ca61909a0ed6930dfe Mon Sep 17 00:00:00 2001 From: Shelley Chen Date: Mon, 13 Nov 2017 09:35:26 -0800 Subject: detachables: Use Volup+Voldown to exit recovery graphic Previously, we were able to exit the initial recovery graphic with either the volume up or volume down button. However, we would only like the user to exit the screen when they know what they are doing, we are making it so that they can only intentionally exit (with volup + voldown simultaneously pressed). BUG=b:67371896 BRANCH=None TEST=reboot into recovery and press volume up + volume down keys. Make sure we exit to the recovery menu screen. Change-Id: I7dfb4a0e42c8b88e9b075e886cea1adfe248246c Signed-off-by: Shelley Chen Reviewed-on: https://chromium-review.googlesource.com/766847 Reviewed-by: Julius Werner --- firmware/lib/vboot_ui_menu.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/firmware/lib/vboot_ui_menu.c b/firmware/lib/vboot_ui_menu.c index 0b7fa627..11254cdb 100644 --- a/firmware/lib/vboot_ui_menu.c +++ b/firmware/lib/vboot_ui_menu.c @@ -218,7 +218,7 @@ static char *languages_menu[] = { * @param size: Size of menu's string array. * @return VBERROR_SUCCESS, or non-zero error code if error. */ -VbError_t vb2_get_current_menu_size(VB_MENU menu, char ***menu_array, +void vb2_get_current_menu_size(VB_MENU menu, char ***menu_array, uint32_t *size) { char **temp_menu; @@ -250,12 +250,9 @@ VbError_t vb2_get_current_menu_size(VB_MENU menu, char ***menu_array, break; default: *size = 0; - return VBERROR_UNKNOWN; } if (menu_array) *menu_array = temp_menu; - - return VBERROR_SUCCESS; } /** @@ -1074,15 +1071,22 @@ static VbError_t recovery_ui(struct vb2_context *ctx, VbCommonParams *cparams) break; } + vb2_update_selection(cparams, key); + vb2_draw_current_screen(ctx, cparams); + break; + case VB_BUTTON_VOL_UP_DOWN_COMBO_PRESS: + /* + * This is currently only being used to + * transition out of the initial insert + * graphic + */ if (current_menu == VB_MENU_RECOVERY_INSERT) { ret = vb2_update_menu(ctx); if (ret != VBERROR_SUCCESS) return ret; vb2_set_disabled_idx_mask(shared->flags); - } else { - vb2_update_selection(cparams, key); + vb2_draw_current_screen(ctx, cparams); } - vb2_draw_current_screen(ctx, cparams); break; case VB_BUTTON_POWER_SHORT_PRESS: case '\r': -- cgit v1.2.1