Merge "screen_ui: Move the call to gr_init() into Init()." am: 4264ee890e
am: 2a3c46a068

Change-Id: I862f4d9f90154ac626125ceae49c6bb233b0af03
diff --git a/screen_ui.cpp b/screen_ui.cpp
index e8444b6..f9c4a06 100644
--- a/screen_ui.cpp
+++ b/screen_ui.cpp
@@ -702,10 +702,10 @@
 }
 
 bool ScreenRecoveryUI::InitTextParams() {
-  if (gr_init() < 0) {
+  // gr_init() would return successfully on font initialization failure.
+  if (gr_sys_font() == nullptr) {
     return false;
   }
-
   gr_font_size(gr_sys_font(), &char_width_, &char_height_);
   text_rows_ = (ScreenHeight() - kMarginHeight * 2) / char_height_;
   text_cols_ = (ScreenWidth() - kMarginWidth * 2) / char_width_;
@@ -715,6 +715,10 @@
 bool ScreenRecoveryUI::Init(const std::string& locale) {
   RecoveryUI::Init(locale);
 
+  if (gr_init() == -1) {
+    return false;
+  }
+
   if (!InitTextParams()) {
     return false;
   }