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

Commit 57b1ad41 authored by Lucas Dupin's avatar Lucas Dupin Committed by Automerger Merge Worker
Browse files

Merge "Fix display fade-out animation" into rvc-dev am: a8dfb52c

Change-Id: Ib40368d799b3193884de4fc01a699b0d103cc068
parents 223431b8 a8dfb52c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@ public class DozeScreenState implements DozeMachine.Part {
        final boolean pulseEnding = oldState == DOZE_PULSE_DONE && newState.isAlwaysOn();
        final boolean turningOn = (oldState == DOZE_AOD_PAUSED || oldState == DOZE)
                && newState.isAlwaysOn();
        final boolean turningOff = (newState.isAlwaysOn() && newState == DOZE)
        final boolean turningOff = (oldState.isAlwaysOn() && newState == DOZE)
                || (oldState == DOZE_AOD_PAUSING && newState == DOZE_AOD_PAUSED);
        final boolean justInitialized = oldState == DozeMachine.State.INITIALIZED;
        if (messagePending || justInitialized || pulseEnding || turningOn) {
+16 −0
Original line number Diff line number Diff line
@@ -217,4 +217,20 @@ public class DozeScreenStateTest extends SysuiTestCase {
        assertEquals(Display.STATE_OFF, mServiceFake.screenState);
    }

    @Test
    public void test_animatesOff() {
        ArgumentCaptor<Runnable> captor = ArgumentCaptor.forClass(Runnable.class);
        doAnswer(invocation -> null).when(mDozeHost).prepareForGentleSleep(captor.capture());
        mHandlerFake.setMode(QUEUEING);

        mScreen.transitionTo(UNINITIALIZED, INITIALIZED);
        mScreen.transitionTo(INITIALIZED, DOZE_AOD);
        mScreen.transitionTo(DOZE_AOD, DOZE);

        mHandlerFake.dispatchQueuedMessages();
        verify(mDozeHost).prepareForGentleSleep(eq(captor.getValue()));
        captor.getValue().run();
        assertEquals(Display.STATE_OFF, mServiceFake.screenState);
    }

}
 No newline at end of file