From b3e2cd3d88693710234ed65393b5e567e85094cc Mon Sep 17 00:00:00 2001 From: vadimt Date: Tue, 16 Apr 2019 11:25:22 -0700 Subject: [PATCH] Fixing icon dragging Bug: 129434166 Change-Id: Id2e5509dbfbdb76ec868ca6117c2a0c0d5233404 --- .../com/android/launcher3/tapl/LauncherInstrumentation.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index 549212272c..876afcc9de 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -598,11 +598,12 @@ public final class LauncherInstrumentation { void movePointer(long downTime, long duration, Point from, Point to) { final Point point = new Point(); + final long startTime = SystemClock.uptimeMillis(); for (; ; ) { sleep(16); final long currentTime = SystemClock.uptimeMillis(); - final float progress = (currentTime - downTime) / (float) duration; + final float progress = (currentTime - startTime) / (float) duration; if (progress > 1) return; point.x = from.x + (int) (progress * (to.x - from.x));