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

Commit 6b62f28e authored by Tony Wickham's avatar Tony Wickham Committed by android-build-merger
Browse files

Fix quick switch test gesture in landscape 2-button mode

am: a0f77c44

Change-Id: I998081a53a94ff3b1559a7e77d4d470056cfab00
parents 36d7be7f a0f77c44
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -248,6 +248,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
    @Test
    @NavigationModeSwitch
    @PortraitLandscape
    @Ignore("Temporarily disabled b/140252765")
    public void testQuickSwitchFromApp() throws Exception {
        startAppFast(getAppPackageName());
        startTestActivity(2);
+21 −7
Original line number Diff line number Diff line
@@ -137,15 +137,29 @@ public class Background extends LauncherInstrumentation.VisibleContainer {
    }

    protected void quickSwitchToPreviousApp(int expectedState) {
        boolean transposeInLandscape = false;
        switch (mLauncher.getNavigationModel()) {
            case ZERO_BUTTON:
            case TWO_BUTTON:
                transposeInLandscape = true;
                // Fall through, zero button and two button modes behave the same.
            case TWO_BUTTON: {
            case ZERO_BUTTON: {
                final int startX;
                final int startY;
                final int endX;
                final int endY;
                if (mLauncher.getDevice().isNaturalOrientation() || !transposeInLandscape) {
                    // Swipe from the bottom left to the bottom right of the screen.
                final int startX = 0;
                final int startY = getSwipeStartY();
                final int endX = mLauncher.getDevice().getDisplayWidth();
                final int endY = startY;
                    startX = 0;
                    startY = getSwipeStartY();
                    endX = mLauncher.getDevice().getDisplayWidth();
                    endY = startY;
                } else {
                    // Swipe from the bottom right to the top right of the screen.
                    startX = getSwipeStartX();
                    startY = mLauncher.getRealDisplaySize().y - 1;
                    endX = startX;
                    endY = 0;
                }
                mLauncher.swipeToState(startX, startY, endX, endY, 20, expectedState);
                break;
            }