aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-02-21 11:58:16 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-02-21 11:58:16 +0000
commit296adf5710fed09eb0b5e038ef2ce6f55914c8f6 (patch)
treef53db04f59a33d394ca0969fd8863e7427d320e1 /java/src
parent1269ae31445ce46986638af8e5bb8ecab3db0915 (diff)
parent3b4c1d30565c06a7f5a4c362002862e8bcb61f01 (diff)
downloadlatinime-296adf5710fed09eb0b5e038ef2ce6f55914c8f6.tar.gz
latinime-296adf5710fed09eb0b5e038ef2ce6f55914c8f6.tar.xz
latinime-296adf5710fed09eb0b5e038ef2ce6f55914c8f6.zip
Merge "Change a heuristic and add a log."
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java2
-rw-r--r--java/src/com/android/inputmethod/latin/RichInputConnection.java6
2 files changed, 5 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 9ded5a85e..44282a492 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -750,6 +750,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
+ ", word caps = "
+ ((editorInfo.inputType & InputType.TYPE_TEXT_FLAG_CAP_WORDS) != 0));
}
+ Log.i(TAG, "Starting input. Cursor position = "
+ + editorInfo.initialSelStart + "," + editorInfo.initialSelEnd);
if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) {
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
ResearchLogger.latinIME_onStartInputViewInternal(editorInfo, prefs);
diff --git a/java/src/com/android/inputmethod/latin/RichInputConnection.java b/java/src/com/android/inputmethod/latin/RichInputConnection.java
index 0e85b3c77..30b20a335 100644
--- a/java/src/com/android/inputmethod/latin/RichInputConnection.java
+++ b/java/src/com/android/inputmethod/latin/RichInputConnection.java
@@ -847,9 +847,9 @@ public final class RichInputConnection {
mExpectedSelStart = mExpectedSelEnd = Constants.NOT_A_CURSOR_POSITION;
} else {
final int textLength = textBeforeCursor.length();
- if (textLength > mExpectedSelStart
- || (textLength < Constants.EDITOR_CONTENTS_CACHE_SIZE
- && mExpectedSelStart < Constants.EDITOR_CONTENTS_CACHE_SIZE)) {
+ if (textLength < Constants.EDITOR_CONTENTS_CACHE_SIZE
+ && (textLength > mExpectedSelStart
+ || mExpectedSelStart < Constants.EDITOR_CONTENTS_CACHE_SIZE)) {
// It should not be possible to have only one of those variables be
// NOT_A_CURSOR_POSITION, so if they are equal, either the selection is zero-sized
// (simple cursor, no selection) or there is no cursor/we don't know its pos