summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-prod (mdb) <android-build-team-robot@google.com>2018-05-08 20:21:43 +0200
committerandroid-build-merger <android-build-merger@google.com>2018-05-08 20:21:43 +0200
commit730d541588dc882e01e72d4d92904a8b705a2118 (patch)
tree8acd67dc6ed240efc1929960e8ccae31ab1b0095
parentMerge "recovery: Get UI and locale from device." (diff)
parentMerge "screen_ui: Drop the parameter in CheckBackgroundTextImages." (diff)
downloadandroid_bootable_recovery-730d541588dc882e01e72d4d92904a8b705a2118.tar
android_bootable_recovery-730d541588dc882e01e72d4d92904a8b705a2118.tar.gz
android_bootable_recovery-730d541588dc882e01e72d4d92904a8b705a2118.tar.bz2
android_bootable_recovery-730d541588dc882e01e72d4d92904a8b705a2118.tar.lz
android_bootable_recovery-730d541588dc882e01e72d4d92904a8b705a2118.tar.xz
android_bootable_recovery-730d541588dc882e01e72d4d92904a8b705a2118.tar.zst
android_bootable_recovery-730d541588dc882e01e72d4d92904a8b705a2118.zip
-rw-r--r--recovery.cpp2
-rw-r--r--screen_ui.cpp5
-rw-r--r--screen_ui.h6
3 files changed, 7 insertions, 6 deletions
diff --git a/recovery.cpp b/recovery.cpp
index 01dce0780..6aceb2d61 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -897,7 +897,7 @@ static Device::BuiltinAction prompt_and_wait(Device* device, int status) {
case Device::RUN_LOCALE_TEST: {
ScreenRecoveryUI* screen_ui = static_cast<ScreenRecoveryUI*>(ui);
- screen_ui->CheckBackgroundTextImages(screen_ui->GetLocale());
+ screen_ui->CheckBackgroundTextImages();
break;
}
case Device::MOUNT_SYSTEM:
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);
diff --git a/screen_ui.h b/screen_ui.h
index 3e391beba..d4923f566 100644
--- a/screen_ui.h
+++ b/screen_ui.h
@@ -148,9 +148,9 @@ class ScreenRecoveryUI : public RecoveryUI {
void SetColor(UIElement e) const;
- // Check the background text image. Use volume up/down button to cycle through the locales
- // embedded in the png file, and power button to go back to recovery main menu.
- void CheckBackgroundTextImages(const std::string& saved_locale);
+ // Checks the background text image, for debugging purpose. It iterates the locales embedded in
+ // the on-device resource files and shows the localized text, for manual inspection.
+ void CheckBackgroundTextImages();
protected:
// The margin that we don't want to use for showing texts (e.g. round screen, or screen with