aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/event/CombinerChain.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-08-04 04:13:05 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-08-04 04:13:05 +0000
commit053352f283c77ae51e02ad2881a9b11017b85fe8 (patch)
tree34736ad8c8c9cb2a5b00f0cd7d3c4a7a02139bc4 /java/src/com/android/inputmethod/event/CombinerChain.java
parent530845cb5e03be07badba2a56e567519ae16bd60 (diff)
parentd9e41aac3fdf6e81ed7f2487cd9c74c28734a5e2 (diff)
downloadlatinime-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/CombinerChain.java')
-rw-r--r--java/src/com/android/inputmethod/event/CombinerChain.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/event/CombinerChain.java b/java/src/com/android/inputmethod/event/CombinerChain.java
index f69bf4fd0..2d2731f21 100644
--- a/java/src/com/android/inputmethod/event/CombinerChain.java
+++ b/java/src/com/android/inputmethod/event/CombinerChain.java
@@ -82,6 +82,13 @@ public class CombinerChain {
}
}
+ private void updateStateFeedback() {
+ mStateFeedback.clear();
+ for (int i = mCombiners.size() - 1; i >= 0; --i) {
+ mStateFeedback.append(mCombiners.get(i).getCombiningStateFeedback());
+ }
+ }
+
/**
* Process an event through the combining chain, and return a processed event to apply.
* @param previousEvents the list of previous events in this composition
@@ -97,7 +104,13 @@ public class CombinerChain {
// A combiner can never return more than one event; it can return several
// code points, but they should be encapsulated within one event.
event = combiner.processEvent(modifiablePreviousEvents, event);
+ if (event.isConsumed()) {
+ // If the event is consumed, then we don't pass it to subsequent combiners:
+ // they should not see it at all.
+ break;
+ }
}
+ updateStateFeedback();
return event;
}
@@ -121,10 +134,7 @@ public class CombinerChain {
}
}
}
- mStateFeedback.clear();
- for (int i = mCombiners.size() - 1; i >= 0; --i) {
- mStateFeedback.append(mCombiners.get(i).getCombiningStateFeedback());
- }
+ updateStateFeedback();
}
/**