summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShelley Chen <shchen@google.com>2020-07-06 11:15:18 -0700
committerCommit Bot <commit-bot@chromium.org>2020-07-10 06:26:16 +0000
commita3815e035f442473300951dc0ea93c3f01297659 (patch)
treea908fec16d9f05901c08319d570ffdd541bc2418
parent1a2ddae3d9782cbf0f0a1ab27ae3820c90abec54 (diff)
downloadvboot-a3815e035f442473300951dc0ea93c3f01297659.tar.gz
firmware/2lib: Skip rest of ui_loop after closing error box
Previously, if we see an error box displayed on the screen, and we hit return, not only will we exit the error box, but we will also process the key (ie: return) on the background screen and advance to another screen. Correcting this by setting key to 0, thus skipping all the actions on the background screen in ui_loop() after exiting the error box. BUG=b:144969091 BRANCH=puff TEST=dut-control power_state:rec press ctrl-d press return make sure we exit the error box only and don't advanced to the next screen Signed-off-by: Shelley Chen <shchen@google.com> Change-Id: I64f67bb175b4a67a885b368334fb19f4cf288883 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2278925 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Tested-by: Shelley Chen <shchen@chromium.org> Commit-Queue: Shelley Chen <shchen@chromium.org>
-rw-r--r--firmware/2lib/2ui.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/firmware/2lib/2ui.c b/firmware/2lib/2ui.c
index 91478623..23b7b0dd 100644
--- a/firmware/2lib/2ui.c
+++ b/firmware/2lib/2ui.c
@@ -77,11 +77,14 @@ vb2_error_t check_shutdown_request(struct vb2_ui_context *ui)
vb2_error_t error_exit_action(struct vb2_ui_context *ui)
{
/*
- * If the only difference is the error message, then just
- * redraw the screen without the error string.
+ * If an error message is currently shown on the screen, any
+ * key press clears that error. Unset the key so that it is
+ * not processed by other action functions.
*/
- if (ui->key && ui->error_code != VB2_UI_ERROR_NONE)
+ if (ui->key && ui->error_code != VB2_UI_ERROR_NONE) {
ui->error_code = VB2_UI_ERROR_NONE;
+ ui->key = 0;
+ }
return VB2_REQUEST_UI_CONTINUE;
}