Loading packages/SystemUI/src/com/android/systemui/unfold/FoldAodAnimationController.kt +7 −4 Original line number Diff line number Diff line Loading @@ -150,10 +150,6 @@ constructor( pendingScrimReadyCallback = onReady } } else if (isFolded && !isFoldHandled && alwaysOnEnabled && isDozing) { // Screen turning on for the first time after folding and we are already dozing // We should play the folding to AOD animation isFoldHandled = true setAnimationState(playing = true) centralSurfaces.notificationPanelViewController.prepareFoldToAodAnimation() Loading @@ -169,6 +165,13 @@ constructor( // No animation, call ready callback immediately onReady.run() } if (isFolded) { // Any time the screen turns on, this state needs to be reset if the device has been // folded. Reaching this line implies AOD has been shown in one way or another, // if enabled isFoldHandled = true } } /** Called when keyguard scrim opaque changed */ Loading packages/SystemUI/tests/src/com/android/systemui/unfold/FoldAodAnimationControllerTest.kt +25 −0 Original line number Diff line number Diff line Loading @@ -197,6 +197,31 @@ class FoldAodAnimationControllerTest : SysuiTestCase() { job.cancel() } @Test fun onFolded_onScreenTurningOnWithoutDozingThenWithDozing_doesNotLogLatency() = runBlocking(IMMEDIATE) { val job = underTest.listenForDozing(this) keyguardRepository.setDozing(false) setAodEnabled(enabled = true) yield() fold() simulateScreenTurningOn() reset(latencyTracker) // Now enable dozing and trigger a second run through the aod animation code. It should // not rerun the animation keyguardRepository.setDozing(true) yield() simulateScreenTurningOn() verify(latencyTracker, never()).onActionStart(any()) verify(latencyTracker, never()).onActionEnd(any()) job.cancel() } @Test fun onFolded_animationCancelled_doesNotLogLatency() = runBlocking(IMMEDIATE) { Loading Loading
packages/SystemUI/src/com/android/systemui/unfold/FoldAodAnimationController.kt +7 −4 Original line number Diff line number Diff line Loading @@ -150,10 +150,6 @@ constructor( pendingScrimReadyCallback = onReady } } else if (isFolded && !isFoldHandled && alwaysOnEnabled && isDozing) { // Screen turning on for the first time after folding and we are already dozing // We should play the folding to AOD animation isFoldHandled = true setAnimationState(playing = true) centralSurfaces.notificationPanelViewController.prepareFoldToAodAnimation() Loading @@ -169,6 +165,13 @@ constructor( // No animation, call ready callback immediately onReady.run() } if (isFolded) { // Any time the screen turns on, this state needs to be reset if the device has been // folded. Reaching this line implies AOD has been shown in one way or another, // if enabled isFoldHandled = true } } /** Called when keyguard scrim opaque changed */ Loading
packages/SystemUI/tests/src/com/android/systemui/unfold/FoldAodAnimationControllerTest.kt +25 −0 Original line number Diff line number Diff line Loading @@ -197,6 +197,31 @@ class FoldAodAnimationControllerTest : SysuiTestCase() { job.cancel() } @Test fun onFolded_onScreenTurningOnWithoutDozingThenWithDozing_doesNotLogLatency() = runBlocking(IMMEDIATE) { val job = underTest.listenForDozing(this) keyguardRepository.setDozing(false) setAodEnabled(enabled = true) yield() fold() simulateScreenTurningOn() reset(latencyTracker) // Now enable dozing and trigger a second run through the aod animation code. It should // not rerun the animation keyguardRepository.setDozing(true) yield() simulateScreenTurningOn() verify(latencyTracker, never()).onActionStart(any()) verify(latencyTracker, never()).onActionEnd(any()) job.cancel() } @Test fun onFolded_animationCancelled_doesNotLogLatency() = runBlocking(IMMEDIATE) { Loading