diff options
| author | Todd Poynor <toddpoynor@google.com> | 2017-01-31 14:15:20 -0800 |
|---|---|---|
| committer | Keun-young Park <keunyoung@google.com> | 2017-03-17 17:16:40 -0700 |
| commit | 21ad7cf1049e181e67b0c0da4d048722b7b5da3a (patch) | |
| tree | 661916fda0e20017f9d2fed6d01cd60257936dcf /init/builtins.cpp | |
| parent | 51893f20564cb04b1469c17fb9c73e4877ddab0c (diff) | |
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
Diffstat (limited to 'init/builtins.cpp')
| -rw-r--r-- | init/builtins.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/init/builtins.cpp b/init/builtins.cpp index 0b2e761e78..43eb378d78 100644 --- a/init/builtins.cpp +++ b/init/builtins.cpp @@ -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; |
