summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2013-11-15 17:34:45 +0900
committerThe Android Automerger <android-build@android.com>2013-11-22 17:26:42 -0800
commitea8f8da1acf4082b56cb461048d9038f634439be (patch)
tree32b2b15c6b9567034d2ce2b798103cf8b6d540e1
parentdb86a6f271e5ca446382061f219928c5eb6b9f01 (diff)
downloadandroid_packages_inputmethods_LatinIME-ea8f8da1acf4082b56cb461048d9038f634439be.tar.gz
android_packages_inputmethods_LatinIME-ea8f8da1acf4082b56cb461048d9038f634439be.tar.bz2
android_packages_inputmethods_LatinIME-ea8f8da1acf4082b56cb461048d9038f634439be.zip
Fix unusual NPE after onDestroy
Bug: 11673978 Change-Id: I4d5268312911685ff1ca9483a62442a1a9686c62
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 32e5e833e..77d07019f 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -725,8 +725,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
LatinImeLogger.commit();
LatinImeLogger.onDestroy();
if (mInputUpdater != null) {
- mInputUpdater.onDestroy();
- mInputUpdater = null;
+ mInputUpdater.quitLooper();
}
super.onDestroy();
}
@@ -1824,13 +1823,13 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mWordComposer.setCapitalizedModeAtStartComposingTime(getActualCapsMode());
}
- private static final class InputUpdater implements Handler.Callback {
+ static final class InputUpdater implements Handler.Callback {
private final Handler mHandler;
private final LatinIME mLatinIme;
private final Object mLock = new Object();
private boolean mInBatchInput; // synchronized using {@link #mLock}.
- private InputUpdater(final LatinIME latinIme) {
+ InputUpdater(final LatinIME latinIme) {
final HandlerThread handlerThread = new HandlerThread(
InputUpdater.class.getSimpleName());
handlerThread.start();
@@ -1947,7 +1946,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
.sendToTarget();
}
- private void onDestroy() {
+ void quitLooper() {
mHandler.removeMessages(MSG_GET_SUGGESTED_WORDS);
mHandler.removeMessages(MSG_UPDATE_GESTURE_PREVIEW_AND_SUGGESTION_STRIP);
mHandler.getLooper().quit();