Show notif when device reaches throttling temp
Adds logic to SystemUI that shows a notification alerting the user that their phone has reached a certain temperature and has throttled itself in order to cool down. The logic is controlled by a configuration resource: R.bool.config_showTemperatureWarning. If false, no action is taken. When true, PowerUI checks every 30 seconds if the current temp of HardwarePropertiesManager.DEVICE_TEMPERATURE_SKIN is greater than the throttling temp of HardwarePropertiesManager.DEVICE_TEMPERATURE_SKIN. If any one of the temperatures returned is greater, a notification is shown. Clicking on the notification will show a dialog explaining more details about what the device is doing in response to the high temperature. The notification will disappear once the temperature drops below the throttling temperature. In order to check the temperature in SystemUI, HardwarePropertiesManager has been updated to also allow any calls made by callers holding the signature-level DEVICE_POWER permission. Test: runtest systemui Bug: 30995038 Change-Id: I1b3f122341911c68e90c8a49ad35267ac382b356 (cherry picked from commit b7caf1d0)
Loading
Please register or sign in to comment