summaryrefslogtreecommitdiffstats
path: root/recovery.cpp
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2018-10-23 20:16:23 +0200
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-10-23 20:16:23 +0200
commit06ccd00ef5bfa36f8f0d508df77f747aa099eabf (patch)
treee68e20918057d4c1f88189edb49bcabad066535c /recovery.cpp
parentMerge "minui: Move GRSurface into a class." (diff)
parentAdd function to show localized rescue party menu (diff)
downloadandroid_bootable_recovery-06ccd00ef5bfa36f8f0d508df77f747aa099eabf.tar
android_bootable_recovery-06ccd00ef5bfa36f8f0d508df77f747aa099eabf.tar.gz
android_bootable_recovery-06ccd00ef5bfa36f8f0d508df77f747aa099eabf.tar.bz2
android_bootable_recovery-06ccd00ef5bfa36f8f0d508df77f747aa099eabf.tar.lz
android_bootable_recovery-06ccd00ef5bfa36f8f0d508df77f747aa099eabf.tar.xz
android_bootable_recovery-06ccd00ef5bfa36f8f0d508df77f747aa099eabf.tar.zst
android_bootable_recovery-06ccd00ef5bfa36f8f0d508df77f747aa099eabf.zip
Diffstat (limited to '')
-rw-r--r--recovery.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/recovery.cpp b/recovery.cpp
index 3ea282fc0..d7bc6fd2f 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -397,23 +397,22 @@ static bool wipe_data(Device* device) {
static InstallResult prompt_and_wipe_data(Device* device) {
// Use a single string and let ScreenRecoveryUI handles the wrapping.
- std::vector<std::string> headers{
+ std::vector<std::string> wipe_data_menu_headers{
"Can't load Android system. Your data may be corrupt. "
"If you continue to get this message, you may need to "
"perform a factory data reset and erase all user data "
"stored on this device.",
};
// clang-format off
- std::vector<std::string> items {
+ std::vector<std::string> wipe_data_menu_items {
"Try again",
"Factory data reset",
};
// clang-format on
for (;;) {
- size_t chosen_item = ui->ShowMenu(
- headers, items, 0, true,
+ size_t chosen_item = ui->ShowPromptWipeDataMenu(
+ wipe_data_menu_headers, wipe_data_menu_items,
std::bind(&Device::HandleMenuKey, device, std::placeholders::_1, std::placeholders::_2));
-
// If ShowMenu() returned RecoveryUI::KeyError::INTERRUPTED, WaitKey() was interrupted.
if (chosen_item == static_cast<size_t>(RecoveryUI::KeyError::INTERRUPTED)) {
return INSTALL_KEY_INTERRUPTED;
@@ -421,6 +420,8 @@ static InstallResult prompt_and_wipe_data(Device* device) {
if (chosen_item != 1) {
return INSTALL_SUCCESS; // Just reboot, no wipe; not a failure, user asked for it
}
+
+ // TODO(xunchang) localize the confirmation texts also.
if (ask_to_wipe_data(device)) {
if (wipe_data(device)) {
return INSTALL_SUCCESS;