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

Commit 74fb544c authored by Vinit Nayak's avatar Vinit Nayak
Browse files

Add logs for workspace long press

Bug: 311099513
Change-Id: Ided5f317ab3c8bb68a099391f39f0e579b17c2c2
parent 7056e2d2
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.launcher3.testing;

import static com.android.launcher3.testing.shared.TestProtocol.WORKSPACE_LONG_PRESS;
import static com.android.launcher3.testing.shared.TestProtocol.testLogD;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;

@@ -135,10 +137,12 @@ public class DebugTestInformationHandler extends TestInformationHandler {
            }

            case TestProtocol.REQUEST_ENABLE_DEBUG_TRACING:
                testLogD(WORKSPACE_LONG_PRESS, "enablingDebugTracing");
                TestProtocol.sDebugTracing = true;
                return response;

            case TestProtocol.REQUEST_DISABLE_DEBUG_TRACING:
                testLogD(WORKSPACE_LONG_PRESS, "disablingDebugTracing");
                TestProtocol.sDebugTracing = false;
                return response;

+11 −0
Original line number Diff line number Diff line
@@ -25,9 +25,11 @@ import static com.android.launcher3.LauncherState.ALL_APPS;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_CLOSE_TAP_OUTSIDE;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_WORKSPACE_LONGPRESS;
import static com.android.launcher3.testing.shared.TestProtocol.WORKSPACE_LONG_PRESS;

import android.graphics.PointF;
import android.graphics.Rect;
import android.util.Log;
import android.view.GestureDetector;
import android.view.HapticFeedbackConstants;
import android.view.MotionEvent;
@@ -39,6 +41,7 @@ import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.CellLayout;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.Utilities;
import com.android.launcher3.Workspace;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.dragndrop.DragLayer;
@@ -109,6 +112,10 @@ public class WorkspaceTouchListener extends GestureDetector.SimpleOnGestureListe
                mTouchDownPoint.set(ev.getX(), ev.getY());
                // Mouse right button's ACTION_DOWN should immediately show menu
                if (TouchUtil.isMouseRightClickDownOrMove(ev)) {
                    if (Utilities.isRunningInTestHarness()) {
                        Log.d(WORKSPACE_LONG_PRESS, "longPress from mouseHandling timeout: +"
                                + ViewConfiguration.getLongPressTimeout());
                    }
                    maybeShowMenu();
                    return true;
                }
@@ -192,6 +199,10 @@ public class WorkspaceTouchListener extends GestureDetector.SimpleOnGestureListe

    @Override
    public void onLongPress(MotionEvent event) {
        if (Utilities.isRunningInTestHarness()) {
            Log.d(WORKSPACE_LONG_PRESS, "longPress from gestureHandler timeout: " +
                    ViewConfiguration.getLongPressTimeout());
        }
        maybeShowMenu();
    }