Merge "init: powerctl support and propagate longer canonical reboot reasons."
This commit is contained in:
commit
5c296a0003
1 changed files with 5 additions and 7 deletions
|
|
@ -636,11 +636,9 @@ bool HandlePowerctlMessage(const std::string& command) {
|
|||
bool run_fsck = false;
|
||||
bool command_invalid = false;
|
||||
|
||||
if (cmd_params.size() > 3) {
|
||||
command_invalid = true;
|
||||
} else if (cmd_params[0] == "shutdown") {
|
||||
if (cmd_params[0] == "shutdown") {
|
||||
cmd = ANDROID_RB_POWEROFF;
|
||||
if (cmd_params.size() == 2) {
|
||||
if (cmd_params.size() >= 2) {
|
||||
if (cmd_params[1] == "userrequested") {
|
||||
// The shutdown reason is PowerManager.SHUTDOWN_USER_REQUESTED.
|
||||
// Run fsck once the file system is remounted in read-only mode.
|
||||
|
|
@ -686,9 +684,9 @@ bool HandlePowerctlMessage(const std::string& command) {
|
|||
reboot_target = "recovery";
|
||||
}
|
||||
|
||||
// If there is an additional parameter, pass it along
|
||||
if ((cmd_params.size() == 3) && cmd_params[2].size()) {
|
||||
reboot_target += "," + cmd_params[2];
|
||||
// If there are additional parameter, pass them along
|
||||
for (size_t i = 2; (cmd_params.size() > i) && cmd_params[i].size(); ++i) {
|
||||
reboot_target += "," + cmd_params[i];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue