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

Commit c6b775cd authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Allow moving shade window from workspace swipe even when SceneContainer...

Merge "Allow moving shade window from workspace swipe even when SceneContainer is disabled." into main
parents ece6cd58 f35b0432
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -289,7 +289,7 @@ public class LauncherProxyService implements CallbackController<LauncherProxyLis

        @VisibleForTesting
        public void moveShadeWindowIfNeeded(MotionEvent event) {
            if (ShadeWindowGoesAround.isEnabled() && SceneContainerFlag.isEnabled()) {
            if (ShadeWindowGoesAround.isEnabled()) {
                Trace.beginSection("LauncherProxyService#moveShadeWindowIfNeeded");
                // TODO: b/407496148 - Refactor to use DisplayMetricsRepository instead
                final DisplayInfo displayInfo = new DisplayInfo();
+21 −6
Original line number Diff line number Diff line
@@ -419,14 +419,29 @@ class LauncherProxyServiceTest : SysuiTestCase() {
                }

            subject.mSysUiProxy.onStatusBarTouchEvent(event)
            verify(statusBarShadeDisplayPolicy, never())
                .onStatusBarOrLauncherTouched(
                    argThat<MotionEvent> { displayId == event.displayId },
                    anyInt(),
                )

            verify(shadeViewController, never()).startExpandLatencyTracking()
        }

    @Test
    @EnableFlags(Flags.FLAG_SHADE_WINDOW_GOES_AROUND)
    @DisableFlags(Flags.FLAG_SCENE_CONTAINER, Flags.FLAG_KEYGUARD_WM_STATE_REFACTOR)
    fun onStatusBarTouchEvent_withoutSceneFlag_dispatchesToShadeDisplayPolicy() =
        kosmos.testScope.runTest {
            val shadeDisplayId = 1
            whenever(statusBarShadeDisplayPolicy.displayId)
                .thenReturn(MutableStateFlow(shadeDisplayId))

            val event =
                MotionEvent.obtain(500, 500, MotionEvent.ACTION_DOWN, 500f, 500f, 0).apply {
                    displayId = 0
                }

            subject.mSysUiProxy.onStatusBarTouchEvent(event)
            verify(statusBarShadeDisplayPolicy)
                .onStatusBarOrLauncherTouched(argThat<MotionEvent> { displayId == 0 }, anyInt())
        }

    @Test
    @EnableFlags(Flags.FLAG_SHADE_WINDOW_GOES_AROUND)
    @DisableFlags(Flags.FLAG_SCENE_CONTAINER, Flags.FLAG_KEYGUARD_WM_STATE_REFACTOR)
@@ -442,7 +457,7 @@ class LauncherProxyServiceTest : SysuiTestCase() {
                }

            subject.mSysUiProxy.onStatusBarTouchEvent(event)
            verify(statusBarShadeDisplayPolicy, never())
            verify(statusBarShadeDisplayPolicy)
                .onStatusBarOrLauncherTouched(
                    argThat<MotionEvent> { displayId == shadeDisplayId },
                    anyInt(),