diff options
author | 2012-09-20 20:37:44 +0900 | |
---|---|---|
committer | 2012-09-20 20:37:44 +0900 | |
commit | 379aeb18366f29b8d9d0f90e2fbb0daa3aaeefa4 (patch) | |
tree | 1836a0f65c41e66e65b22c2282c2807935dffe7a /java/src/com/android/inputmethod/latin/Utils.java | |
parent | f18fc03621b70f5a51cf54c4bf40eb213de40652 (diff) | |
parent | 54717534b1164c575a14a4a117284e72c6cd0ee0 (diff) | |
download | latinime-379aeb18366f29b8d9d0f90e2fbb0daa3aaeefa4.tar.gz latinime-379aeb18366f29b8d9d0f90e2fbb0daa3aaeefa4.tar.xz latinime-379aeb18366f29b8d9d0f90e2fbb0daa3aaeefa4.zip |
Merge remote-tracking branch 'goog/jb-mr1-dev' into mergescriptpackage
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Utils.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/Utils.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/Utils.java b/java/src/com/android/inputmethod/latin/Utils.java index 1c98b92cd..876bc8e79 100644 --- a/java/src/com/android/inputmethod/latin/Utils.java +++ b/java/src/com/android/inputmethod/latin/Utils.java @@ -412,14 +412,24 @@ public final class Utils { } public static void onAutoCorrection(final String typedWord, final String correctedWord, - final String separatorString) { - if (TextUtils.isEmpty(typedWord)) return; + final String separatorString, final WordComposer wordComposer) { + final boolean isBatchMode = wordComposer.isBatchMode(); + if (!isBatchMode && TextUtils.isEmpty(typedWord)) return; // TODO: this fails when the separator is more than 1 code point long, but // the backend can't handle it yet. The only case when this happens is with // smileys and other multi-character keys. final int codePoint = TextUtils.isEmpty(separatorString) ? Constants.NOT_A_CODE : separatorString.codePointAt(0); - LatinImeLogger.logOnAutoCorrection(typedWord, correctedWord, codePoint); + if (!isBatchMode) { + LatinImeLogger.logOnAutoCorrectionForTyping(typedWord, correctedWord, codePoint); + } else { + if (!TextUtils.isEmpty(correctedWord)) { + // We must make sure that InputPointer contains only the relative timestamps, + // not actual timestamps. + LatinImeLogger.logOnAutoCorrectionForGeometric( + "", correctedWord, codePoint, wordComposer.getInputPointers()); + } + } } public static void onAutoCorrectionCancellation() { |