summaryrefslogtreecommitdiffstats
path: root/screen_ui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'screen_ui.cpp')
-rw-r--r--screen_ui.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/screen_ui.cpp b/screen_ui.cpp
index 7ae81e55f..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);
@@ -748,6 +749,10 @@ bool ScreenRecoveryUI::Init(const std::string& locale) {
return true;
}
+std::string ScreenRecoveryUI::GetLocale() {
+ return locale_;
+}
+
void ScreenRecoveryUI::LoadAnimation() {
std::unique_ptr<DIR, decltype(&closedir)> dir(opendir("/res/images"), closedir);
dirent* de;