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

Commit 7518471a authored by Andrew Sapperstein's avatar Andrew Sapperstein
Browse files

Add temperature config for high temp warning.

Adds an integer resource (config_warningTemperature) that is used
to display the high temp warning. If it is set to less than 0,
the value from HardwarePropertiesManager#getDeviceTemperatures(
HardwarePropertiesManager.DEVICE_TEMPERATURE_SKIN,
HardwarePropertiesManager.TEMPERATURE_THROTTLING) is used instead.

Test: manual
Bug: 30995038
Change-Id: I05aa1b5930c6c151ebac439dfd5c00b3305dc46d
parent 54217e5c
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -290,6 +290,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>
+13 −9
Original line number Original line Diff line number Diff line
@@ -225,6 +225,9 @@ public class PowerUI extends SystemUI {
            return;
            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.
            // Get the throttling temperature. No need to check if we're not throttling.
            float[] throttlingTemps = mHardwarePropertiesManager.getDeviceTemperatures(
            float[] throttlingTemps = mHardwarePropertiesManager.getDeviceTemperatures(
                    HardwarePropertiesManager.DEVICE_TEMPERATURE_SKIN,
                    HardwarePropertiesManager.DEVICE_TEMPERATURE_SKIN,
@@ -235,6 +238,7 @@ public class PowerUI extends SystemUI {
                return;
                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();