diff options
author | Tao Bao | 2017-01-03 12:15:33 -0600 |
---|---|---|
committer | Tao Bao | 2017-01-04 00:40:03 -0600 |
commit | 736d59c56754b86135d9156208645b8b1814fba1 (patch) | |
tree | b34e26851aaea9d8958f818d32c7d0e15196fa27 /screen_ui.h | |
parent | 71633ebfb00103dd95a82cd813824dbddd9b905d (diff) | |
download | platform-bootable-recovery-736d59c56754b86135d9156208645b8b1814fba1.tar.gz platform-bootable-recovery-736d59c56754b86135d9156208645b8b1814fba1.tar.xz platform-bootable-recovery-736d59c56754b86135d9156208645b8b1814fba1.zip |
recovery: Fix the broken UI text.
UI text is broken (doesn't show any text during FDR) due to commit
d530449e54bd327e9c26209ffa0490c6508afe6c, which reordered the calls to
RecoveryUI::SetLocale() and RecoveryUI::Init().
Because Init() uses the locale info to load the localized texts (from
images), the locale must be set prior to that via SetLocale(). This CL
refactors Init() to take the locale parameter, and removes the odd
SetLocale() API.
Bug: 34029338
Test: 'Run graphics test' under recovery.
Change-Id: I620394a3d4e3705e9af5a1f6299285d143ae1b01
Diffstat (limited to 'screen_ui.h')
-rw-r--r-- | screen_ui.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/screen_ui.h b/screen_ui.h index 38e2f072..3ad64907 100644 --- a/screen_ui.h +++ b/screen_ui.h | |||
@@ -20,6 +20,8 @@ | |||
20 | #include <pthread.h> | 20 | #include <pthread.h> |
21 | #include <stdio.h> | 21 | #include <stdio.h> |
22 | 22 | ||
23 | #include <string> | ||
24 | |||
23 | #include "ui.h" | 25 | #include "ui.h" |
24 | #include "minui/minui.h" | 26 | #include "minui/minui.h" |
25 | 27 | ||
@@ -29,8 +31,7 @@ class ScreenRecoveryUI : public RecoveryUI { | |||
29 | public: | 31 | public: |
30 | ScreenRecoveryUI(); | 32 | ScreenRecoveryUI(); |
31 | 33 | ||
32 | bool Init() override; | 34 | bool Init(const std::string& locale) override; |
33 | void SetLocale(const char* locale); | ||
34 | 35 | ||
35 | // overall recovery state ("background image") | 36 | // overall recovery state ("background image") |
36 | void SetBackground(Icon icon); | 37 | void SetBackground(Icon icon); |
@@ -71,8 +72,6 @@ class ScreenRecoveryUI : public RecoveryUI { | |||
71 | protected: | 72 | protected: |
72 | Icon currentIcon; | 73 | Icon currentIcon; |
73 | 74 | ||
74 | const char* locale; | ||
75 | |||
76 | // The scale factor from dp to pixels. 1.0 for mdpi, 4.0 for xxxhdpi. | 75 | // The scale factor from dp to pixels. 1.0 for mdpi, 4.0 for xxxhdpi. |
77 | float density_; | 76 | float density_; |
78 | // The layout to use. | 77 | // The layout to use. |
@@ -135,7 +134,6 @@ class ScreenRecoveryUI : public RecoveryUI { | |||
135 | int char_width_; | 134 | int char_width_; |
136 | int char_height_; | 135 | int char_height_; |
137 | pthread_mutex_t updateMutex; | 136 | pthread_mutex_t updateMutex; |
138 | bool rtl_locale; | ||
139 | 137 | ||
140 | virtual bool InitTextParams(); | 138 | virtual bool InitTextParams(); |
141 | 139 | ||