Loading src/com/android/launcher3/Launcher.java +13 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,7 @@ import android.view.KeyboardShortcutGroup; import android.view.KeyboardShortcutInfo; import android.view.LayoutInflater; import android.view.Menu; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.view.accessibility.AccessibilityEvent; Loading Loading @@ -121,6 +122,7 @@ import com.android.launcher3.popup.PopupDataProvider; import com.android.launcher3.popup.SystemShortcut; import com.android.launcher3.qsb.QsbContainerView; import com.android.launcher3.states.RotationHelper; import com.android.launcher3.testing.TestLogging; import com.android.launcher3.testing.TestProtocol; import com.android.launcher3.touch.AllAppsSwipeController; import com.android.launcher3.touch.ItemClickHandler; Loading Loading @@ -1778,9 +1780,20 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, @Override public boolean dispatchKeyEvent(KeyEvent event) { if (Utilities.IS_RUNNING_IN_TEST_HARNESS) { TestLogging.recordEvent("Key event: " + event); } return (event.getKeyCode() == KeyEvent.KEYCODE_HOME) || super.dispatchKeyEvent(event); } @Override public boolean dispatchTouchEvent(MotionEvent ev) { if (Utilities.IS_RUNNING_IN_TEST_HARNESS && ev.getAction() != MotionEvent.ACTION_MOVE) { TestLogging.recordEvent("Touch event: " + ev); } return super.dispatchTouchEvent(ev); } @Override public void onBackPressed() { if (finishAutoCancelActionMode()) { Loading tests/tapl/com/android/launcher3/tapl/AllAppsFromOverview.java +2 −1 Original line number Diff line number Diff line Loading @@ -56,7 +56,8 @@ public final class AllAppsFromOverview extends AllApps { final int endY = start.y + swipeHeight; LauncherInstrumentation.log("AllAppsFromOverview.switchBackToOverview before swipe"); mLauncher.swipeToState(start.x, start.y, start.x, endY, 60, OVERVIEW_STATE_ORDINAL); mLauncher.swipeToState(start.x, start.y, start.x, endY, 60, OVERVIEW_STATE_ORDINAL, LauncherInstrumentation.GestureScope.INSIDE); try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer("swiped down")) { return new Overview(mLauncher); Loading tests/tapl/com/android/launcher3/tapl/Background.java +22 −5 Original line number Diff line number Diff line Loading @@ -62,6 +62,10 @@ public class Background extends LauncherInstrumentation.VisibleContainer { } } protected boolean zeroButtonToOverviewGestureStartsInLauncher() { return false; } protected void goToOverviewUnchecked() { switch (mLauncher.getNavigationModel()) { case ZERO_BUTTON: { Loading @@ -74,19 +78,26 @@ public class Background extends LauncherInstrumentation.VisibleContainer { new Point(centerX, startY - swipeHeight - mLauncher.getTouchSlop()); final long downTime = SystemClock.uptimeMillis(); mLauncher.sendPointer(downTime, downTime, MotionEvent.ACTION_DOWN, start); final LauncherInstrumentation.GestureScope gestureScope = zeroButtonToOverviewGestureStartsInLauncher() ? LauncherInstrumentation.GestureScope.INSIDE_TO_OUTSIDE : LauncherInstrumentation.GestureScope.OUTSIDE; mLauncher.sendPointer( downTime, downTime, MotionEvent.ACTION_DOWN, start, gestureScope); mLauncher.executeAndWaitForEvent( () -> mLauncher.movePointer( downTime, downTime, ZERO_BUTTON_SWIPE_UP_GESTURE_DURATION, start, end), end, gestureScope), event -> TestProtocol.PAUSE_DETECTED_MESSAGE.equals(event.getClassName()), () -> "Pause wasn't detected"); mLauncher.runToState( () -> mLauncher.sendPointer( downTime, SystemClock.uptimeMillis(), MotionEvent.ACTION_UP, end), downTime, SystemClock.uptimeMillis(), MotionEvent.ACTION_UP, end, gestureScope), OVERVIEW_STATE_ORDINAL); break; } Loading @@ -109,7 +120,8 @@ public class Background extends LauncherInstrumentation.VisibleContainer { startY = endY = mLauncher.getDevice().getDisplayHeight() / 2; } mLauncher.swipeToState(startX, startY, endX, endY, 10, OVERVIEW_STATE_ORDINAL); mLauncher.swipeToState(startX, startY, endX, endY, 10, OVERVIEW_STATE_ORDINAL, LauncherInstrumentation.GestureScope.OUTSIDE); break; } Loading Loading @@ -162,7 +174,12 @@ public class Background extends LauncherInstrumentation.VisibleContainer { endX = startX; endY = 0; } mLauncher.swipeToState(startX, startY, endX, endY, 20, expectedState); mLauncher.swipeToState(startX, startY, endX, endY, 20, expectedState, mLauncher.getNavigationModel() == LauncherInstrumentation.NavigationModel.ZERO_BUTTON ? LauncherInstrumentation.GestureScope.INSIDE_TO_OUTSIDE : LauncherInstrumentation.GestureScope.OUTSIDE ); break; } Loading tests/tapl/com/android/launcher3/tapl/BaseOverview.java +2 −1 Original line number Diff line number Diff line Loading @@ -82,7 +82,8 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { flingForwardImpl(); } mLauncher.waitForObjectInContainer(verifyActiveContainer(), clearAllSelector).click(); mLauncher.clickLauncherObject( mLauncher.waitForObjectInContainer(verifyActiveContainer(), clearAllSelector)); } } Loading tests/tapl/com/android/launcher3/tapl/Home.java +5 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,11 @@ public abstract class Home extends Background { } } @Override protected boolean zeroButtonToOverviewGestureStartsInLauncher() { return true; } @Override protected int getExpectedStateForQuickSwitch() { return QUICK_SWITCH_STATE_ORDINAL; Loading Loading
src/com/android/launcher3/Launcher.java +13 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,7 @@ import android.view.KeyboardShortcutGroup; import android.view.KeyboardShortcutInfo; import android.view.LayoutInflater; import android.view.Menu; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.view.accessibility.AccessibilityEvent; Loading Loading @@ -121,6 +122,7 @@ import com.android.launcher3.popup.PopupDataProvider; import com.android.launcher3.popup.SystemShortcut; import com.android.launcher3.qsb.QsbContainerView; import com.android.launcher3.states.RotationHelper; import com.android.launcher3.testing.TestLogging; import com.android.launcher3.testing.TestProtocol; import com.android.launcher3.touch.AllAppsSwipeController; import com.android.launcher3.touch.ItemClickHandler; Loading Loading @@ -1778,9 +1780,20 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, @Override public boolean dispatchKeyEvent(KeyEvent event) { if (Utilities.IS_RUNNING_IN_TEST_HARNESS) { TestLogging.recordEvent("Key event: " + event); } return (event.getKeyCode() == KeyEvent.KEYCODE_HOME) || super.dispatchKeyEvent(event); } @Override public boolean dispatchTouchEvent(MotionEvent ev) { if (Utilities.IS_RUNNING_IN_TEST_HARNESS && ev.getAction() != MotionEvent.ACTION_MOVE) { TestLogging.recordEvent("Touch event: " + ev); } return super.dispatchTouchEvent(ev); } @Override public void onBackPressed() { if (finishAutoCancelActionMode()) { Loading
tests/tapl/com/android/launcher3/tapl/AllAppsFromOverview.java +2 −1 Original line number Diff line number Diff line Loading @@ -56,7 +56,8 @@ public final class AllAppsFromOverview extends AllApps { final int endY = start.y + swipeHeight; LauncherInstrumentation.log("AllAppsFromOverview.switchBackToOverview before swipe"); mLauncher.swipeToState(start.x, start.y, start.x, endY, 60, OVERVIEW_STATE_ORDINAL); mLauncher.swipeToState(start.x, start.y, start.x, endY, 60, OVERVIEW_STATE_ORDINAL, LauncherInstrumentation.GestureScope.INSIDE); try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer("swiped down")) { return new Overview(mLauncher); Loading
tests/tapl/com/android/launcher3/tapl/Background.java +22 −5 Original line number Diff line number Diff line Loading @@ -62,6 +62,10 @@ public class Background extends LauncherInstrumentation.VisibleContainer { } } protected boolean zeroButtonToOverviewGestureStartsInLauncher() { return false; } protected void goToOverviewUnchecked() { switch (mLauncher.getNavigationModel()) { case ZERO_BUTTON: { Loading @@ -74,19 +78,26 @@ public class Background extends LauncherInstrumentation.VisibleContainer { new Point(centerX, startY - swipeHeight - mLauncher.getTouchSlop()); final long downTime = SystemClock.uptimeMillis(); mLauncher.sendPointer(downTime, downTime, MotionEvent.ACTION_DOWN, start); final LauncherInstrumentation.GestureScope gestureScope = zeroButtonToOverviewGestureStartsInLauncher() ? LauncherInstrumentation.GestureScope.INSIDE_TO_OUTSIDE : LauncherInstrumentation.GestureScope.OUTSIDE; mLauncher.sendPointer( downTime, downTime, MotionEvent.ACTION_DOWN, start, gestureScope); mLauncher.executeAndWaitForEvent( () -> mLauncher.movePointer( downTime, downTime, ZERO_BUTTON_SWIPE_UP_GESTURE_DURATION, start, end), end, gestureScope), event -> TestProtocol.PAUSE_DETECTED_MESSAGE.equals(event.getClassName()), () -> "Pause wasn't detected"); mLauncher.runToState( () -> mLauncher.sendPointer( downTime, SystemClock.uptimeMillis(), MotionEvent.ACTION_UP, end), downTime, SystemClock.uptimeMillis(), MotionEvent.ACTION_UP, end, gestureScope), OVERVIEW_STATE_ORDINAL); break; } Loading @@ -109,7 +120,8 @@ public class Background extends LauncherInstrumentation.VisibleContainer { startY = endY = mLauncher.getDevice().getDisplayHeight() / 2; } mLauncher.swipeToState(startX, startY, endX, endY, 10, OVERVIEW_STATE_ORDINAL); mLauncher.swipeToState(startX, startY, endX, endY, 10, OVERVIEW_STATE_ORDINAL, LauncherInstrumentation.GestureScope.OUTSIDE); break; } Loading Loading @@ -162,7 +174,12 @@ public class Background extends LauncherInstrumentation.VisibleContainer { endX = startX; endY = 0; } mLauncher.swipeToState(startX, startY, endX, endY, 20, expectedState); mLauncher.swipeToState(startX, startY, endX, endY, 20, expectedState, mLauncher.getNavigationModel() == LauncherInstrumentation.NavigationModel.ZERO_BUTTON ? LauncherInstrumentation.GestureScope.INSIDE_TO_OUTSIDE : LauncherInstrumentation.GestureScope.OUTSIDE ); break; } Loading
tests/tapl/com/android/launcher3/tapl/BaseOverview.java +2 −1 Original line number Diff line number Diff line Loading @@ -82,7 +82,8 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { flingForwardImpl(); } mLauncher.waitForObjectInContainer(verifyActiveContainer(), clearAllSelector).click(); mLauncher.clickLauncherObject( mLauncher.waitForObjectInContainer(verifyActiveContainer(), clearAllSelector)); } } Loading
tests/tapl/com/android/launcher3/tapl/Home.java +5 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,11 @@ public abstract class Home extends Background { } } @Override protected boolean zeroButtonToOverviewGestureStartsInLauncher() { return true; } @Override protected int getExpectedStateForQuickSwitch() { return QUICK_SWITCH_STATE_ORDINAL; Loading