Skip to content
Commit fd769f99 authored by beiyifb's avatar beiyifb
Browse files

Thermalmanagerservice: Add shell interface to inject temperatures

Add a new shellcommand to thermalservice that allows injecting temperature samples into the queue, identically to how the HAL callbacks would do this, which triggers the same shutdown flow that would normally be used.

Test: 1) verify that injecting shutdown events triggers the alert service and shuts off the headset:
adb shell cmd thermalservice inject-temperature CPU SHUTDOWN cpu-0-2-usr 95.0
adb shell cmd thermalservice inject-temperature BATTERY SHUTDOWN batt-usr 53.0
2) verify that the injected temperature is in the cached temperature list (adb shell dumpsys thermalservice, after the command above):
Cached temperatures: Temperature{mValue=53.0, mType=3, mName=batt-usr, mStatus=6}
3) verify that invalid shell commands return errors:
adb shell cmd thermalservice inject-temperature stuff
adb shell cmd thermalservice inject-temperature battery stuff
Invalid temperature type: stuff
Invalid throttle status: stuff

Change-Id: I95e4064fe753095edd0fa2e87e337c3d2d3d9556
parent c80d564f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment