summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYohei Yukawa <yukawa@google.com>2014-08-27 12:37:22 -0700
committerThe Android Automerger <android-build@google.com>2014-08-28 10:50:59 -0700
commit9e68a467106f475fabe43f35e9ba4732e8522592 (patch)
treeb8ceeaf5f6d0c90b8b9fdf6f7486cca0150733c4
parent79def886c424d3d69a3d8344bea5e8fce1170984 (diff)
downloadandroid_packages_inputmethods_LatinIME-9e68a467106f475fabe43f35e9ba4732e8522592.tar.gz
android_packages_inputmethods_LatinIME-9e68a467106f475fabe43f35e9ba4732e8522592.tar.bz2
android_packages_inputmethods_LatinIME-9e68a467106f475fabe43f35e9ba4732e8522592.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
-rw-r--r--java/src/com/android/inputmethod/latin/RichInputConnection.java10
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;
}