diff options
author | 2014-08-27 12:37:22 -0700 | |
---|---|---|
committer | 2014-08-27 15:59:52 -0700 | |
commit | acce1aa59eac6816fe3ce1fcb014666fc71a40f1 (patch) | |
tree | b8ceeaf5f6d0c90b8b9fdf6f7486cca0150733c4 /java/src/com/android/inputmethod/latin/RichInputConnection.java | |
parent | 37beaf1529a61228d6240736937789e5622b29ed (diff) | |
download | latinime-acce1aa59eac6816fe3ce1fcb014666fc71a40f1.tar.gz latinime-acce1aa59eac6816fe3ce1fcb014666fc71a40f1.tar.xz latinime-acce1aa59eac6816fe3ce1fcb014666fc71a40f1.zip |
Make sure to obtain the IC before requesting CursorAnchorInfo
RichInputConnection#requestUpdateCursorAnchorInfo must make
sure to obtain the input connection before calling methods
of it.
BUG: 17299587
Change-Id: I8e0cd473a4cc32583cd47634c227d702f7c69c6c
Diffstat (limited to 'java/src/com/android/inputmethod/latin/RichInputConnection.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/RichInputConnection.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/RichInputConnection.java b/java/src/com/android/inputmethod/latin/RichInputConnection.java index 497823aeb..f1c7f4340 100644 --- a/java/src/com/android/inputmethod/latin/RichInputConnection.java +++ b/java/src/com/android/inputmethod/latin/RichInputConnection.java @@ -924,8 +924,14 @@ public final class RichInputConnection { */ public boolean requestUpdateCursorAnchorInfo(final boolean enableMonitor, final boolean requestImmediateCallback) { - final boolean scheduled = InputConnectionCompatUtils.requestUpdateCursorAnchorInfo(mIC, - enableMonitor, requestImmediateCallback); + mIC = mParent.getCurrentInputConnection(); + final boolean scheduled; + if (null != mIC) { + scheduled = InputConnectionCompatUtils.requestUpdateCursorAnchorInfo(mIC, + enableMonitor, requestImmediateCallback); + } else { + scheduled = false; + } mCursorAnchorInfoMonitorEnabled = (scheduled && enableMonitor); return scheduled; } |