summaryrefslogtreecommitdiffstats
path: root/screen_ui.cpp
diff options
context:
space:
mode:
authorSen Jiang <senj@google.com>2016-12-14 23:40:46 +0100
committerandroid-build-merger <android-build-merger@google.com>2016-12-14 23:40:46 +0100
commit8c179f8bd4bea6fad3e2cb78cfbbbcc7cdd8e012 (patch)
tree772d13e0103a1b868fbb4c22e3e664eeb6b55430 /screen_ui.cpp
parentMerge "updater: Fix the operator order." am: 2bb3a2270e am: f7f3f821a8 am: e97575e7ae (diff)
parentMerge "Add a stub recovery UI." am: 8c1584feaf am: 2f8f6ec0fc (diff)
downloadandroid_bootable_recovery-8c179f8bd4bea6fad3e2cb78cfbbbcc7cdd8e012.tar
android_bootable_recovery-8c179f8bd4bea6fad3e2cb78cfbbbcc7cdd8e012.tar.gz
android_bootable_recovery-8c179f8bd4bea6fad3e2cb78cfbbbcc7cdd8e012.tar.bz2
android_bootable_recovery-8c179f8bd4bea6fad3e2cb78cfbbbcc7cdd8e012.tar.lz
android_bootable_recovery-8c179f8bd4bea6fad3e2cb78cfbbbcc7cdd8e012.tar.xz
android_bootable_recovery-8c179f8bd4bea6fad3e2cb78cfbbbcc7cdd8e012.tar.zst
android_bootable_recovery-8c179f8bd4bea6fad3e2cb78cfbbbcc7cdd8e012.zip
Diffstat (limited to 'screen_ui.cpp')
-rw-r--r--screen_ui.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/screen_ui.cpp b/screen_ui.cpp
index a7b03c50d..5b9e5a5a9 100644
--- a/screen_ui.cpp
+++ b/screen_ui.cpp
@@ -448,17 +448,22 @@ void ScreenRecoveryUI::SetSystemUpdateText(bool security_update) {
Redraw();
}
-void ScreenRecoveryUI::InitTextParams() {
- gr_init();
+bool ScreenRecoveryUI::InitTextParams() {
+ if (gr_init() < 0) {
+ return false;
+ }
gr_font_size(gr_sys_font(), &char_width_, &char_height_);
text_rows_ = gr_fb_height() / char_height_;
text_cols_ = gr_fb_width() / char_width_;
+ return true;
}
-void ScreenRecoveryUI::Init() {
+bool ScreenRecoveryUI::Init() {
RecoveryUI::Init();
- InitTextParams();
+ if (!InitTextParams()) {
+ return false;
+ }
density_ = static_cast<float>(android::base::GetIntProperty("ro.sf.lcd_density", 160)) / 160.f;
@@ -493,6 +498,8 @@ void ScreenRecoveryUI::Init() {
LoadAnimation();
pthread_create(&progress_thread_, nullptr, ProgressThreadStartRoutine, this);
+
+ return true;
}
void ScreenRecoveryUI::LoadAnimation() {