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

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

Add VR mode check for thermal notification

am: d51ac732

Change-Id: I056136375b74a38a4973951fb33f795e784bab1e
parents 104c66d7 d51ac732
Loading
Loading
Loading
Loading
+20 −14
Original line number Diff line number Diff line
@@ -240,7 +240,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);
@@ -256,7 +260,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);
    }