powerctl: add thermal-shutdown command

Add sys.powerctl property interface for initiating thermal shutdown.

Bug: 30994946
Test: Manual: setprop sys.powerctl thermal-shutdown
Change-Id: Iffce60bd3cb4b40a5859623d10b91bee5101f168
This commit is contained in:
Todd Poynor 2017-01-31 14:15:20 -08:00 committed by Keun-young Park
parent 1d1de8e282
commit 16663a2aa4
1 changed files with 3 additions and 0 deletions

View File

@ -718,6 +718,9 @@ static int do_powerctl(const std::vector<std::string>& args) {
} else if (strncmp(command, "reboot", 6) == 0) {
cmd = ANDROID_RB_RESTART2;
len = 6;
} else if (strncmp(command, "thermal-shutdown", 16) == 0) {
cmd = ANDROID_RB_THERMOFF;
len = 16;
} else {
LOG(ERROR) << "powerctl: unrecognized command '" << command << "'";
return -EINVAL;