diff options
author | Tianjie Xu <xunchang@google.com> | 2018-12-12 01:08:25 +0100 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-12-12 01:08:25 +0100 |
commit | 9d59cecdf99250565a7e68eb81ac2a6dbc7eacd3 (patch) | |
tree | b4c41b378f11d46e64248a4157f087bb87e82d1e /recovery.cpp | |
parent | [automerger skipped] Import translations. DO NOT MERGE (diff) | |
parent | Merge "Show wipe data confirmation text in recovery mode" (diff) | |
download | android_bootable_recovery-9d59cecdf99250565a7e68eb81ac2a6dbc7eacd3.tar android_bootable_recovery-9d59cecdf99250565a7e68eb81ac2a6dbc7eacd3.tar.gz android_bootable_recovery-9d59cecdf99250565a7e68eb81ac2a6dbc7eacd3.tar.bz2 android_bootable_recovery-9d59cecdf99250565a7e68eb81ac2a6dbc7eacd3.tar.lz android_bootable_recovery-9d59cecdf99250565a7e68eb81ac2a6dbc7eacd3.tar.xz android_bootable_recovery-9d59cecdf99250565a7e68eb81ac2a6dbc7eacd3.tar.zst android_bootable_recovery-9d59cecdf99250565a7e68eb81ac2a6dbc7eacd3.zip |
Diffstat (limited to 'recovery.cpp')
-rw-r--r-- | recovery.cpp | 10 |
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; |