From 35926c4b89f9dc51f3e55ef03a61e4da6dcb34be Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Thu, 28 Apr 2016 18:06:26 -0700 Subject: Add ability to show "installing security update" Add a new command "--security" to boot commands. If this command is observed as part of BCB, choose a different background text picture for installing stage in recovery UI. As a result, users will see "installing security update" instead of "installing system update" when applying a security update package. Bug: 27837319 Change-Id: I2e2253a124993ecc24804fa1ee0b918ac96837c5 --- screen_ui.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'screen_ui.cpp') diff --git a/screen_ui.cpp b/screen_ui.cpp index ccff5bae5..85f789f3f 100644 --- a/screen_ui.cpp +++ b/screen_ui.cpp @@ -425,6 +425,16 @@ static char** Alloc2d(size_t rows, size_t cols) { return result; } +// Choose the right background string to display during update. +void ScreenRecoveryUI::SetSystemUpdateText(bool security_update) { + if (security_update) { + LoadLocalizedBitmap("installing_security_text", &installing_text); + } else { + LoadLocalizedBitmap("installing_text", &installing_text); + } + Redraw(); +} + void ScreenRecoveryUI::Init() { gr_init(); @@ -450,7 +460,10 @@ void ScreenRecoveryUI::Init() { LoadBitmap("stage_empty", &stageMarkerEmpty); LoadBitmap("stage_fill", &stageMarkerFill); - LoadLocalizedBitmap("installing_text", &installing_text); + // Background text for "installing_update" could be "installing update" + // or "installing security update". It will be set after UI init according + // to commands in BCB. + installing_text = nullptr; LoadLocalizedBitmap("erasing_text", &erasing_text); LoadLocalizedBitmap("no_command_text", &no_command_text); LoadLocalizedBitmap("error_text", &error_text); -- cgit v1.2.3