From 736d59c56754b86135d9156208645b8b1814fba1 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Tue, 3 Jan 2017 10:15:33 -0800 Subject: 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 --- recovery.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'recovery.cpp') diff --git a/recovery.cpp b/recovery.cpp index b7aeaee1f..5888c542a 100644 --- a/recovery.cpp +++ b/recovery.cpp @@ -1506,11 +1506,10 @@ int main(int argc, char **argv) { Device* device = make_device(); ui = device->GetUI(); - if (!ui->Init()) { + if (!ui->Init(locale)) { printf("Failed to initialize UI, use stub UI instead."); ui = new StubRecoveryUI(); } - ui->SetLocale(locale.c_str()); // Set background string to "installing security update" for security update, // otherwise set it to "installing system update". ui->SetSystemUpdateText(security_update); -- cgit v1.2.3