diff options
author | Jeff Brown <jeffbrown@google.com> | 2010-12-08 15:32:37 -0800 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2010-12-08 18:29:08 -0800 |
commit | 52715a7c10eeb798692ffdb4bc8c4305cb0aa705 (patch) | |
tree | c0a13595d467d7629abdd938e27d0bcd8a2c3780 /core | |
parent | 77019fa4f9e74c0630effd9daaf13f977550e4ed (diff) | |
download | frameworks_base-52715a7c10eeb798692ffdb4bc8c4305cb0aa705.zip frameworks_base-52715a7c10eeb798692ffdb4bc8c4305cb0aa705.tar.gz frameworks_base-52715a7c10eeb798692ffdb4bc8c4305cb0aa705.tar.bz2 |
Fix a regression in clearMetaKeyState.
Bug: 3267519
Change-Id: Ibbc7d4e38ef3208b9ece09566e44e8421866ab95
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/text/method/MetaKeyKeyListener.java | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/core/java/android/text/method/MetaKeyKeyListener.java b/core/java/android/text/method/MetaKeyKeyListener.java index 923a555..0a097f9 100644 --- a/core/java/android/text/method/MetaKeyKeyListener.java +++ b/core/java/android/text/method/MetaKeyKeyListener.java @@ -105,10 +105,6 @@ public abstract class MetaKeyKeyListener { */ public static final int META_SELECTING = KeyEvent.META_SELECTING; - private static final int META_SHIFT_ON_AND_LOCKED = META_SHIFT_ON | META_CAP_LOCKED; - private static final int META_ALT_ON_AND_LOCKED = META_ALT_ON | META_ALT_LOCKED; - private static final int META_SYM_ON_AND_LOCKED = META_SYM_ON | META_SYM_LOCKED; - // These bits are privately used by the meta key key listener. // They are deliberately assigned values outside of the representable range of an 'int' // so as not to conflict with any meta key states publicly defined by KeyEvent. @@ -565,13 +561,13 @@ public abstract class MetaKeyKeyListener { * {@link #META_ALT_ON} or {@link #META_SYM_ON}. */ public long clearMetaKeyState(long state, int which) { - if ((which & META_SHIFT_ON_AND_LOCKED) == META_SHIFT_ON_AND_LOCKED) { + if ((which & META_SHIFT_ON) != 0 && (state & META_CAP_LOCKED) != 0) { state &= ~META_SHIFT_MASK; } - if ((which & META_ALT_ON_AND_LOCKED) == META_ALT_ON_AND_LOCKED) { + if ((which & META_ALT_ON) != 0 && (state & META_ALT_LOCKED) != 0) { state &= ~META_ALT_MASK; } - if ((which & META_SYM_ON_AND_LOCKED) == META_SYM_ON_AND_LOCKED) { + if ((which & META_SYM_ON) != 0 && (state & META_SYM_LOCKED) != 0) { state &= ~META_SYM_MASK; } return state; |