diff options
author | 2013-12-25 21:03:24 +0900 | |
---|---|---|
committer | 2013-12-27 20:06:39 +0900 | |
commit | 81e0ca5fd395fd67c7b93e7d87e7d90fa136f065 (patch) | |
tree | 74b169b4634272c24381b7db00585e6e08c7a7a5 /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | 4970eda28628e044f90fb8425edcd0aa01f7c3dd (diff) | |
download | latinime-81e0ca5fd395fd67c7b93e7d87e7d90fa136f065.tar.gz latinime-81e0ca5fd395fd67c7b93e7d87e7d90fa136f065.tar.xz latinime-81e0ca5fd395fd67c7b93e7d87e7d90fa136f065.zip |
[IL49] Move InputLogic-related init code to InputLogic.
Bug: 8636060
Change-Id: Ie5027512f066d9c530a686ac559e4649a39bf439
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 03e92d5ee..e3c9fce47 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -755,12 +755,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // The app calling setText() has the effect of clearing the composing // span, so we should reset our state unconditionally, even if restarting is true. - mInputLogic.mEnteredText = null; - mInputLogic.resetComposingState(true /* alsoResetLastComposedWord */); - mInputLogic.mDeleteCount = 0; - mInputLogic.mSpaceState = SpaceState.NONE; - mInputLogic.mRecapitalizeStatus.deactivate(); - mInputLogic.mCurrentlyPressedHardwareKeys.clear(); + mInputLogic.startInput(restarting, editorInfo); // Note: the following does a round-trip IPC on the main thread: be careful final Locale currentLocale = mSubtypeSwitcher.getCurrentSubtypeLocale(); @@ -773,11 +768,11 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // otherwise it will clear the suggestion strip. setPunctuationSuggestions(); } - mInputLogic.mSuggestedWords = SuggestedWords.EMPTY; // Sometimes, while rotating, for some reason the framework tells the app we are not // connected to it and that means we can't refresh the cache. In this case, schedule a // refresh later. + // TODO[IL]: Can the following be moved to InputLogic#startInput? final boolean canReachInputConnection; if (!mInputLogic.mConnection.resetCachesUponCursorMoveAndReturnSuccess( editorInfo.initialSelStart, editorInfo.initialSelEnd, @@ -824,12 +819,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen setSuggestionStripShownInternal( isSuggestionsStripVisible(), /* needsInputViewShown */ false); - mInputLogic.mLastSelectionStart = editorInfo.initialSelStart; - mInputLogic.mLastSelectionEnd = editorInfo.initialSelEnd; - // In some cases (namely, after rotation of the device) editorInfo.initialSelStart is lying - // so we try using some heuristics to find out about these and fix them. - mInputLogic.tryFixLyingCursorPosition(); - mHandler.cancelUpdateSuggestionStrip(); mHandler.cancelDoubleSpacePeriodTimer(); @@ -873,10 +862,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // Remove pending messages related to update suggestions mHandler.cancelUpdateSuggestionStrip(); // Should do the following in onFinishInputInternal but until JB MR2 it's not called :( - if (mInputLogic.mWordComposer.isComposingWord()) { - mInputLogic.mConnection.finishComposingText(); - } - mInputLogic.resetComposingState(true /* alsoResetLastComposedWord */); + mInputLogic.finishInput(); // Notify ResearchLogger if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.latinIME_onFinishInputViewInternal(finishingInput, |