summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/2lib/2misc.c5
-rw-r--r--firmware/2lib/2ui.c2
-rw-r--r--firmware/2lib/2ui_screens.c2
-rw-r--r--firmware/2lib/include/2api.h8
4 files changed, 15 insertions, 2 deletions
diff --git a/firmware/2lib/2misc.c b/firmware/2lib/2misc.c
index 75a9f360..e30deb4f 100644
--- a/firmware/2lib/2misc.c
+++ b/firmware/2lib/2misc.c
@@ -459,6 +459,11 @@ uint32_t vb2api_get_locale_id(struct vb2_context *ctx)
return vb2_nv_get(ctx, VB2_NV_LOCALIZATION_INDEX);
}
+void vb2api_set_locale_id(struct vb2_context *ctx, uint32_t locale_id)
+{
+ vb2_nv_set(ctx, VB2_NV_LOCALIZATION_INDEX, locale_id);
+}
+
void vb2api_export_vbsd(struct vb2_context *ctx, void *dest)
{
struct vb2_shared_data *sd = vb2_get_sd(ctx);
diff --git a/firmware/2lib/2ui.c b/firmware/2lib/2ui.c
index 8b2ebf45..1850b8f7 100644
--- a/firmware/2lib/2ui.c
+++ b/firmware/2lib/2ui.c
@@ -308,7 +308,7 @@ static vb2_error_t ui_loop_impl(
root_info = vb2_get_screen_info(root_screen_id);
if (root_info == NULL)
VB2_DIE("Root screen not found.\n");
- ui.locale_id = vb2_nv_get(ctx, VB2_NV_LOCALIZATION_INDEX);
+ ui.locale_id = vb2api_get_locale_id(ctx);
rv = vb2_ui_screen_change(&ui, root_screen_id);
if (rv && rv != VB2_REQUEST_UI_CONTINUE)
diff --git a/firmware/2lib/2ui_screens.c b/firmware/2lib/2ui_screens.c
index a029d62b..7b48b842 100644
--- a/firmware/2lib/2ui_screens.c
+++ b/firmware/2lib/2ui_screens.c
@@ -185,7 +185,7 @@ static vb2_error_t language_select_action(struct vb2_ui_context *ui)
VB2_DEBUG("Locale changed to %u\n", ui->locale_id);
/* Write locale id back to nvdata. */
- vb2_nv_set(ui->ctx, VB2_NV_LOCALIZATION_INDEX, ui->locale_id);
+ vb2api_set_locale_id(ui->ctx, ui->locale_id);
/* Commit nvdata changes immediately, in case of three-finger salute
reboot. Ignore commit errors in recovery mode. */
diff --git a/firmware/2lib/include/2api.h b/firmware/2lib/include/2api.h
index 2ab2af3b..f59c2494 100644
--- a/firmware/2lib/include/2api.h
+++ b/firmware/2lib/include/2api.h
@@ -871,6 +871,14 @@ uint32_t vb2api_get_recovery_reason(struct vb2_context *ctx);
uint32_t vb2api_get_locale_id(struct vb2_context *ctx);
/**
+ * Set the locale id in nvdata.
+ *
+ * @param ctx Vboot context
+ * @param locale_id The locale id to be set
+ */
+void vb2api_set_locale_id(struct vb2_context *ctx, uint32_t locale_id);
+
+/**
* Whether phone recovery functionality is enabled or not.
*
* @param ctx Vboot context