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

Commit fc3aad9d authored by Rupesh Bansal's avatar Rupesh Bansal
Browse files

[Bugfix]Execute screenTurnedOff after screenTurningOff is executed

The methods in screenTurningOff and screenTurnedOff are executed asynchronously, which causes mScreenOnEarly to be false occasionally when checkingIfReadyToSnapshot in screenTurningOff, resulting in snapshot failure. The startingWindow type after the screen is turned on is incorrectly set to splash screen.
Before the screenTurningOff method, mPendingScreenOffUnblocker is assigned in unBlockScreenOff, and mPendingScreenOffUnblocker is set to null after screenTurningOff is executed. Therefore, before executing screenTurnedOff, screenTurningOff is considered to have been executed and mPendingScreenOffUnblocker==null is judged.

Bug:414282309
Test: Manual
Flag: EXEMPT trivial change
Change-Id: I42a19655bbc16d3efa940bc981afb64c1d08dd91
parent af2a9e60
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -2242,8 +2242,12 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
        // This surface is essentially the final state of the color fade animation and
        // it is only removed once the window manager tells us that the activity has
        // finished drawing underneath.
        // If mPendingScreenOffUnblocker is not null, it means we are waiting for
        // the window manager policy to unblock the screen off. This policy is doing something
        // like creating a snapshot, so should not report the screen off.
        if (isOff && mReportedScreenStateToPolicy != REPORTED_TO_POLICY_SCREEN_OFF
                && !mDisplayPowerProximityStateController.isScreenOffBecauseOfProximity()) {
                && !mDisplayPowerProximityStateController.isScreenOffBecauseOfProximity()
                && mPendingScreenOffUnblocker == null) {
            setReportedScreenState(REPORTED_TO_POLICY_SCREEN_OFF);
            unblockScreenOn();
            mWindowManagerPolicy.screenTurnedOff(mDisplayId, mIsInTransition);