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

Commit 320a10ad authored by Mike Lockwood's avatar Mike Lockwood
Browse files

Reset cached light sensor values when toggling auto-brightness mode



Now the screen brightness will readjust to ambient lighting when toggling
auto-brightness on and off in Settings or the Power Widget.

Bug: 5486091

Change-Id: Ic98939fe1c59cb8def0f84266e48ca00329d6b30
Signed-off-by: default avatarMike Lockwood <lockwood@android.com>
parent 55174b66
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -3043,6 +3043,11 @@ public class PowerManagerService extends IPowerManager.Stub
        }
        if (mSensorManager != null && mLightSensorEnabled != enable) {
            mLightSensorEnabled = enable;
            // clear previous values so we will adjust to current brightness when
            // auto-brightness is reenabled
            mHighestLightSensorValue = -1;
            mLightSensorValue = -1;

            // clear calling identity so sensor manager battery stats are accurate
            long identity = Binder.clearCallingIdentity();
            try {