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

Commit 013fc4c5 authored by Adrian Roos's avatar Adrian Roos
Browse files

AOD: Do not change wakeup animation during DozeService teardown

When finishing the DozeService, eg. in response to pressing the
power button, we need to keep the current value of shouldAnimate.

Fixes: 64203271
Test: Disable Always-On Display. Double tap to trigger Ambient Display. Press power button. Verify that wakeup animation plays.
Change-Id: I393ac143099b45ff90c927658a6d00a2afc1124f
parent 273bb516
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -95,17 +95,22 @@ public class DozeUi implements DozeMachine.Part {
                unscheduleTimeTick();
                break;
        }
        mHost.setAnimateWakeup(shouldAnimateWakeup(newState));
        updateAnimateWakeup(newState);
    }

    private boolean shouldAnimateWakeup(DozeMachine.State state) {
    private void updateAnimateWakeup(DozeMachine.State state) {
        switch (state) {
            case DOZE_REQUEST_PULSE:
            case DOZE_PULSING:
            case DOZE_PULSE_DONE:
                return true;
                mHost.setAnimateWakeup(true);
                break;
            case FINISH:
                // Keep current state.
                break;
            default:
                return false;
                mHost.setAnimateWakeup(false);
                break;
        }
    }