Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationController.kt +3 −2 Original line number Diff line number Diff line Loading @@ -125,6 +125,7 @@ class UnlockedScreenOffAnimationController @Inject constructor( // FrameCallback used to delay starting the light reveal animation until the next frame private val startLightRevealCallback = TraceUtils.namedRunnable("startLightReveal") { lightRevealAnimationPlaying = true lightRevealAnimator.start() } Loading Loading @@ -268,7 +269,6 @@ class UnlockedScreenOffAnimationController @Inject constructor( decidedToAnimateGoingToSleep = true shouldAnimateInKeyguard = true lightRevealAnimationPlaying = true // Start the animation on the next frame. startAnimation() is called after // PhoneWindowManager makes a binder call to System UI on Loading @@ -283,7 +283,8 @@ class UnlockedScreenOffAnimationController @Inject constructor( // dispatched, a race condition could make it possible for this callback to be run // as the device is waking up. That results in the AOD UI being shown while we wake // up, with unpredictable consequences. if (!powerManager.isInteractive(Display.DEFAULT_DISPLAY)) { if (!powerManager.isInteractive(Display.DEFAULT_DISPLAY) && shouldAnimateInKeyguard) { aodUiAnimationPlaying = true // Show AOD. That'll cause the KeyguardVisibilityHelper to call Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationControllerTest.kt +16 −0 Original line number Diff line number Diff line Loading @@ -134,6 +134,22 @@ class UnlockedScreenOffAnimationControllerTest : SysuiTestCase() { verify(shadeViewController, times(1)).showAodUi() } @Test fun testAodUiShowNotInvokedIfWakingUp() { `when`(dozeParameters.canControlUnlockedScreenOff()).thenReturn(true) `when`(powerManager.isInteractive).thenReturn(false) val callbackCaptor = ArgumentCaptor.forClass(Runnable::class.java) controller.startAnimation() controller.onStartedWakingUp() verify(handler).postDelayed(callbackCaptor.capture(), anyLong()) callbackCaptor.value.run() verify(shadeViewController, never()).showAodUi() } /** * The AOD UI is shown during the screen off animation, after a delay to allow the light reveal * animation to start. If the device is woken up during the screen off, we should *never* do Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationController.kt +3 −2 Original line number Diff line number Diff line Loading @@ -125,6 +125,7 @@ class UnlockedScreenOffAnimationController @Inject constructor( // FrameCallback used to delay starting the light reveal animation until the next frame private val startLightRevealCallback = TraceUtils.namedRunnable("startLightReveal") { lightRevealAnimationPlaying = true lightRevealAnimator.start() } Loading Loading @@ -268,7 +269,6 @@ class UnlockedScreenOffAnimationController @Inject constructor( decidedToAnimateGoingToSleep = true shouldAnimateInKeyguard = true lightRevealAnimationPlaying = true // Start the animation on the next frame. startAnimation() is called after // PhoneWindowManager makes a binder call to System UI on Loading @@ -283,7 +283,8 @@ class UnlockedScreenOffAnimationController @Inject constructor( // dispatched, a race condition could make it possible for this callback to be run // as the device is waking up. That results in the AOD UI being shown while we wake // up, with unpredictable consequences. if (!powerManager.isInteractive(Display.DEFAULT_DISPLAY)) { if (!powerManager.isInteractive(Display.DEFAULT_DISPLAY) && shouldAnimateInKeyguard) { aodUiAnimationPlaying = true // Show AOD. That'll cause the KeyguardVisibilityHelper to call Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationControllerTest.kt +16 −0 Original line number Diff line number Diff line Loading @@ -134,6 +134,22 @@ class UnlockedScreenOffAnimationControllerTest : SysuiTestCase() { verify(shadeViewController, times(1)).showAodUi() } @Test fun testAodUiShowNotInvokedIfWakingUp() { `when`(dozeParameters.canControlUnlockedScreenOff()).thenReturn(true) `when`(powerManager.isInteractive).thenReturn(false) val callbackCaptor = ArgumentCaptor.forClass(Runnable::class.java) controller.startAnimation() controller.onStartedWakingUp() verify(handler).postDelayed(callbackCaptor.capture(), anyLong()) callbackCaptor.value.run() verify(shadeViewController, never()).showAodUi() } /** * The AOD UI is shown during the screen off animation, after a delay to allow the light reveal * animation to start. If the device is woken up during the screen off, we should *never* do Loading