diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml index c025f932adf82..50ef392fe0f14 100644 --- a/packages/SystemUI/res/values/config.xml +++ b/packages/SystemUI/res/values/config.xml @@ -290,6 +290,11 @@ false + false + + -1 + diff --git a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java index d4bb994010a30..89888019fa3ba 100644 --- a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java +++ b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java @@ -225,16 +225,20 @@ public class PowerUI extends SystemUI { return; } - // Get the throttling temperature. No need to check if we're not throttling. - float[] throttlingTemps = mHardwarePropertiesManager.getDeviceTemperatures( - HardwarePropertiesManager.DEVICE_TEMPERATURE_SKIN, - HardwarePropertiesManager.TEMPERATURE_THROTTLING); - if (throttlingTemps == null - || throttlingTemps.length == 0 - || throttlingTemps[0] == HardwarePropertiesManager.UNDEFINED_TEMPERATURE) { - return; + mThrottlingTemp = mContext.getResources().getInteger(R.integer.config_warningTemperature); + + if (mThrottlingTemp < 0f) { + // Get the throttling temperature. No need to check if we're not throttling. + float[] throttlingTemps = mHardwarePropertiesManager.getDeviceTemperatures( + HardwarePropertiesManager.DEVICE_TEMPERATURE_SKIN, + HardwarePropertiesManager.TEMPERATURE_THROTTLING); + 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 updateTemperatureWarning();