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

Commit d4e3361a authored by Matt Pietal's avatar Matt Pietal
Browse files

Fix hun/pulsing swipes

This edge case was previously unhandle by the migration
code. Now give NotificationPanelViewController a chance
to process this touch event.

Fixes: 325463381
Test: atest NotificationShadeWindowViewControllerTest
Flag: ACONFIG com.android.systemui.migrate_clocks_to_blueprint
DEVELOPMENT

Change-Id: Ic69c3c1c1e1c015e21b5e328efc85715e03b36f1
parent 9e73f1db
Loading
Loading
Loading
Loading
+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()
    }