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

Commit 7056e2d2 authored by Vinit Nayak's avatar Vinit Nayak Committed by Android (Google) Code Review
Browse files

Merge "Add logs for move pointer" into main

parents 5fc3b8ca b39abc99
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -158,6 +158,7 @@ public final class TestProtocol {
    public static final String PERMANENT_DIAG_TAG = "TaplTarget";
    public static final String TWO_TASKBAR_LONG_CLICKS = "b/262282528";
    public static final String ICON_MISSING = "b/282963545";
    public static final String WORKSPACE_LONG_PRESS = "b/311099513";

    public static final String REQUEST_EMULATE_DISPLAY = "emulate-display";
    public static final String REQUEST_STOP_EMULATE_DISPLAY = "stop-emulate-display";
+7 −0
Original line number Diff line number Diff line
@@ -28,6 +28,8 @@ import static com.android.launcher3.tapl.Folder.FOLDER_CONTENT_RES_ID;
import static com.android.launcher3.tapl.TestHelpers.getOverviewPackageName;
import static com.android.launcher3.testing.shared.TestProtocol.NORMAL_STATE_ORDINAL;
import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_NUM_ALL_APPS_COLUMNS;
import static com.android.launcher3.testing.shared.TestProtocol.WORKSPACE_LONG_PRESS;
import static com.android.launcher3.testing.shared.TestProtocol.testLogD;

import android.app.ActivityManager;
import android.app.Instrumentation;
@@ -1705,6 +1707,7 @@ public final class LauncherInstrumentation {
        final Point start = new Point(startX, startY);
        final Point end = new Point(endX, endY);
        sendPointer(downTime, downTime, MotionEvent.ACTION_DOWN, start, gestureScope);
        testLogD(WORKSPACE_LONG_PRESS, "Sent ACTION_DOWN");
        if (mTrackpadGestureType != TrackpadGestureType.NONE) {
            sendPointer(downTime, downTime, getPointerAction(MotionEvent.ACTION_POINTER_DOWN, 1),
                    start, gestureScope);
@@ -1909,6 +1912,10 @@ public final class LauncherInstrumentation {
        long steps = duration / GESTURE_STEP_MS;

        long currentTime = startTime;
        testLogD(WORKSPACE_LONG_PRESS, "movingPointer" +
                " downTime: " + downTime + " startTime: " + startTime +
                " duration: " + duration + " isDecel? " + isDecelerating +
                " gestureScope: " + gestureScope);

        if (isDecelerating) {
            // formula: V = V0 - D*T, assuming V = 0 when T = duration