Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c440b499 authored by Matt Pietal's avatar Matt Pietal Committed by Android (Google) Code Review
Browse files

Merge changes I7320f818,Ic69c3c1c into main

* changes:
  Fix clock flicker after unlock
  Fix hun/pulsing swipes
parents e83b6021 0c53bc1b
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -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
+10 −6
Original line number Diff line number Diff line
@@ -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
+1 −0
Original line number Diff line number Diff line
@@ -108,6 +108,7 @@ constructor(
                    0f
                }
            },
            onFinish = { 0f },
        )
    }

+6 −0
Original line number Diff line number Diff line
@@ -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;
            }
+30 −2
Original line number Diff line number Diff line
@@ -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()
    }

@@ -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