Loading packages/SystemUI/src/com/android/systemui/unfold/FoldAodAnimationController.kt +5 −1 Original line number Diff line number Diff line Loading @@ -152,6 +152,7 @@ constructor( } 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 Loading @@ -186,7 +187,10 @@ constructor( cancelAnimation?.run() // Post starting the animation to the next frame to avoid junk due to inset changes cancelAnimation = mainExecutor.executeDelayed(startAnimationRunnable, /* delayMillis= */ 0) cancelAnimation = mainExecutor.executeDelayed( startAnimationRunnable, /* delayMillis= */ 0 ) shouldPlayAnimation = false } } Loading packages/SystemUI/tests/src/com/android/systemui/unfold/FoldAodAnimationControllerTest.kt +24 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,8 @@ import org.junit.runner.RunWith import org.mockito.ArgumentCaptor import org.mockito.Captor import org.mockito.Mock import org.mockito.Mockito.never import org.mockito.Mockito.reset import org.mockito.Mockito.verify import org.mockito.Mockito.verifyNoMoreInteractions import org.mockito.Mockito.`when` as whenever Loading Loading @@ -173,6 +175,28 @@ class FoldAodAnimationControllerTest : SysuiTestCase() { job.cancel() } @Test fun onFolded_onScreenTurningOnInvokedTwice_doesNotLogLatency() = runBlocking(IMMEDIATE) { val job = underTest.listenForDozing(this) keyguardRepository.setDozing(true) setAodEnabled(enabled = true) yield() fold() simulateScreenTurningOn() reset(latencyTracker) // This can happen > 1 time if the prox sensor is covered 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 +5 −1 Original line number Diff line number Diff line Loading @@ -152,6 +152,7 @@ constructor( } 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 Loading @@ -186,7 +187,10 @@ constructor( cancelAnimation?.run() // Post starting the animation to the next frame to avoid junk due to inset changes cancelAnimation = mainExecutor.executeDelayed(startAnimationRunnable, /* delayMillis= */ 0) cancelAnimation = mainExecutor.executeDelayed( startAnimationRunnable, /* delayMillis= */ 0 ) shouldPlayAnimation = false } } Loading
packages/SystemUI/tests/src/com/android/systemui/unfold/FoldAodAnimationControllerTest.kt +24 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,8 @@ import org.junit.runner.RunWith import org.mockito.ArgumentCaptor import org.mockito.Captor import org.mockito.Mock import org.mockito.Mockito.never import org.mockito.Mockito.reset import org.mockito.Mockito.verify import org.mockito.Mockito.verifyNoMoreInteractions import org.mockito.Mockito.`when` as whenever Loading Loading @@ -173,6 +175,28 @@ class FoldAodAnimationControllerTest : SysuiTestCase() { job.cancel() } @Test fun onFolded_onScreenTurningOnInvokedTwice_doesNotLogLatency() = runBlocking(IMMEDIATE) { val job = underTest.listenForDozing(this) keyguardRepository.setDozing(true) setAodEnabled(enabled = true) yield() fold() simulateScreenTurningOn() reset(latencyTracker) // This can happen > 1 time if the prox sensor is covered simulateScreenTurningOn() verify(latencyTracker, never()).onActionStart(any()) verify(latencyTracker, never()).onActionEnd(any()) job.cancel() } @Test fun onFolded_animationCancelled_doesNotLogLatency() = runBlocking(IMMEDIATE) { Loading