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

Commit d04676df authored by Matthew Ng's avatar Matthew Ng
Browse files

Prevent 3 button layout from dragging buttons

When disabling swipe up gestures in settings, the gesture detection was
still occurring over 3 buttons. Prevent it from running.

Change-Id: Ia5c4460a3c21753f9ae2a233cb040a2c0ff98480
Fixes: 120502667
Test: atest QuickStepControllerTest
parent ea6dcec9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -185,6 +185,7 @@ public class QuickStepController implements GestureHelper {

        // Requires proxy and an active gesture or able to perform any gesture to continue
        if (mOverviewEventSender.getProxy() == null
                || !mOverviewEventSender.shouldShowSwipeUpUI()
                || (mCurrentAction == null && !canPerformAnyAction())) {
            return deadZoneConsumed;
        }
+13 −0
Original line number Diff line number Diff line
@@ -78,6 +78,7 @@ public class QuickStepControllerTest extends SysuiTestCase {
        mProxyService = mock(OverviewProxyService.class);
        mProxy = mock(IOverviewProxy.Stub.class);
        doReturn(mProxy).when(mProxyService).getProxy();
        doReturn(true).when(mProxyService).shouldShowSwipeUpUI();
        mDependency.injectTestDependency(OverviewProxyService.class, mProxyService);

        mStatusBar = mock(StatusBar.class);
@@ -105,6 +106,18 @@ public class QuickStepControllerTest extends SysuiTestCase {
        assertNull(mController.getCurrentAction());
    }

    @Test
    public void testNoGesturesWhenSwipeUpDisabled() throws Exception {
        doReturn(false).when(mProxyService).shouldShowSwipeUpUI();
        mController.setGestureActions(mockAction(true), null /* swipeDownAction */,
                null /* swipeLeftAction */, null /* swipeRightAction */);

        MotionEvent ev = event(MotionEvent.ACTION_DOWN, 1, 1);
        assertFalse(mController.onInterceptTouchEvent(ev));
        verify(mNavigationBarView, never()).requestUnbufferedDispatch(ev);
        assertNull(mController.getCurrentAction());
    }

    @Test
    public void testHasActionDetectGesturesTouchdown() throws Exception {
        MotionEvent ev = event(MotionEvent.ACTION_DOWN, 1, 1);