minadbd: Support `adb reboot` under sideload/rescue modes.
Bug: 128415917
Test: Run the following commands under sideload and rescue modes
respectively.
$ adb reboot
$ adb reboot bootloader
$ adb reboot recovery
$ adb reboot rescue
$ adb reboot invalid
Change-Id: I84daf63e3360b7b4a0af5e055149a4f54e10ba90
Merged-In: I84daf63e3360b7b4a0af5e055149a4f54e10ba90
(cherry picked from commit 10f441a9dbb91be3124f455439631abcf8e96cde)
diff --git a/recovery_main.cpp b/recovery_main.cpp
index 38e1db7..18abff7 100644
--- a/recovery_main.cpp
+++ b/recovery_main.cpp
@@ -478,6 +478,11 @@
android::base::SetProperty(ANDROID_RB_PROPERTY, "reboot,bootloader");
break;
+ case Device::REBOOT_RESCUE:
+ ui->Print("Rebooting to rescue...\n");
+ android::base::SetProperty(ANDROID_RB_PROPERTY, "reboot,rescue");
+ break;
+
case Device::ENTER_FASTBOOT:
if (logical_partitions_mapped()) {
ui->Print("Partitions may be mounted - rebooting to enter fastboot.");