aboutsummaryrefslogtreecommitdiffstats
path: root/recovery.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'recovery.cpp')
-rw-r--r--recovery.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/recovery.cpp b/recovery.cpp
index 5c9f43f..3ecd5db 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -1025,8 +1025,6 @@ refresh:
return status;
}
-int ui_root_menu = 0;
-
// Return REBOOT, SHUTDOWN, or REBOOT_BOOTLOADER. Returning NO_ACTION
// means to take the default, which is to reboot or shutdown depending
// on if the --shutdown_after flag was passed to recovery.
@@ -1034,7 +1032,6 @@ static Device::BuiltinAction
prompt_and_wait(Device* device, int status) {
for (;;) {
finish_recovery(NULL);
- ui_root_menu = 1;
switch (status) {
case INSTALL_SUCCESS:
case INSTALL_NONE:
@@ -1049,7 +1046,6 @@ prompt_and_wait(Device* device, int status) {
ui->SetProgressType(RecoveryUI::EMPTY);
int chosen_item = get_menu_selection(nullptr, device->GetMenuItems(), 0, 0, device);
- ui_root_menu = 0;
// device-specific code may take some action here. It may
// return one of the core actions handled in the switch
@@ -1064,6 +1060,7 @@ prompt_and_wait(Device* device, int status) {
case Device::REBOOT:
case Device::SHUTDOWN:
+ case Device::REBOOT_RECOVERY:
case Device::REBOOT_BOOTLOADER:
return chosen_action;
@@ -1072,13 +1069,13 @@ prompt_and_wait(Device* device, int status) {
if (!ui->IsTextVisible()) return Device::NO_ACTION;
break;
- case Device::WIPE_CACHE:
- wipe_cache(ui->IsTextVisible(), device);
+ case Device::WIPE_FULL:
+ wipe_data(ui->IsTextVisible(), device, true);
if (!ui->IsTextVisible()) return Device::NO_ACTION;
break;
- case Device::WIPE_MEDIA:
- wipe_media(ui->IsTextVisible(), device);
+ case Device::WIPE_CACHE:
+ wipe_cache(ui->IsTextVisible(), device);
if (!ui->IsTextVisible()) return Device::NO_ACTION;
break;
@@ -1516,6 +1513,11 @@ main(int argc, char **argv) {
property_set(ANDROID_RB_PROPERTY, "shutdown,");
break;
+ case Device::REBOOT_RECOVERY:
+ ui->Print("Rebooting recovery...\n");
+ property_set(ANDROID_RB_PROPERTY, "reboot,recovery");
+ break;
+
case Device::REBOOT_BOOTLOADER:
#ifdef DOWNLOAD_MODE
ui->Print("Rebooting to download mode...\n");