Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a50df84 authored by Hridya Valsaraju's avatar Hridya Valsaraju Committed by android-build-merger
Browse files

Merge "Support 'adb reboot fastboot' command conditionally." am: 6544056d

am: df5b2ac9

Change-Id: I319592a99ade8d91b1c47e6cc48b1641952907f0
parents 21cf41b6 df5b2ac9
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -103,7 +103,9 @@ void reboot_service(unique_fd fd, const std::string& arg) {
    if (reboot_arg.empty()) reboot_arg = "adb";
    std::string reboot_string = android::base::StringPrintf("reboot,%s", reboot_arg.c_str());

    if (reboot_arg == "fastboot" && access("/dev/socket/recovery", F_OK) == 0) {
    if (reboot_arg == "fastboot" &&
        android::base::GetBoolProperty("ro.boot.logical_partitions", false) &&
        access("/dev/socket/recovery", F_OK) == 0) {
        LOG(INFO) << "Recovery specific reboot fastboot";
        /*
         * The socket is created to allow switching between recovery and
+6 −0
Original line number Diff line number Diff line
@@ -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") {