lib/vboot_ui_menu: Consider volume buttons in vb2_update_selection

vb2_update_selection considered only KEY_UP and KEY_DOWN inputs to
update the selection. This resulted in volume buttons not working on
firmware screen to update the selection. Add volume buttons as valid
inputs in vb2_update_selection.

BUG=b:64839396
BRANCH=None
TEST=Verified that volume buttons work on firmware screen.

Change-Id: I08bfa91eafb170fb450649a2abaafe7f4d58e17b
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/621787
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Shelley Chen <shchen@chromium.org>
This commit is contained in:
Furquan Shaikh
2017-08-18 11:36:58 -07:00
committed by chrome-bot
parent 8c4b828502
commit 8610346356

View File

@@ -662,6 +662,7 @@ void vb2_update_selection(VbCommonParams *cparams, uint32_t key) {
} }
switch (key) { switch (key) {
case VB_BUTTON_VOL_UP:
case VB_KEY_UP: case VB_KEY_UP:
idx = current_menu_idx - 1; idx = current_menu_idx - 1;
while (idx >= 0 && while (idx >= 0 &&
@@ -671,6 +672,7 @@ void vb2_update_selection(VbCommonParams *cparams, uint32_t key) {
if (idx >= 0) if (idx >= 0)
current_menu_idx = idx; current_menu_idx = idx;
break; break;
case VB_BUTTON_VOL_DOWN:
case VB_KEY_DOWN: case VB_KEY_DOWN:
idx = current_menu_idx + 1; idx = current_menu_idx + 1;
while (idx < menu_size && while (idx < menu_size &&