summaryrefslogtreecommitdiff
path: root/firmware/lib/vboot_display.c
diff options
context:
space:
mode:
authorShelley Chen <shchen@chromium.org>2017-07-31 14:28:42 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-08-14 20:37:45 -0700
commit8c4b828502d8c6c7112286720dddfd30c92a968e (patch)
tree051cd3d48aef4bd58d8ca91862868466b2881cfd /firmware/lib/vboot_display.c
parent3f24b902e473777f59c35673f645a6e05f19977d (diff)
downloadvboot-8c4b828502d8c6c7112286720dddfd30c92a968e.tar.gz
detachables: Skip "Enable Developer Mode" in DEV mode
When DUT is already in dev mode, don't let user select the "Enable Developer Mode" selection in the menu. Add disabled_idx_mask to VbExDisplayMenu API to allow for disabling of menu items in the future if needed. BUG=b:63078243, b:35585623 BRANCH=None TEST=reboot into recovery with DUT already in dev mode. Make sure can't scroll to "Enable Developer Mode: entry. reboot into recovery with DUT in normal mode. Make sure "Enable Developer Mode" entry is selectable. CQ-DEPEND=CL:565335 Change-Id: Ic71fe6aa2e41337787a0c2278f729356edb155fd Signed-off-by: Shelley Chen <shchen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/598430 Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'firmware/lib/vboot_display.c')
-rw-r--r--firmware/lib/vboot_display.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/firmware/lib/vboot_display.c b/firmware/lib/vboot_display.c
index f3cb4d6e..24ac0725 100644
--- a/firmware/lib/vboot_display.c
+++ b/firmware/lib/vboot_display.c
@@ -23,6 +23,7 @@
static uint32_t disp_current_screen = VB_SCREEN_BLANK;
static uint32_t disp_current_index = 0;
+static uint32_t disp_disabled_idx_mask = 0;
static uint32_t disp_width = 0, disp_height = 0;
__attribute__((weak))
@@ -375,7 +376,7 @@ VbError_t VbDisplayScreen(struct vb2_context *ctx,
VbError_t VbDisplayMenu(struct vb2_context *ctx,
VbCommonParams *cparams, uint32_t screen, int force,
- uint32_t selected_index)
+ uint32_t selected_index, uint32_t disabled_idx_mask)
{
uint32_t locale;
VbError_t rv;
@@ -400,7 +401,8 @@ VbError_t VbDisplayMenu(struct vb2_context *ctx,
/* Read the locale last saved */
locale = vb2_nv_get(ctx, VB2_NV_LOCALIZATION_INDEX);
- rv = VbExDisplayMenu(screen, locale, selected_index, redraw_base_screen);
+ rv = VbExDisplayMenu(screen, locale, selected_index,
+ disabled_idx_mask, redraw_base_screen);
if (rv == VBERROR_SUCCESS) {
/*
@@ -409,6 +411,7 @@ VbError_t VbDisplayMenu(struct vb2_context *ctx,
*/
disp_current_screen = screen;
disp_current_index = selected_index;
+ disp_disabled_idx_mask = disabled_idx_mask;
}
return rv;
@@ -613,7 +616,8 @@ VbError_t VbDisplayDebugInfo(struct vb2_context *ctx, VbCommonParams *cparams)
* highlighted. On a non-detachable screen, this will be a
* no-op.
*/
- VbDisplayMenu(ctx, cparams, disp_current_screen, 1, disp_current_index);
+ VbDisplayMenu(ctx, cparams, disp_current_screen, 1,
+ disp_current_index, disp_disabled_idx_mask);
/* Add hardware ID */
VbRegionReadHWID(cparams, hwid, sizeof(hwid));