diff options
author | 2014-08-04 04:13:05 +0000 | |
---|---|---|
committer | 2014-08-04 04:13:05 +0000 | |
commit | 053352f283c77ae51e02ad2881a9b11017b85fe8 (patch) | |
tree | 34736ad8c8c9cb2a5b00f0cd7d3c4a7a02139bc4 /java/src/com/android/inputmethod/event/Event.java | |
parent | 530845cb5e03be07badba2a56e567519ae16bd60 (diff) | |
parent | d9e41aac3fdf6e81ed7f2487cd9c74c28734a5e2 (diff) | |
download | latinime-053352f283c77ae51e02ad2881a9b11017b85fe8.tar.gz latinime-053352f283c77ae51e02ad2881a9b11017b85fe8.tar.xz latinime-053352f283c77ae51e02ad2881a9b11017b85fe8.zip |
am d9e41aac: am 85b7b967: Merge "[HW12] Use the consumed status of the Event." into lmp-dev
* commit 'd9e41aac3fdf6e81ed7f2487cd9c74c28734a5e2':
[HW12] Use the consumed status of the Event.
Diffstat (limited to 'java/src/com/android/inputmethod/event/Event.java')
-rw-r--r-- | java/src/com/android/inputmethod/event/Event.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/event/Event.java b/java/src/com/android/inputmethod/event/Event.java index 98c827423..f02f7885a 100644 --- a/java/src/com/android/inputmethod/event/Event.java +++ b/java/src/com/android/inputmethod/event/Event.java @@ -227,6 +227,7 @@ public class Event { * @return an identical event marked as consumed. */ public static Event createConsumedEvent(final Event source) { + // A consumed event should not input any text at all, so we pass the empty string as text. return new Event(source.mEventType, source.mText, source.mCodePoint, source.mKeyCode, source.mX, source.mY, source.mSuggestedWordInfo, source.mFlags | FLAG_CONSUMED, source.mNextEvent); @@ -267,6 +268,9 @@ public class Event { } public CharSequence getTextToCommit() { + if (isConsumed()) { + return ""; // A consumed event should input no text. + } switch (mEventType) { case EVENT_TYPE_MODE_KEY: case EVENT_TYPE_NOT_HANDLED: |