aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-09-20 15:45:51 +0900
committerJean Chalard <jchalard@google.com>2013-09-20 15:45:51 +0900
commit8f02f1a118d36a1c4143b62f7e20727b2d2bf363 (patch)
tree0d4d02cbd01db45ce44e304d865d9814f395b757 /java/src
parent2e3c1106f75338953ebef79866ee86eaaa652ab3 (diff)
downloadlatinime-8f02f1a118d36a1c4143b62f7e20727b2d2bf363.tar.gz
latinime-8f02f1a118d36a1c4143b62f7e20727b2d2bf363.tar.xz
latinime-8f02f1a118d36a1c4143b62f7e20727b2d2bf363.zip
Fix a bug where null would be converted to "null"
It's unclear what the concrete effects of this are, but they are not very strong. This only happens in corner cases, when the input connection is not active - while rotating, for example. Change-Id: I1d22459a6e94a8ecccb53cfcbc2d301b1d502204
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/RichInputConnection.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/RichInputConnection.java b/java/src/com/android/inputmethod/latin/RichInputConnection.java
index a031bb3be..2ecf1463f 100644
--- a/java/src/com/android/inputmethod/latin/RichInputConnection.java
+++ b/java/src/com/android/inputmethod/latin/RichInputConnection.java
@@ -233,8 +233,10 @@ public final class RichInputConnection {
// getCapsMode should be updated to be able to return a "not enough info" result so that
// we can get more context only when needed.
if (TextUtils.isEmpty(mCommittedTextBeforeComposingText) && 0 != mExpectedCursorPosition) {
- mCommittedTextBeforeComposingText.append(
- getTextBeforeCursor(DEFAULT_TEXT_CACHE_SIZE, 0));
+ final CharSequence textBeforeCursor = getTextBeforeCursor(DEFAULT_TEXT_CACHE_SIZE, 0);
+ if (!TextUtils.isEmpty(textBeforeCursor)) {
+ mCommittedTextBeforeComposingText.append(textBeforeCursor);
+ }
}
// This never calls InputConnection#getCapsMode - in fact, it's a static method that
// never blocks or initiates IPC.