summaryrefslogtreecommitdiffstats
path: root/init/reboot.cpp
diff options
context:
space:
mode:
authorHridya Valsaraju <hridya@google.com>2018-09-19 21:14:18 -0700
committerHridya Valsaraju <hridya@google.com>2018-09-25 03:52:12 +0000
commit542582689d53fc3a1c9d8297e42b7aa92291b7fe (patch)
treebff3e85e828275f10205affaedf36f0cde670148 /init/reboot.cpp
parent6590255dbbcbd35c527b3a2e6871275ec88fee64 (diff)
downloadsystem_core-542582689d53fc3a1c9d8297e42b7aa92291b7fe.tar.gz
system_core-542582689d53fc3a1c9d8297e42b7aa92291b7fe.tar.bz2
system_core-542582689d53fc3a1c9d8297e42b7aa92291b7fe.zip
Support 'adb reboot fastboot' command conditionally.
Devices not supporting logical partitions do not require the command. Bug: 78793464 Test: 'adb reboot fastboot' reboots to bootloader for a device not supporting logical partitions. Change-Id: I0a7b6d4335040e24efbf461e2dd2d56ab1985b7f
Diffstat (limited to 'init/reboot.cpp')
-rw-r--r--init/reboot.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/init/reboot.cpp b/init/reboot.cpp
index 2f88121b7..b84bfd3d6 100644
--- a/init/reboot.cpp
+++ b/init/reboot.cpp
@@ -464,6 +464,12 @@ bool HandlePowerctlMessage(const std::string& command) {
cmd = ANDROID_RB_RESTART2;
if (cmd_params.size() >= 2) {
reboot_target = cmd_params[1];
+ // adb reboot fastboot should boot into bootloader for devices not
+ // supporting logical partitions.
+ if (reboot_target == "fastboot" &&
+ !android::base::GetBoolProperty("ro.boot.logical_partitions", false)) {
+ reboot_target = "bootloader";
+ }
// When rebooting to the bootloader notify the bootloader writing
// also the BCB.
if (reboot_target == "bootloader") {