diff options
Diffstat (limited to 'core')
| -rw-r--r-- | core/java/android/view/View.java | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 30531ed..8f8f9c6 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -8008,7 +8008,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, public boolean onKeyDown(int keyCode, KeyEvent event) { boolean result = false; - if (KeyEvent.isConfirmKey(event.getKeyCode())) { + if (KeyEvent.isConfirmKey(keyCode)) { if ((mViewFlags & ENABLED_MASK) == DISABLED) { return true; } @@ -8050,28 +8050,21 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @param event The KeyEvent object that defines the button action. */ public boolean onKeyUp(int keyCode, KeyEvent event) { - boolean result = false; - - switch (keyCode) { - case KeyEvent.KEYCODE_DPAD_CENTER: - case KeyEvent.KEYCODE_ENTER: { - if ((mViewFlags & ENABLED_MASK) == DISABLED) { - return true; - } - if ((mViewFlags & CLICKABLE) == CLICKABLE && isPressed()) { - setPressed(false); - - if (!mHasPerformedLongPress) { - // This is a tap, so remove the longpress check - removeLongPressCallback(); + if (KeyEvent.isConfirmKey(keyCode)) { + if ((mViewFlags & ENABLED_MASK) == DISABLED) { + return true; + } + if ((mViewFlags & CLICKABLE) == CLICKABLE && isPressed()) { + setPressed(false); - result = performClick(); - } + if (!mHasPerformedLongPress) { + // This is a tap, so remove the longpress check + removeLongPressCallback(); + return performClick(); } - break; } } - return result; + return false; } /** |
