summaryrefslogtreecommitdiffstats
path: root/recovery.cpp
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-12-12 05:11:42 +0100
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-12-12 05:11:42 +0100
commitabaf71d3abd12f4bceb1d525a5732f8a2b50aabf (patch)
treeb4c41b378f11d46e64248a4157f087bb87e82d1e /recovery.cpp
parentSnap for 5171533 from a96d2db281c4326a8a4017261286a6ba5cdd07e3 to qt-release (diff)
parentMerge "Show wipe data confirmation text in recovery mode" am: c456aab7e2 am: 608acc9ca2 (diff)
downloadandroid_bootable_recovery-abaf71d3abd12f4bceb1d525a5732f8a2b50aabf.tar
android_bootable_recovery-abaf71d3abd12f4bceb1d525a5732f8a2b50aabf.tar.gz
android_bootable_recovery-abaf71d3abd12f4bceb1d525a5732f8a2b50aabf.tar.bz2
android_bootable_recovery-abaf71d3abd12f4bceb1d525a5732f8a2b50aabf.tar.lz
android_bootable_recovery-abaf71d3abd12f4bceb1d525a5732f8a2b50aabf.tar.xz
android_bootable_recovery-abaf71d3abd12f4bceb1d525a5732f8a2b50aabf.tar.zst
android_bootable_recovery-abaf71d3abd12f4bceb1d525a5732f8a2b50aabf.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;