summaryrefslogtreecommitdiffstats
path: root/recovery_main.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2019-04-30 00:31:00 +0200
committerandroid-build-merger <android-build-merger@google.com>2019-04-30 00:31:00 +0200
commit0fc00e58300198e1fc4a862cd7f50b7a562aff26 (patch)
tree6991a258b0867fcd0c6af1e7717731bd1f403926 /recovery_main.cpp
parent[automerger skipped] Parse BCB command to enter rescue mode. am: 75321ade87 -s ours (diff)
parentMerge "Consolidate the codes that handle reboot/shutdown." am: 189c8f9aeb (diff)
downloadandroid_bootable_recovery-0fc00e58300198e1fc4a862cd7f50b7a562aff26.tar
android_bootable_recovery-0fc00e58300198e1fc4a862cd7f50b7a562aff26.tar.gz
android_bootable_recovery-0fc00e58300198e1fc4a862cd7f50b7a562aff26.tar.bz2
android_bootable_recovery-0fc00e58300198e1fc4a862cd7f50b7a562aff26.tar.lz
android_bootable_recovery-0fc00e58300198e1fc4a862cd7f50b7a562aff26.tar.xz
android_bootable_recovery-0fc00e58300198e1fc4a862cd7f50b7a562aff26.tar.zst
android_bootable_recovery-0fc00e58300198e1fc4a862cd7f50b7a562aff26.zip
Diffstat (limited to 'recovery_main.cpp')
-rw-r--r--recovery_main.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/recovery_main.cpp b/recovery_main.cpp
index 6e69b7009..b999505fb 100644
--- a/recovery_main.cpp
+++ b/recovery_main.cpp
@@ -41,7 +41,6 @@
#include <android-base/strings.h>
#include <android-base/unique_fd.h>
#include <bootloader_message/bootloader_message.h>
-#include <cutils/android_reboot.h>
#include <cutils/sockets.h>
#include <private/android_logger.h> /* private pmsg functions */
#include <selinux/android.h>
@@ -471,27 +470,26 @@ int main(int argc, char** argv) {
switch (ret) {
case Device::SHUTDOWN:
ui->Print("Shutting down...\n");
- // TODO: Move all the reboots to reboot(), which should conditionally set quiescent flag.
- android::base::SetProperty(ANDROID_RB_PROPERTY, "shutdown,");
+ Shutdown();
break;
case Device::REBOOT_BOOTLOADER:
ui->Print("Rebooting to bootloader...\n");
- android::base::SetProperty(ANDROID_RB_PROPERTY, "reboot,bootloader");
+ Reboot("bootloader");
break;
case Device::REBOOT_FASTBOOT:
ui->Print("Rebooting to recovery/fastboot...\n");
- android::base::SetProperty(ANDROID_RB_PROPERTY, "reboot,fastboot");
+ Reboot("fastboot");
break;
case Device::REBOOT_RECOVERY:
ui->Print("Rebooting to recovery...\n");
- reboot("reboot,recovery");
+ Reboot("recovery");
break;
case Device::REBOOT_RESCUE: {
- // Not using `reboot("reboot,rescue")`, as it requires matching support in kernel and/or
+ // Not using `Reboot("rescue")`, as it requires matching support in kernel and/or
// bootloader.
bootloader_message boot = {};
strlcpy(boot.command, "boot-rescue", sizeof(boot.command));
@@ -502,14 +500,14 @@ int main(int argc, char** argv) {
continue;
}
ui->Print("Rebooting to recovery/rescue...\n");
- reboot("reboot,recovery");
+ Reboot("recovery");
break;
}
case Device::ENTER_FASTBOOT:
if (logical_partitions_mapped()) {
ui->Print("Partitions may be mounted - rebooting to enter fastboot.");
- android::base::SetProperty(ANDROID_RB_PROPERTY, "reboot,fastboot");
+ Reboot("fastboot");
} else {
LOG(INFO) << "Entering fastboot";
fastboot = true;
@@ -523,7 +521,7 @@ int main(int argc, char** argv) {
default:
ui->Print("Rebooting...\n");
- reboot("reboot,");
+ Reboot("");
break;
}
}