From 013fc4c5e12aa691b2c83f1f869d220bf0f45e08 Mon Sep 17 00:00:00 2001 From: Adrian Roos Date: Wed, 2 Aug 2017 19:32:28 +0200 Subject: [PATCH] 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 --- .../src/com/android/systemui/doze/DozeUi.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeUi.java b/packages/SystemUI/src/com/android/systemui/doze/DozeUi.java index 8847452133500..dc626fb4df653 100644 --- a/packages/SystemUI/src/com/android/systemui/doze/DozeUi.java +++ b/packages/SystemUI/src/com/android/systemui/doze/DozeUi.java @@ -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; } }