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();