From efa2dbaccc31f4ad416d627d2fa480b390bf400a Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Mon, 19 Jun 2017 13:30:09 -0700 Subject: Ensure single-click action occurs when long-click in accessibility mode. When the device is NOT in accessibility mode, pressing down on a keypad button first triggers the single-click callback, and then the long-click. In accessibility mode, only the long-click callback would be fired. Fixing by first calling the single click callback prior to performing the long click. Test: Manual Bug: 62356464\ Change-Id: I404d6e848b259c785a23d863234e7911e4a571b4 --- src/com/android/phone/common/dialpad/DialpadKeyButton.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/android/phone/common/dialpad/DialpadKeyButton.java b/src/com/android/phone/common/dialpad/DialpadKeyButton.java index 8762914..f2458cc 100644 --- a/src/com/android/phone/common/dialpad/DialpadKeyButton.java +++ b/src/com/android/phone/common/dialpad/DialpadKeyButton.java @@ -171,6 +171,10 @@ public class DialpadKeyButton extends FrameLayout { case MotionEvent.ACTION_HOVER_EXIT: if (mHoverBounds.contains(event.getX(), event.getY())) { if (mLongHovered) { + // In accessibility mode the long press will not automatically cause + // the short press to fire for the button, so we will fire it now to + // emulate the same behavior (this is important for the 0 button). + simulateClickForAccessibility(); performLongClick(); } else { simulateClickForAccessibility(); -- cgit v1.2.3