summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2020-05-05 10:45:29 +0800
committerCommit Bot <commit-bot@chromium.org>2020-05-05 10:50:20 +0000
commit205a3a1bc8f8a51c08889d4bf17d27a731822942 (patch)
tree47b860aa2f120b4f407154a129a64ebd94a069a1 /firmware
parentd72dd12f1dfc5d6682a59b19abc70d479a8b9275 (diff)
downloadvboot-205a3a1bc8f8a51c08889d4bf17d27a731822942.tar.gz
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 <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2182083 Tested-by: Hsuan Ting Chen <roccochen@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
Diffstat (limited to 'firmware')
-rw-r--r--firmware/2lib/2ui.c6
-rw-r--r--firmware/2lib/include/2ui.h2
2 files changed, 2 insertions, 6 deletions
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;
};