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

Commit 65d8a5fc authored by Andrew Sapperstein's avatar Andrew Sapperstein
Browse files

Add VR mode check for thermal notification

When in VR mode, don't show the high temp notification
since VR shows its own notification.

Test: manual
Bug: 30995038
Change-Id: I845480d968a9b0da9997f035875885bc261c577a
parent b7caf1d0
Loading
Loading
Loading
Loading
+20 −14
Original line number Diff line number Diff line
@@ -243,7 +243,11 @@ public class PowerUI extends SystemUI {
    }

    private void updateTemperatureWarning() {
        // TODO: Add VR mode check
        PhoneStatusBar phoneStatusBar = getComponent(PhoneStatusBar.class);
        if (phoneStatusBar != null && phoneStatusBar.isDeviceInVrMode()) {
            // ensure the warning isn't showing, since VR shows its own warning
            mWarnings.dismissTemperatureWarning();
        } else {
            float[] temps = mHardwarePropertiesManager.getDeviceTemperatures(
                    HardwarePropertiesManager.DEVICE_TEMPERATURE_SKIN,
                    HardwarePropertiesManager.TEMPERATURE_CURRENT);
@@ -259,7 +263,9 @@ public class PowerUI extends SystemUI {
            } else {
                mWarnings.dismissTemperatureWarning();
            }
        }

        // TODO: skip this when in VR mode since we already get a callback
        mHandler.postDelayed(this::updateTemperatureWarning, TEMPERATURE_INTERVAL);
    }