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

Commit a2261117 authored by Tracy Zhou's avatar Tracy Zhou
Browse files

Adjust the threshold for disabling blur on thermal status

Let me know if there is a strong opinion to flag guard this. We are shipping blur in 25Q3, and this will be the new thermal level moving forward.

Bug: 393163512
Test: N/A
Flag: EXEMPT bugfix
Change-Id: I216b89879c6ba1a7d18de0382c87cae2bbc6985a
parent 62041833
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

package com.android.server.wm;

import static android.os.PowerManager.THERMAL_STATUS_CRITICAL;
import static android.os.PowerManager.THERMAL_STATUS_SEVERE;
import static android.view.CrossWindowBlurListeners.CROSS_WINDOW_BLUR_SUPPORTED;

import android.content.BroadcastReceiver;
@@ -46,7 +46,7 @@ final class BlurController {
    private final Object mLock = new Object();
    private volatile boolean mBlurEnabled;
    private boolean mInPowerSaveMode;
    private boolean mCriticalThermalStatus;
    private boolean mDisabledByThermal;
    private boolean mBlurDisabledSetting;
    private boolean mTunnelModeEnabled = false;

@@ -92,10 +92,10 @@ final class BlurController {
        mBlurDisabledSetting = getBlurDisabledSetting();

        powerManager.addThermalStatusListener((status) -> {
            mCriticalThermalStatus = status >= THERMAL_STATUS_CRITICAL;
            mDisabledByThermal = status >= THERMAL_STATUS_SEVERE;
            updateBlurEnabled();
        });
        mCriticalThermalStatus = powerManager.getCurrentThermalStatus() >= THERMAL_STATUS_CRITICAL;
        mDisabledByThermal = powerManager.getCurrentThermalStatus() >= THERMAL_STATUS_SEVERE;

        TunnelModeEnabledListener.register(mTunnelModeListener);

@@ -120,7 +120,7 @@ final class BlurController {
    private void updateBlurEnabled() {
        synchronized (mLock) {
            final boolean newEnabled = CROSS_WINDOW_BLUR_SUPPORTED && !mBlurDisabledSetting
                    && !mInPowerSaveMode && !mTunnelModeEnabled && !mCriticalThermalStatus;
                    && !mInPowerSaveMode && !mTunnelModeEnabled && !mDisabledByThermal;
            if (mBlurEnabled == newEnabled) {
                return;
            }