From 759f771a8d33de5780812ac0da0c46ba23830fc3 Mon Sep 17 00:00:00 2001 From: vadimt Date: Fri, 8 May 2020 13:15:34 -0700 Subject: [PATCH] Generating a long-press even only when it's expected I'm pretty sure that accidental long-presses are a result of fundamental flaws in UIAutomator. The fix is tracked separately and is unlikely to happen at all. For now, just placing the generation under a condition. Bug: 156113558 Change-Id: I8f369f934f9f576cf672b7fa98fbc9a63135602b --- src/com/android/launcher3/touch/WorkspaceTouchListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/launcher3/touch/WorkspaceTouchListener.java b/src/com/android/launcher3/touch/WorkspaceTouchListener.java index da631bd293..e6de06d6f0 100644 --- a/src/com/android/launcher3/touch/WorkspaceTouchListener.java +++ b/src/com/android/launcher3/touch/WorkspaceTouchListener.java @@ -167,8 +167,8 @@ public class WorkspaceTouchListener extends GestureDetector.SimpleOnGestureListe @Override public void onLongPress(MotionEvent event) { - TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "Workspace.longPress"); if (mLongPressState == STATE_REQUESTED) { + TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "Workspace.longPress"); if (canHandleLongPress()) { mLongPressState = STATE_PENDING_PARENT_INFORM; mWorkspace.getParent().requestDisallowInterceptTouchEvent(true);