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

Commit e0ab2557 authored by Dmitri Plotnikov's avatar Dmitri Plotnikov Committed by Gerrit Code Review
Browse files

Merge "Passing additional parameter to powerctl"

parents 83f50843 00e1c4f3
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -607,7 +607,7 @@ static int do_powerctl(const std::vector<std::string>& args) {
    bool runFsck = false;
    bool commandInvalid = false;

    if (cmd_params.size() > 2) {
    if (cmd_params.size() > 3) {
        commandInvalid = true;
    } else if (cmd_params[0] == "shutdown") {
        cmd = ANDROID_RB_POWEROFF;
@@ -619,7 +619,7 @@ static int do_powerctl(const std::vector<std::string>& args) {
        }
    } else if (cmd_params[0] == "reboot") {
        cmd = ANDROID_RB_RESTART2;
        if (cmd_params.size() == 2) {
        if (cmd_params.size() >= 2) {
            reboot_target = cmd_params[1];
            // When rebooting to the bootloader notify the bootloader writing
            // also the BCB.
@@ -631,6 +631,10 @@ static int do_powerctl(const std::vector<std::string>& args) {
                               << err;
                }
            }
            // If there is an additional bootloader parameter, pass it along
            if (cmd_params.size() == 3) {
                reboot_target += "," + cmd_params[2];
            }
        }
    } else if (command == "thermal-shutdown") {  // no additional parameter allowed
        cmd = ANDROID_RB_THERMOFF;