Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fcf6cc30 authored by Andrew Sapperstein's avatar Andrew Sapperstein Committed by android-build-merger
Browse files

Add temperature config for high temp warning.

am: 1cac8321

Change-Id: I1aedaf0714e0f020f6e062bac716841ec472db2a
parents bbc00c87 1cac8321
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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>
+13 −9
Original line number Diff line number Diff line
@@ -224,6 +224,9 @@ public class PowerUI extends SystemUI {
            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,
@@ -234,6 +237,7 @@ public class PowerUI extends SystemUI {
                return;
            }
            mThrottlingTemp = throttlingTemps[0];
        }

        // We have passed all of the checks, start checking the temp
        updateTemperatureWarning();