diff options
author | Sen Jiang <senj@google.com> | 2016-12-14 22:50:49 +0100 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-12-14 22:50:49 +0100 |
commit | 8c1584feaf72c088928104ca5d4da18cba31a7cc (patch) | |
tree | eb2f2cab3101dbdba307df52910ee9d0fb8bbdf4 /wear_ui.cpp | |
parent | Merge "updater: Fix the operator order." (diff) | |
parent | Add a stub recovery UI. (diff) | |
download | android_bootable_recovery-8c1584feaf72c088928104ca5d4da18cba31a7cc.tar android_bootable_recovery-8c1584feaf72c088928104ca5d4da18cba31a7cc.tar.gz android_bootable_recovery-8c1584feaf72c088928104ca5d4da18cba31a7cc.tar.bz2 android_bootable_recovery-8c1584feaf72c088928104ca5d4da18cba31a7cc.tar.lz android_bootable_recovery-8c1584feaf72c088928104ca5d4da18cba31a7cc.tar.xz android_bootable_recovery-8c1584feaf72c088928104ca5d4da18cba31a7cc.tar.zst android_bootable_recovery-8c1584feaf72c088928104ca5d4da18cba31a7cc.zip |
Diffstat (limited to '')
-rw-r--r-- | wear_ui.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/wear_ui.cpp b/wear_ui.cpp index 0918ac457..11e5a7168 100644 --- a/wear_ui.cpp +++ b/wear_ui.cpp @@ -190,8 +190,10 @@ void WearRecoveryUI::update_progress_locked() { gr_flip(); } -void WearRecoveryUI::InitTextParams() { - ScreenRecoveryUI::InitTextParams(); +bool WearRecoveryUI::InitTextParams() { + if (!ScreenRecoveryUI::InitTextParams()) { + return false; + } text_cols_ = (gr_fb_width() - (outer_width * 2)) / char_width_; @@ -199,15 +201,19 @@ void WearRecoveryUI::InitTextParams() { if (text_cols_ > kMaxCols) text_cols_ = kMaxCols; visible_text_rows = (gr_fb_height() - (outer_height * 2)) / char_height_; + return true; } -void WearRecoveryUI::Init() { - ScreenRecoveryUI::Init(); +bool WearRecoveryUI::Init() { + if (!ScreenRecoveryUI::Init()) { + return false; + } LoadBitmap("icon_installing", &backgroundIcon[INSTALLING_UPDATE]); backgroundIcon[ERASING] = backgroundIcon[INSTALLING_UPDATE]; LoadBitmap("icon_error", &backgroundIcon[ERROR]); backgroundIcon[NO_COMMAND] = backgroundIcon[ERROR]; + return true; } void WearRecoveryUI::SetStage(int current, int max) |