aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorMohammadinamul Sheik <inamul@google.com>2014-09-18 17:55:04 -0700
committerMohammadinamul Sheik <inamul@google.com>2014-09-18 23:00:11 -0700
commit6901ea6eacf719042e1af6f3d64c226e41c3c5e9 (patch)
tree651bf4e593109b4a30838af9d49a73b7ae705f0d /java/src
parent0e9419d014c859252584a37a2242def51f88294f (diff)
downloadlatinime-6901ea6eacf719042e1af6f3d64c226e41c3c5e9.tar.gz
latinime-6901ea6eacf719042e1af6f3d64c226e41c3c5e9.tar.xz
latinime-6901ea6eacf719042e1af6f3d64c226e41c3c5e9.zip
Invoke onWordCommitUserTyped on startInput() with non empty wordcomposer
In chat clients, the last committed word is not committed via rich input connection. This will handle those missed out cases. Change-Id: If3f1f6e1927cdf56a09d3e9124f05c66ca75de53
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
index 8eccd5cee..18c740bd7 100644
--- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
+++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
@@ -145,6 +145,13 @@ public final class InputLogic {
*/
public void startInput(final String combiningSpec, final SettingsValues settingsValues) {
mEnteredText = null;
+ if (!mWordComposer.getTypedWord().isEmpty()) {
+ // For messaging apps that offer send button, the IME does not get the opportunity
+ // to capture the last word. This block should capture those uncommitted words.
+ // The timestamp at which it is captured is not accurate but close enough.
+ StatsUtils.onWordCommitUserTyped(
+ mWordComposer.getTypedWord(), mWordComposer.isBatchMode());
+ }
mWordComposer.restartCombining(combiningSpec);
resetComposingState(true /* alsoResetLastComposedWord */);
mDeleteCount = 0;