summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2017-06-19 13:30:09 -0700
committerTyler Gunn <tgunn@google.com>2017-06-19 13:30:09 -0700
commitefa2dbaccc31f4ad416d627d2fa480b390bf400a (patch)
tree1d0c47daa909d1f8ce3d0b563c66ab6e3df4880e
parent38cd20535532c5cb397c71b39fd902d9071827bf (diff)
downloadpackages_apps_PhoneCommon-efa2dbaccc31f4ad416d627d2fa480b390bf400a.tar.gz
packages_apps_PhoneCommon-efa2dbaccc31f4ad416d627d2fa480b390bf400a.tar.bz2
packages_apps_PhoneCommon-efa2dbaccc31f4ad416d627d2fa480b390bf400a.zip
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
-rw-r--r--src/com/android/phone/common/dialpad/DialpadKeyButton.java4
1 files changed, 4 insertions, 0 deletions
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();