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

Commit 9fdf66b0 authored by Michael Wright's avatar Michael Wright
Browse files

Initialize mPendingAutoBrightnessAdjustment to NaN.

It currently defaults to 0 which is a valid adjustment, so if you have
a pre-existing adjustment it will get reset at every reboot and look
like a user adjustment.

Also, go ahead and set the pending adjustment to NaN if we've seen it
before so we don't try to apply it again in the future.

Bug: 80119319
Test: manual
Change-Id: I206f6d631ec2977a2c1a44f91e0c6c6a09ccd7ec
parent 6df95fa0
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -489,6 +489,7 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
        mTemporaryScreenBrightness = -1;
        mPendingScreenBrightnessSetting = -1;
        mTemporaryAutoBrightnessAdjustment = Float.NaN;
        mPendingAutoBrightnessAdjustment = Float.NaN;
    }

    /**
@@ -1499,6 +1500,7 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
            return false;
        }
        if (mAutoBrightnessAdjustment == mPendingAutoBrightnessAdjustment) {
            mPendingAutoBrightnessAdjustment = Float.NaN;
            return false;
        }
        mAutoBrightnessAdjustment = mPendingAutoBrightnessAdjustment;