vboot: Hide language selection bar during EC software sync
authorDaisuke Nojiri <dnojiri@chromium.org>
Tue, 9 Aug 2016 20:52:09 +0000 (13:52 -0700)
committerchrome-bot <chrome-bot@chromium.org>
Wed, 10 Aug 2016 02:40:35 +0000 (19:40 -0700)
Language selection is not possible during EC software sync because keyboard
is disabled. This change hides the language selection bar from the screen
displayed while EC software sync is taking place.

BUG=chrome-os-partner:56037
BRANCH=none
TEST=Verified on Jerry with hacked vboot_reference (VBSD_EC_SLOW_UPDATE=1)

Change-Id: I4db74a268f41c12a88b4f8c85832ec60217a0bf3
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/367312
Reviewed-by: Julius Werner <jwerner@chromium.org>
src/vboot/screens.c

index e410887..cfbe8b8 100644 (file)
@@ -452,7 +452,7 @@ static VbError_t vboot_draw_language(uint32_t locale)
        return VBERROR_SUCCESS;
 }
 
-static VbError_t vboot_draw_base_screen(uint32_t locale)
+static VbError_t draw_base_screen(uint32_t locale, int show_language)
 {
        const struct rgb_color white = { 0xff, 0xff, 0xff };
 
@@ -465,7 +465,8 @@ static VbError_t vboot_draw_base_screen(uint32_t locale)
                        VB_SIZE_AUTO, VB_TEXT_HEIGHT,
                        PIVOT_H_LEFT|PIVOT_V_BOTTOM));
 
-       RETURN_ON_ERROR(vboot_draw_language(locale));
+       if (show_language)
+               RETURN_ON_ERROR(vboot_draw_language(locale));
 
        RETURN_ON_ERROR(draw_image("divider_top.bmp",
                        VB_SCALE_HALF, VB_DIVIDER_V_OFFSET,
@@ -481,6 +482,16 @@ static VbError_t vboot_draw_base_screen(uint32_t locale)
        return VBERROR_SUCCESS;
 }
 
+static VbError_t vboot_draw_base_screen(uint32_t locale)
+{
+       return draw_base_screen(locale, 1);
+}
+
+static VbError_t vboot_draw_base_screen_without_language(uint32_t locale)
+{
+       return draw_base_screen(locale, 0);
+}
+
 static VbError_t vboot_draw_blank(uint32_t locale)
 {
        video_console_clear();
@@ -571,7 +582,11 @@ static VbError_t vboot_draw_developer_to_norm(uint32_t locale)
 
 static VbError_t vboot_draw_wait(uint32_t locale)
 {
-       RETURN_ON_ERROR(vboot_draw_base_screen(locale));
+       /*
+        * Currently, language cannot be changed while EC software sync is
+        * taking place because keyboard is disabled.
+        */
+       RETURN_ON_ERROR(vboot_draw_base_screen_without_language(locale));
        RETURN_ON_ERROR(draw_image_locale("update.bmp", locale,
                        VB_SCALE_HALF, VB_SCALE_HALF,
                        VB_SIZE_AUTO, VB_TEXT_HEIGHT * 3,