diff options
author | Shelley Chen <shchen@chromium.org> | 2017-11-13 09:35:26 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-11-16 08:28:12 -0800 |
commit | 6014de9844835472b821d8ca61909a0ed6930dfe (patch) | |
tree | e74630b7d0cb0ed8e5a76397ad966dd7f6091bad | |
parent | 7850034a6dc8bd33413c0bedac654cbaa4e363c3 (diff) | |
download | vboot-6014de9844835472b821d8ca61909a0ed6930dfe.tar.gz |
detachables: Use Volup+Voldown to exit recovery graphicfactory-fizz-10139.B
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 <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/766847
Reviewed-by: Julius Werner <jwerner@chromium.org>
-rw-r--r-- | firmware/lib/vboot_ui_menu.c | 18 |
1 files 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': |