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

Commit 3781641a authored by Daniel Solomon's avatar Daniel Solomon
Browse files

Reset DWB color temperature when DWBC is disabled

Currently when DisplayWhiteBalanceController is disabled, it resets
internal states and disables related sensors. However, it does not
modify the display's color temperature. This results in the last color
temperature remaining in effect during Always on Display, even though
DWBC no longer controls it.

This change makes DWBC reset the display's color temperature to a
default value when it is disabled.

Bug 130262595
Test: manual

Change-Id: I066577d705cc9a518fe9196b0afd7374980816b3
parent cbfe50d7
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1240,6 +1240,14 @@ public final class ColorDisplayService extends SystemService {
            return false;
        }

        /**
         * Reset the CCT value for the display white balance transform to its default value.
         */
        public boolean resetDisplayWhiteBalanceColorTemperature() {
            return setDisplayWhiteBalanceColorTemperature(getContext().getResources()
                    .getInteger(R.integer.config_displayWhiteBalanceColorTemperatureDefault));
        }

        /**
         * Sets the listener and returns whether display white balance is currently enabled.
         */
+1 −0
Original line number Diff line number Diff line
@@ -405,6 +405,7 @@ public class DisplayWhiteBalanceController implements
        mThrottler.clear();
        mAmbientColorTemperature = -1.0f;
        mPendingAmbientColorTemperature = -1.0f;
        mColorDisplayServiceInternal.resetDisplayWhiteBalanceColorTemperature();
        return true;
    }