aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2013-11-15 17:34:45 +0900
committerTadashi G. Takaoka <takaoka@google.com>2013-11-15 17:48:10 +0900
commitffb064656ed0a44d6f9fef66e0c26f77c8611907 (patch)
tree25aadd5a24424d5c3907d6f9cf6d58ce3521732e /java/src
parent2bf3a778148aff36e991a3684c6044bdb985ed47 (diff)
downloadlatinime-ffb064656ed0a44d6f9fef66e0c26f77c8611907.tar.gz
latinime-ffb064656ed0a44d6f9fef66e0c26f77c8611907.tar.xz
latinime-ffb064656ed0a44d6f9fef66e0c26f77c8611907.zip
Fix unusual NPE after onDestroy
Bug: 11673978 Change-Id: I4d5268312911685ff1ca9483a62442a1a9686c62
Diffstat (limited to 'java/src')
-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 326c53f0e..1a1dde781 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -722,8 +722,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
LatinImeLogger.commit();
LatinImeLogger.onDestroy();
if (mInputUpdater != null) {
- mInputUpdater.onDestroy();
- mInputUpdater = null;
+ mInputUpdater.quitLooper();
}
super.onDestroy();
}
@@ -1806,13 +1805,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();
@@ -1929,7 +1928,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();