Add temperature config for high temp warning.
am: 1cac83218c
Change-Id: I1aedaf0714e0f020f6e062bac716841ec472db2a
This commit is contained in:
@@ -284,6 +284,11 @@
|
|||||||
|
|
||||||
<bool name="quick_settings_show_full_alarm">false</bool>
|
<bool name="quick_settings_show_full_alarm">false</bool>
|
||||||
|
|
||||||
|
<!-- Whether to show a warning notification when the device reaches a certain temperature. -->
|
||||||
<bool name="config_showTemperatureWarning">false</bool>
|
<bool name="config_showTemperatureWarning">false</bool>
|
||||||
|
|
||||||
|
<!-- Temp at which to show a warning notification if config_showTemperatureWarning is true.
|
||||||
|
If < 0, uses the value from HardwarePropertiesManager#getDeviceTemperatures. -->
|
||||||
|
<integer name="config_warningTemperature">-1</integer>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -224,16 +224,20 @@ public class PowerUI extends SystemUI {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the throttling temperature. No need to check if we're not throttling.
|
mThrottlingTemp = mContext.getResources().getInteger(R.integer.config_warningTemperature);
|
||||||
float[] throttlingTemps = mHardwarePropertiesManager.getDeviceTemperatures(
|
|
||||||
HardwarePropertiesManager.DEVICE_TEMPERATURE_SKIN,
|
if (mThrottlingTemp < 0f) {
|
||||||
HardwarePropertiesManager.TEMPERATURE_THROTTLING);
|
// Get the throttling temperature. No need to check if we're not throttling.
|
||||||
if (throttlingTemps == null
|
float[] throttlingTemps = mHardwarePropertiesManager.getDeviceTemperatures(
|
||||||
|| throttlingTemps.length == 0
|
HardwarePropertiesManager.DEVICE_TEMPERATURE_SKIN,
|
||||||
|| throttlingTemps[0] == HardwarePropertiesManager.UNDEFINED_TEMPERATURE) {
|
HardwarePropertiesManager.TEMPERATURE_THROTTLING);
|
||||||
return;
|
if (throttlingTemps == null
|
||||||
|
|| throttlingTemps.length == 0
|
||||||
|
|| throttlingTemps[0] == HardwarePropertiesManager.UNDEFINED_TEMPERATURE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mThrottlingTemp = throttlingTemps[0];
|
||||||
}
|
}
|
||||||
mThrottlingTemp = throttlingTemps[0];
|
|
||||||
|
|
||||||
// We have passed all of the checks, start checking the temp
|
// We have passed all of the checks, start checking the temp
|
||||||
updateTemperatureWarning();
|
updateTemperatureWarning();
|
||||||
|
|||||||
Reference in New Issue
Block a user