summaryrefslogtreecommitdiffstats
path: root/screen_ui.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2018-05-08 07:50:33 +0200
committerTao Bao <tbao@google.com>2018-05-08 08:50:50 +0200
commit39c4918a404a9c8119aac5086014df26c2a71664 (patch)
tree8acd67dc6ed240efc1929960e8ccae31ab1b0095 /screen_ui.cpp
parentrecovery: Get UI and locale from device. (diff)
downloadandroid_bootable_recovery-39c4918a404a9c8119aac5086014df26c2a71664.tar
android_bootable_recovery-39c4918a404a9c8119aac5086014df26c2a71664.tar.gz
android_bootable_recovery-39c4918a404a9c8119aac5086014df26c2a71664.tar.bz2
android_bootable_recovery-39c4918a404a9c8119aac5086014df26c2a71664.tar.lz
android_bootable_recovery-39c4918a404a9c8119aac5086014df26c2a71664.tar.xz
android_bootable_recovery-39c4918a404a9c8119aac5086014df26c2a71664.tar.zst
android_bootable_recovery-39c4918a404a9c8119aac5086014df26c2a71664.zip
Diffstat (limited to 'screen_ui.cpp')
-rw-r--r--screen_ui.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/screen_ui.cpp b/screen_ui.cpp
index 4a1a5b99c..90e0e30af 100644
--- a/screen_ui.cpp
+++ b/screen_ui.cpp
@@ -372,7 +372,7 @@ void ScreenRecoveryUI::SelectAndShowBackgroundText(const std::vector<std::string
std::string header = "Show background text image";
text_y += DrawTextLine(text_x, text_y, header, true);
std::string locale_selection = android::base::StringPrintf(
- "Current locale: %s, %zu/%zu", locales_entries[sel].c_str(), sel, locales_entries.size());
+ "Current locale: %s, %zu/%zu", locales_entries[sel].c_str(), sel + 1, locales_entries.size());
// clang-format off
std::vector<std::string> instruction = {
locale_selection,
@@ -395,13 +395,14 @@ void ScreenRecoveryUI::SelectAndShowBackgroundText(const std::vector<std::string
pthread_mutex_unlock(&updateMutex);
}
-void ScreenRecoveryUI::CheckBackgroundTextImages(const std::string& saved_locale) {
+void ScreenRecoveryUI::CheckBackgroundTextImages() {
// Load a list of locales embedded in one of the resource files.
std::vector<std::string> locales_entries = get_locales_in_png("installing_text");
if (locales_entries.empty()) {
Print("Failed to load locales from the resource files\n");
return;
}
+ std::string saved_locale = locale_;
size_t selected = 0;
SelectAndShowBackgroundText(locales_entries, selected);