diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 03e92d5..e3c9fce 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -755,12 +755,7 @@
 
         // 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 @@
             // 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 @@
         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 @@
         // 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,
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
index 34377e9..5fe482b 100644
--- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
+++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
@@ -116,9 +116,22 @@
      * some things must not be done (for example, the keyboard should not be reset to the
      * alphabetic layout), so do not send false to this just in case.
      *
-     * @param restarting whether input is starting in the same field as before.
+     * @param restarting whether input is starting in the same field as before. Unused for now.
+     * @param editorInfo the editorInfo associated with the editor.
      */
-    public void startInput(final boolean restarting) {
+    public void startInput(final boolean restarting, final EditorInfo editorInfo) {
+        mEnteredText = null;
+        resetComposingState(true /* alsoResetLastComposedWord */);
+        mDeleteCount = 0;
+        mSpaceState = SpaceState.NONE;
+        mRecapitalizeStatus.deactivate();
+        mCurrentlyPressedHardwareKeys.clear();
+        mSuggestedWords = SuggestedWords.EMPTY;
+        mLastSelectionStart = editorInfo.initialSelStart;
+        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.
+        tryFixLyingCursorPosition();
         mInputLogicHandler = new InputLogicHandler();
     }
 
@@ -126,6 +139,10 @@
      * Clean up the input logic after input is finished.
      */
     public void finishInput() {
+        if (mWordComposer.isComposingWord()) {
+            mConnection.finishComposingText();
+        }
+        resetComposingState(true /* alsoResetLastComposedWord */);
         mInputLogicHandler.destroy();
         mInputLogicHandler = null;
     }
