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

Commit 7a7f4075 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Prevent 3 button layout from dragging buttons"

parents 30aa4d3c d04676df
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);