aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-09-20 00:21:54 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-09-20 00:21:54 -0700
commit4f5f3ebc2f2e9a8486c15bc7b39de6aec532952c (patch)
tree66b6b7cb427af06e6c9bf714f57d239d8790f960 /java/src
parent01c75387019cd808225403c3760802e4f4a9b83a (diff)
parent1d1a3d52b8f12766c7d2c1f2033217fce502f49a (diff)
downloadlatinime-4f5f3ebc2f2e9a8486c15bc7b39de6aec532952c.tar.gz
latinime-4f5f3ebc2f2e9a8486c15bc7b39de6aec532952c.tar.xz
latinime-4f5f3ebc2f2e9a8486c15bc7b39de6aec532952c.zip
am 1d1a3d52: Merge "Fix a bug where null would be converted to "null""
* commit '1d1a3d52b8f12766c7d2c1f2033217fce502f49a': Fix a bug where null would be converted to "null"
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.