diff --git a/tests/src/com/android/launcher3/ui/TestViewHelpers.java b/tests/src/com/android/launcher3/ui/TestViewHelpers.java
index 6fa28f1..2116f5e 100644
--- a/tests/src/com/android/launcher3/ui/TestViewHelpers.java
+++ b/tests/src/com/android/launcher3/ui/TestViewHelpers.java
@@ -114,7 +114,8 @@
         Point center = icon.getVisibleCenter();
 
         // Action Down
-        sendPointer(MotionEvent.ACTION_DOWN, center);
+        final long downTime = SystemClock.uptimeMillis();
+        sendPointer(downTime, MotionEvent.ACTION_DOWN, center);
 
         UiObject2 dragLayer = findViewById(R.id.drag_layer);
 
@@ -131,7 +132,7 @@
             } else {
                 moveLocation.y += distanceToMove;
             }
-            movePointer(center, moveLocation);
+            movePointer(downTime, center, moveLocation);
 
             assertNull(findViewById(R.id.deep_shortcuts_container));
         }
@@ -142,19 +143,24 @@
         Point moveLocation = dragLayer.getVisibleCenter();
 
         // Move to center
-        movePointer(center, moveLocation);
-        sendPointer(MotionEvent.ACTION_UP, center);
+        movePointer(downTime, center, moveLocation);
+        sendPointer(downTime, MotionEvent.ACTION_UP, moveLocation);
 
         // Wait until remove target is gone.
         getDevice().wait(Until.gone(getSelectorForId(R.id.delete_target_text)),
                 AbstractLauncherUiTest.DEFAULT_UI_TIMEOUT);
     }
 
-    private static void movePointer(Point from, Point to) {
+    private static void movePointer(long downTime, Point from, Point to) {
         while (!from.equals(to)) {
+            try {
+                Thread.sleep(20);
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+            }
             from.x = getNextMoveValue(to.x, from.x);
             from.y = getNextMoveValue(to.y, from.y);
-            sendPointer(MotionEvent.ACTION_MOVE, from);
+            sendPointer(downTime, MotionEvent.ACTION_MOVE, from);
         }
     }
 
@@ -168,8 +174,8 @@
         }
     }
 
-    public static void sendPointer(int action, Point point) {
-        MotionEvent event = MotionEvent.obtain(SystemClock.uptimeMillis(),
+    public static void sendPointer(long downTime, int action, Point point) {
+        MotionEvent event = MotionEvent.obtain(downTime,
                 SystemClock.uptimeMillis(), action, point.x, point.y, 0);
         getInstrumentation().sendPointerSync(event);
         event.recycle();
diff --git a/tests/tapl/com/android/launcher3/tapl/AllApps.java b/tests/tapl/com/android/launcher3/tapl/AllApps.java
index 19c5047..1ad0037 100644
--- a/tests/tapl/com/android/launcher3/tapl/AllApps.java
+++ b/tests/tapl/com/android/launcher3/tapl/AllApps.java
@@ -70,7 +70,7 @@
                 final UiObject2 navBar = mLauncher.waitForSystemUiObject("navigation_bar_frame");
                 allAppsContainer.setGestureMargins(0, 0, 0, navBar.getVisibleBounds().height() + 1);
             } else {
-                allAppsContainer.setGestureMargins(0, 0, 0, 100);
+                allAppsContainer.setGestureMargins(0, 0, 0, 200);
             }
             final BySelector appIconSelector = AppIcon.getAppIconSelector(appName, mLauncher);
             if (!hasClickableIcon(allAppsContainer, appIconSelector)) {
diff --git a/tests/tapl/com/android/launcher3/tapl/Widgets.java b/tests/tapl/com/android/launcher3/tapl/Widgets.java
index 2de53c3..100a11c 100644
--- a/tests/tapl/com/android/launcher3/tapl/Widgets.java
+++ b/tests/tapl/com/android/launcher3/tapl/Widgets.java
@@ -38,7 +38,7 @@
                 "want to fling forward in widgets")) {
             LauncherInstrumentation.log("Widgets.flingForward enter");
             final UiObject2 widgetsContainer = verifyActiveContainer();
-            widgetsContainer.setGestureMargin(100);
+            widgetsContainer.setGestureMargins(0, 0, 0, 200);
             widgetsContainer.fling(Direction.DOWN,
                     (int) (FLING_SPEED * mLauncher.getDisplayDensity()));
             try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer("flung forward")) {
