Loading packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionInteractorTest.kt +10 −1 Original line number Diff line number Diff line Loading @@ -197,7 +197,16 @@ class KeyguardTransitionInteractorTest : SysuiTestCase() { runCurrent() } assertThat(startedSteps).isEqualTo(listOf(steps[0], steps[3], steps[6])) assertThat(startedSteps) .isEqualTo( listOf( // The initial transition will also get sent when collect started TransitionStep(OFF, LOCKSCREEN, 0f, STARTED), steps[0], steps[3], steps[6] ) ) } @Test Loading packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/PrimaryBouncerToGoneTransitionViewModelTest.kt +10 −6 Original line number Diff line number Diff line Loading @@ -119,15 +119,19 @@ class PrimaryBouncerToGoneTransitionViewModelTest : SysuiTestCase() { fun lockscreenAlpha_runDimissFromKeyguard() = testScope.runTest { val values by collectValues(underTest.lockscreenAlpha) runCurrent() sysuiStatusBarStateController.setLeaveOpenOnKeyguardHide(true) runCurrent() keyguardTransitionRepository.sendTransitionStep(step(0f, TransitionState.STARTED)) keyguardTransitionRepository.sendTransitionStep(step(1f)) keyguardTransitionRepository.sendTransitionSteps( from = KeyguardState.PRIMARY_BOUNCER, to = KeyguardState.GONE, testScope, ) assertThat(values.size).isEqualTo(2) values.forEach { assertThat(it).isEqualTo(1f) } assertThat(values[0]).isEqualTo(1f) assertThat(values[1]).isEqualTo(1f) // Ensure FINISHED sets alpha to 0 assertThat(values[2]).isEqualTo(0f) } @Test Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/PrimaryBouncerToGoneTransitionViewModel.kt +1 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,7 @@ constructor( 0f } }, onFinish = { 0f }, ) } Loading packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java +6 −0 Original line number Diff line number Diff line Loading @@ -511,6 +511,12 @@ public class NotificationShadeWindowViewController implements Dumpable { return true; } } } else if (migrateClocksToBlueprint()) { // This final check handles swipes on HUNs and when Pulsing if (!bouncerShowing && didNotificationPanelInterceptEvent(ev)) { mShadeLogger.d("NSWVC: intercepted for HUN/PULSING"); return true; } } return false; } Loading packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewControllerTest.kt +30 −2 Original line number Diff line number Diff line Loading @@ -450,7 +450,7 @@ class NotificationShadeWindowViewControllerTest : SysuiTestCase() { mSetFlagsRule.enableFlags(Flags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT) // THEN touch should NOT be intercepted by NotificationShade // THEN touch should be intercepted by NotificationShade assertThat(interactionEventHandler.shouldInterceptTouchEvent(DOWN_EVENT)).isTrue() } Loading @@ -469,7 +469,35 @@ class NotificationShadeWindowViewControllerTest : SysuiTestCase() { mSetFlagsRule.enableFlags(Flags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT) // THEN touch should NOT be intercepted by NotificationShade // THEN touch should be intercepted by NotificationShade assertThat(interactionEventHandler.shouldInterceptTouchEvent(DOWN_EVENT)).isTrue() } @Test fun shouldInterceptTouchEvent_dozingAndPulsing_touchIntercepted() { // GIVEN dozing whenever(sysuiStatusBarStateController.isDozing).thenReturn(true) // AND pulsing whenever(dozeServiceHost.isPulsing()).thenReturn(true) // AND status bar doesn't want it whenever(statusBarKeyguardViewManager.shouldInterceptTouchEvent(DOWN_EVENT)) .thenReturn(false) // AND shade is not fully expanded whenever(notificationPanelViewController.isFullyExpanded()).thenReturn(false) // AND the lock icon does NOT want the touch whenever(lockIconViewController.willHandleTouchWhileDozing(DOWN_EVENT)).thenReturn(false) // AND quick settings controller DOES want it whenever(quickSettingsController.shouldQuickSettingsIntercept(any(), any(), any())) .thenReturn(true) // AND bouncer is not showing whenever(centralSurfaces.isBouncerShowing()).thenReturn(false) // AND panel view controller wants it whenever(notificationPanelViewController.handleExternalInterceptTouch(DOWN_EVENT)) .thenReturn(true) mSetFlagsRule.enableFlags(Flags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT) // THEN touch should be intercepted by NotificationShade assertThat(interactionEventHandler.shouldInterceptTouchEvent(DOWN_EVENT)).isTrue() } Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionInteractorTest.kt +10 −1 Original line number Diff line number Diff line Loading @@ -197,7 +197,16 @@ class KeyguardTransitionInteractorTest : SysuiTestCase() { runCurrent() } assertThat(startedSteps).isEqualTo(listOf(steps[0], steps[3], steps[6])) assertThat(startedSteps) .isEqualTo( listOf( // The initial transition will also get sent when collect started TransitionStep(OFF, LOCKSCREEN, 0f, STARTED), steps[0], steps[3], steps[6] ) ) } @Test Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/PrimaryBouncerToGoneTransitionViewModelTest.kt +10 −6 Original line number Diff line number Diff line Loading @@ -119,15 +119,19 @@ class PrimaryBouncerToGoneTransitionViewModelTest : SysuiTestCase() { fun lockscreenAlpha_runDimissFromKeyguard() = testScope.runTest { val values by collectValues(underTest.lockscreenAlpha) runCurrent() sysuiStatusBarStateController.setLeaveOpenOnKeyguardHide(true) runCurrent() keyguardTransitionRepository.sendTransitionStep(step(0f, TransitionState.STARTED)) keyguardTransitionRepository.sendTransitionStep(step(1f)) keyguardTransitionRepository.sendTransitionSteps( from = KeyguardState.PRIMARY_BOUNCER, to = KeyguardState.GONE, testScope, ) assertThat(values.size).isEqualTo(2) values.forEach { assertThat(it).isEqualTo(1f) } assertThat(values[0]).isEqualTo(1f) assertThat(values[1]).isEqualTo(1f) // Ensure FINISHED sets alpha to 0 assertThat(values[2]).isEqualTo(0f) } @Test Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/PrimaryBouncerToGoneTransitionViewModel.kt +1 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,7 @@ constructor( 0f } }, onFinish = { 0f }, ) } Loading
packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java +6 −0 Original line number Diff line number Diff line Loading @@ -511,6 +511,12 @@ public class NotificationShadeWindowViewController implements Dumpable { return true; } } } else if (migrateClocksToBlueprint()) { // This final check handles swipes on HUNs and when Pulsing if (!bouncerShowing && didNotificationPanelInterceptEvent(ev)) { mShadeLogger.d("NSWVC: intercepted for HUN/PULSING"); return true; } } return false; } Loading
packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewControllerTest.kt +30 −2 Original line number Diff line number Diff line Loading @@ -450,7 +450,7 @@ class NotificationShadeWindowViewControllerTest : SysuiTestCase() { mSetFlagsRule.enableFlags(Flags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT) // THEN touch should NOT be intercepted by NotificationShade // THEN touch should be intercepted by NotificationShade assertThat(interactionEventHandler.shouldInterceptTouchEvent(DOWN_EVENT)).isTrue() } Loading @@ -469,7 +469,35 @@ class NotificationShadeWindowViewControllerTest : SysuiTestCase() { mSetFlagsRule.enableFlags(Flags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT) // THEN touch should NOT be intercepted by NotificationShade // THEN touch should be intercepted by NotificationShade assertThat(interactionEventHandler.shouldInterceptTouchEvent(DOWN_EVENT)).isTrue() } @Test fun shouldInterceptTouchEvent_dozingAndPulsing_touchIntercepted() { // GIVEN dozing whenever(sysuiStatusBarStateController.isDozing).thenReturn(true) // AND pulsing whenever(dozeServiceHost.isPulsing()).thenReturn(true) // AND status bar doesn't want it whenever(statusBarKeyguardViewManager.shouldInterceptTouchEvent(DOWN_EVENT)) .thenReturn(false) // AND shade is not fully expanded whenever(notificationPanelViewController.isFullyExpanded()).thenReturn(false) // AND the lock icon does NOT want the touch whenever(lockIconViewController.willHandleTouchWhileDozing(DOWN_EVENT)).thenReturn(false) // AND quick settings controller DOES want it whenever(quickSettingsController.shouldQuickSettingsIntercept(any(), any(), any())) .thenReturn(true) // AND bouncer is not showing whenever(centralSurfaces.isBouncerShowing()).thenReturn(false) // AND panel view controller wants it whenever(notificationPanelViewController.handleExternalInterceptTouch(DOWN_EVENT)) .thenReturn(true) mSetFlagsRule.enableFlags(Flags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT) // THEN touch should be intercepted by NotificationShade assertThat(interactionEventHandler.shouldInterceptTouchEvent(DOWN_EVENT)).isTrue() } Loading