From 205a3a1bc8f8a51c08889d4bf17d27a731822942 Mon Sep 17 00:00:00 2001 From: Joel Kitching Date: Tue, 5 May 2020 10:45:29 +0800 Subject: vboot/ui: move locale_id from screen_state into ui_context locale_id is not tied to the current screen -- i.e. it shouldn't revert if we return to the previous screen. BUG=b:146399181 TEST=make clean && make runtests BRANCH=none Change-Id: I691bdf7938d2a14cfbe68c7f60dc0103c236733c Signed-off-by: Joel Kitching Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2182083 Tested-by: Hsuan Ting Chen Tested-by: Joel Kitching Reviewed-by: Joel Kitching Commit-Queue: Joel Kitching --- firmware/2lib/2ui.c | 6 +----- firmware/2lib/include/2ui.h | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'firmware') diff --git a/firmware/2lib/2ui.c b/firmware/2lib/2ui.c index 10f51d6a..8eea9afb 100644 --- a/firmware/2lib/2ui.c +++ b/firmware/2lib/2ui.c @@ -184,14 +184,11 @@ vb2_error_t (*input_action_lookup(int key))(struct vb2_ui_context *ui) void change_screen(struct vb2_ui_context *ui, enum vb2_screen id) { const struct vb2_screen_info *new_screen_info = vb2_get_screen_info(id); - int locale_id; if (new_screen_info == NULL) { VB2_DEBUG("ERROR: Screen entry %#x not found; ignoring\n", id); } else { - locale_id = ui->state.locale_id; memset(&ui->state, 0, sizeof(ui->state)); ui->state.screen = new_screen_info; - ui->state.locale_id = locale_id; } } @@ -242,8 +239,7 @@ vb2_error_t ui_loop(struct vb2_context *ctx, enum vb2_screen root_screen_id, ui.state.screen->items[ ui.state.selected_item].text : "null"); - /* TODO: Stop hard-coding the locale. */ - vb2ex_display_ui(ui.state.screen->id, 0, + vb2ex_display_ui(ui.state.screen->id, ui.locale_id, ui.state.selected_item, ui.state.disabled_item_mask); } diff --git a/firmware/2lib/include/2ui.h b/firmware/2lib/include/2ui.h index f179024f..c0e2b634 100644 --- a/firmware/2lib/include/2ui.h +++ b/firmware/2lib/include/2ui.h @@ -34,7 +34,6 @@ struct vb2_menu_item { struct vb2_screen_state { const struct vb2_screen_info *screen; - uint32_t locale_id; uint32_t selected_item; uint32_t disabled_item_mask; }; @@ -43,6 +42,7 @@ struct vb2_ui_context { struct vb2_context *ctx; const struct vb2_screen_info *root_screen; struct vb2_screen_state state; + uint32_t locale_id; uint32_t key; }; -- cgit v1.2.1