Loading init/builtins.cpp +6 −2 Original line number Original line Diff line number Diff line Loading @@ -607,7 +607,7 @@ static int do_powerctl(const std::vector<std::string>& args) { bool runFsck = false; bool runFsck = false; bool commandInvalid = false; bool commandInvalid = false; if (cmd_params.size() > 2) { if (cmd_params.size() > 3) { commandInvalid = true; commandInvalid = true; } else if (cmd_params[0] == "shutdown") { } else if (cmd_params[0] == "shutdown") { cmd = ANDROID_RB_POWEROFF; cmd = ANDROID_RB_POWEROFF; Loading @@ -619,7 +619,7 @@ static int do_powerctl(const std::vector<std::string>& args) { } } } else if (cmd_params[0] == "reboot") { } else if (cmd_params[0] == "reboot") { cmd = ANDROID_RB_RESTART2; cmd = ANDROID_RB_RESTART2; if (cmd_params.size() == 2) { if (cmd_params.size() >= 2) { reboot_target = cmd_params[1]; reboot_target = cmd_params[1]; // When rebooting to the bootloader notify the bootloader writing // When rebooting to the bootloader notify the bootloader writing // also the BCB. // also the BCB. Loading @@ -631,6 +631,10 @@ static int do_powerctl(const std::vector<std::string>& args) { << err; << 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 } else if (command == "thermal-shutdown") { // no additional parameter allowed cmd = ANDROID_RB_THERMOFF; cmd = ANDROID_RB_THERMOFF; Loading Loading
init/builtins.cpp +6 −2 Original line number Original line Diff line number Diff line Loading @@ -607,7 +607,7 @@ static int do_powerctl(const std::vector<std::string>& args) { bool runFsck = false; bool runFsck = false; bool commandInvalid = false; bool commandInvalid = false; if (cmd_params.size() > 2) { if (cmd_params.size() > 3) { commandInvalid = true; commandInvalid = true; } else if (cmd_params[0] == "shutdown") { } else if (cmd_params[0] == "shutdown") { cmd = ANDROID_RB_POWEROFF; cmd = ANDROID_RB_POWEROFF; Loading @@ -619,7 +619,7 @@ static int do_powerctl(const std::vector<std::string>& args) { } } } else if (cmd_params[0] == "reboot") { } else if (cmd_params[0] == "reboot") { cmd = ANDROID_RB_RESTART2; cmd = ANDROID_RB_RESTART2; if (cmd_params.size() == 2) { if (cmd_params.size() >= 2) { reboot_target = cmd_params[1]; reboot_target = cmd_params[1]; // When rebooting to the bootloader notify the bootloader writing // When rebooting to the bootloader notify the bootloader writing // also the BCB. // also the BCB. Loading @@ -631,6 +631,10 @@ static int do_powerctl(const std::vector<std::string>& args) { << err; << 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 } else if (command == "thermal-shutdown") { // no additional parameter allowed cmd = ANDROID_RB_THERMOFF; cmd = ANDROID_RB_THERMOFF; Loading