aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-05-09 01:55:44 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-05-09 01:55:44 -0700
commit9648b1674ef4c82cfdd923c0d77d564d78f48b89 (patch)
tree57f694440059abe3e0aa6a27aa94740130e3830b /java/src
parent4e02b1273b939892a777e675ae29d8eddd82e57f (diff)
parentd5cd7e64aa30096241f63e47a9169699bdd98231 (diff)
downloadlatinime-9648b1674ef4c82cfdd923c0d77d564d78f48b89.tar.gz
latinime-9648b1674ef4c82cfdd923c0d77d564d78f48b89.tar.xz
latinime-9648b1674ef4c82cfdd923c0d77d564d78f48b89.zip
am d5cd7e64: Small optimization
* commit 'd5cd7e64aa30096241f63e47a9169699bdd98231': Small optimization
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 81ce072b1..0fcd23cc6 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1487,9 +1487,12 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
sendKeyCodePoint(Keyboard.CODE_SPACE);
}
- if ((isAlphabet(primaryCode)
+ // NOTE: isCursorTouchingWord() is a blocking IPC call, so it often takes several
+ // dozen milliseconds. Avoid calling it as much as possible, since we are on the UI
+ // thread here.
+ if (!isComposingWord && (isAlphabet(primaryCode)
|| mSettingsValues.isSymbolExcludedFromWordSeparators(primaryCode))
- && isSuggestionsRequested() && !isComposingWord && !isCursorTouchingWord()) {
+ && isSuggestionsRequested() && !isCursorTouchingWord()) {
// Reset entirely the composing state anyway, then start composing a new word unless
// the character is a single quote. The idea here is, single quote is not a
// separator and it should be treated as a normal character, except in the first