summaryrefslogtreecommitdiffstats
path: root/recovery.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2019-04-16 23:22:25 +0200
committerTao Bao <tbao@google.com>2019-04-17 23:07:23 +0200
commitc6dc325e88a25201aa3856e6532c3ed14203a376 (patch)
treea5a2cf98f7b31abbfa6116be2037634a1925b88f /recovery.cpp
parentMerge "Move load & restore logs to logging.cpp" (diff)
downloadandroid_bootable_recovery-c6dc325e88a25201aa3856e6532c3ed14203a376.tar
android_bootable_recovery-c6dc325e88a25201aa3856e6532c3ed14203a376.tar.gz
android_bootable_recovery-c6dc325e88a25201aa3856e6532c3ed14203a376.tar.bz2
android_bootable_recovery-c6dc325e88a25201aa3856e6532c3ed14203a376.tar.lz
android_bootable_recovery-c6dc325e88a25201aa3856e6532c3ed14203a376.tar.xz
android_bootable_recovery-c6dc325e88a25201aa3856e6532c3ed14203a376.tar.zst
android_bootable_recovery-c6dc325e88a25201aa3856e6532c3ed14203a376.zip
Diffstat (limited to 'recovery.cpp')
-rw-r--r--recovery.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/recovery.cpp b/recovery.cpp
index 0e6e4976d..ce29cb27b 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -538,12 +538,20 @@ static Device::BuiltinAction prompt_and_wait(Device* device, int status) {
break;
}
case Device::APPLY_ADB_SIDELOAD:
- case Device::APPLY_SDCARD: {
+ case Device::APPLY_SDCARD:
+ case Device::ENTER_RESCUE: {
save_current_log = true;
- bool adb = (chosen_action == Device::APPLY_ADB_SIDELOAD);
- if (adb) {
- status = apply_from_adb(ui);
+
+ bool adb = true;
+ if (chosen_action == Device::ENTER_RESCUE) {
+ // Switch to graphics screen.
+ ui->ShowText(false);
+ status = ApplyFromAdb(ui, true /* rescue_mode */);
+ ui->ShowText(true);
+ } else if (chosen_action == Device::APPLY_ADB_SIDELOAD) {
+ status = ApplyFromAdb(ui, false /* rescue_mode */);
} else {
+ adb = false;
status = ApplyFromSdcard(device, ui);
}
@@ -926,7 +934,7 @@ Device::BuiltinAction start_recovery(Device* device, const std::vector<std::stri
if (!sideload_auto_reboot) {
ui->ShowText(true);
}
- status = apply_from_adb(ui);
+ status = ApplyFromAdb(ui, false /* rescue_mode */);
ui->Print("\nInstall from ADB complete (status: %d).\n", status);
if (sideload_auto_reboot) {
ui->Print("Rebooting automatically.\n");