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

Commit 5a0f7b1c authored by Vadim Tryshev's avatar Vadim Tryshev Committed by Android (Google) Code Review
Browse files

Merge "More diags for b/129434166" into ub-launcher3-master

parents 3e987961 423bf62e
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -33,12 +33,20 @@ public class CheckLongPressHelper {

    class CheckForLongPress implements Runnable {
        public void run() {
            if (com.android.launcher3.TestProtocol.sDebugTracing) {
                android.util.Log.d(com.android.launcher3.TestProtocol.NO_DRAG_TAG,
                        "CheckForLongPress1");
            }
            if ((mView.getParent() != null) && mView.hasWindowFocus()
                    && !mHasPerformedLongPress) {
                boolean handled;
                if (mListener != null) {
                    handled = mListener.onLongClick(mView);
                } else {
                    if (com.android.launcher3.TestProtocol.sDebugTracing) {
                        android.util.Log.d(com.android.launcher3.TestProtocol.NO_DRAG_TAG,
                                "CheckForLongPress2");
                    }
                    handled = mView.performLongClick();
                }
                if (handled) {
@@ -73,11 +81,20 @@ public class CheckLongPressHelper {
        }
        mView.postDelayed(mPendingCheckForLongPress,
                (long) (ViewConfiguration.getLongPressTimeout() * mLongPressTimeoutFactor));
        if (com.android.launcher3.TestProtocol.sDebugTracing) {
            android.util.Log.d(com.android.launcher3.TestProtocol.NO_DRAG_TAG,
                    "postCheckForLongPress: " + ViewConfiguration.getLongPressTimeout() + " "
                            + mLongPressTimeoutFactor);
        }
    }

    public void cancelLongPress() {
        mHasPerformedLongPress = false;
        if (mPendingCheckForLongPress != null) {
            if (com.android.launcher3.TestProtocol.sDebugTracing) {
                android.util.Log.d(com.android.launcher3.TestProtocol.NO_DRAG_TAG,
                        "cancelLongPress");
            }
            mView.removeCallbacks(mPendingCheckForLongPress);
            mPendingCheckForLongPress = null;
        }