summaryrefslogtreecommitdiffstats
path: root/recovery.cpp
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2018-10-26 00:22:07 +0200
committerTianjie Xu <xunchang@google.com>2018-12-12 00:23:41 +0100
commit1a0a30a16a8071c59e265f52de60dedc54d31bd9 (patch)
treeb4c41b378f11d46e64248a4157f087bb87e82d1e /recovery.cpp
parentMerge "tests: Temporarily disable ScreenRecoveryUITest tests." (diff)
downloadandroid_bootable_recovery-1a0a30a16a8071c59e265f52de60dedc54d31bd9.tar
android_bootable_recovery-1a0a30a16a8071c59e265f52de60dedc54d31bd9.tar.gz
android_bootable_recovery-1a0a30a16a8071c59e265f52de60dedc54d31bd9.tar.bz2
android_bootable_recovery-1a0a30a16a8071c59e265f52de60dedc54d31bd9.tar.lz
android_bootable_recovery-1a0a30a16a8071c59e265f52de60dedc54d31bd9.tar.xz
android_bootable_recovery-1a0a30a16a8071c59e265f52de60dedc54d31bd9.tar.zst
android_bootable_recovery-1a0a30a16a8071c59e265f52de60dedc54d31bd9.zip
Diffstat (limited to 'recovery.cpp')
-rw-r--r--recovery.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/recovery.cpp b/recovery.cpp
index 7e1fa43a6..de916c633 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -369,7 +369,14 @@ static bool yes_no(Device* device, const char* question1, const char* question2)
}
static bool ask_to_wipe_data(Device* device) {
- return yes_no(device, "Wipe all user data?", " THIS CAN NOT BE UNDONE!");
+ std::vector<std::string> headers{ "Wipe all user data?", " THIS CAN NOT BE UNDONE!" };
+ std::vector<std::string> items{ " Cancel", " Factory data reset" };
+
+ size_t chosen_item = ui->ShowPromptWipeDataConfirmationMenu(
+ headers, items,
+ std::bind(&Device::HandleMenuKey, device, std::placeholders::_1, std::placeholders::_2));
+
+ return (chosen_item == 1);
}
// Return true on success.
@@ -420,7 +427,6 @@ static InstallResult prompt_and_wipe_data(Device* device) {
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;