diff options
Diffstat (limited to 'java/src/com/android/inputmethod/latin/inputlogic')
-rw-r--r-- | java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java index cb55aa06c..fa7c4b4fc 100644 --- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java @@ -80,8 +80,6 @@ public final class InputLogic { public SuggestedWords mSuggestedWords = SuggestedWords.EMPTY; // TODO: mSuggest should be touched by a single thread. public volatile Suggest mSuggest; - // The event interpreter should never be null. - public final EventInterpreter mEventInterpreter; public LastComposedWord mLastComposedWord = LastComposedWord.NOT_A_COMPOSED_WORD; public final WordComposer mWordComposer; @@ -104,11 +102,19 @@ public final class InputLogic { mLatinIME = latinIME; mSuggestionStripViewAccessor = suggestionStripViewAccessor; mWordComposer = new WordComposer(); - mEventInterpreter = new EventInterpreter(latinIME); mConnection = new RichInputConnection(latinIME); mInputLogicHandler = InputLogicHandler.NULL_HANDLER; } + // Replace the old Suggest with the passed Suggest and close it. + public void replaceSuggest(final Suggest newSuggest) { + final Suggest oldSuggest = mSuggest; + mSuggest = newSuggest; + if (oldSuggest != null) { + oldSuggest.close(); + } + } + /** * Initializes the input logic for input in an editor. * |