Merge "Update CHAR LIMIT for notification body." into nyc-mr2-dev
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index cf20c27..b89ce47 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -284,6 +284,11 @@
 
     <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>
 
+    <!-- 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>
diff --git a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java
index bdb2295..d9b4cab 100644
--- a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java
+++ b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java
@@ -224,16 +224,20 @@
             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();