diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index e8ebf88..e744d8d 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1081,16 +1081,9 @@
                     + ", ce=" + composingSpanEnd);
         }
         if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) {
-            final boolean expectingUpdateSelectionFromLogger =
-                    ResearchLogger.getAndClearLatinIMEExpectingUpdateSelection();
             ResearchLogger.latinIME_onUpdateSelection(mLastSelectionStart, mLastSelectionEnd,
                     oldSelStart, oldSelEnd, newSelStart, newSelEnd, composingSpanStart,
-                    composingSpanEnd, mExpectingUpdateSelection,
-                    expectingUpdateSelectionFromLogger, mConnection);
-            if (expectingUpdateSelectionFromLogger) {
-                // TODO: Investigate. Quitting now sounds wrong - we won't do the resetting work
-                return;
-            }
+                    composingSpanEnd, mExpectingUpdateSelection, mConnection);
         }
 
         final boolean selectionChanged = mLastSelectionStart != newSelStart
diff --git a/java/src/com/android/inputmethod/research/ResearchLogger.java b/java/src/com/android/inputmethod/research/ResearchLogger.java
index da9c611..265d55d 100644
--- a/java/src/com/android/inputmethod/research/ResearchLogger.java
+++ b/java/src/com/android/inputmethod/research/ResearchLogger.java
@@ -102,10 +102,6 @@
             && ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS_DEBUG;
     private static final boolean DEBUG_REPLAY_AFTER_FEEDBACK = false
             && ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS_DEBUG;
-    // Whether the TextView contents are logged at the end of the session.  true will disclose
-    // private info.
-    private static final boolean LOG_FULL_TEXTVIEW_CONTENTS = false
-            && ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS_DEBUG;
     // Whether the feedback dialog preserves the editable text across invocations.  Should be false
     // for normal research builds so users do not have to delete the same feedback string they
     // entered earlier.  Should be true for builds internal to a development team so when the text
@@ -168,9 +164,6 @@
     // U+E001 is in the "private-use area"
     /* package for test */ static final String WORD_REPLACEMENT_STRING = "\uE001";
     protected static final int SUSPEND_DURATION_IN_MINUTES = 1;
-    // set when LatinIME should ignore an onUpdateSelection() callback that
-    // arises from operations in this class
-    private static boolean sLatinIMEExpectingUpdateSelection = false;
 
     // used to check whether words are not unique
     private Suggest mSuggest;
@@ -1126,12 +1119,6 @@
                 new Object[] { applicationSpecifiedCompletions });
     }
 
-    public static boolean getAndClearLatinIMEExpectingUpdateSelection() {
-        boolean returnValue = sLatinIMEExpectingUpdateSelection;
-        sLatinIMEExpectingUpdateSelection = false;
-        return returnValue;
-    }
-
     /**
      * The IME is finishing; it is either being destroyed, or is about to be hidden.
      *
@@ -1149,51 +1136,12 @@
         // if called from finishViews(), which is called from hideWindow() and onDestroy().  These
         // are the situations in which we want to finish up the researchLog.
         if (ic != null && !finishingInput) {
-            final boolean isTextTruncated;
-            final String text;
-            if (LOG_FULL_TEXTVIEW_CONTENTS) {
-                // Capture the TextView contents.  This will trigger onUpdateSelection(), so we
-                // set sLatinIMEExpectingUpdateSelection so that when onUpdateSelection() is called,
-                // it can tell that it was generated by the logging code, and not by the user, and
-                // therefore keep user-visible state as is.
-                ic.beginBatchEdit();
-                ic.performContextMenuAction(android.R.id.selectAll);
-                CharSequence charSequence = ic.getSelectedText(0);
-                if (savedSelectionStart != -1 && savedSelectionEnd != -1) {
-                    ic.setSelection(savedSelectionStart, savedSelectionEnd);
-                }
-                ic.endBatchEdit();
-                sLatinIMEExpectingUpdateSelection = true;
-                if (TextUtils.isEmpty(charSequence)) {
-                    isTextTruncated = false;
-                    text = "";
-                } else {
-                    if (charSequence.length() > MAX_INPUTVIEW_LENGTH_TO_CAPTURE) {
-                        int length = MAX_INPUTVIEW_LENGTH_TO_CAPTURE;
-                        // do not cut in the middle of a supplementary character
-                        final char c = charSequence.charAt(length - 1);
-                        if (Character.isHighSurrogate(c)) {
-                            length--;
-                        }
-                        final CharSequence truncatedCharSequence = charSequence.subSequence(0,
-                                length);
-                        isTextTruncated = true;
-                        text = truncatedCharSequence.toString();
-                    } else {
-                        isTextTruncated = false;
-                        text = charSequence.toString();
-                    }
-                }
-            } else {
-                isTextTruncated = true;
-                text = "";
-            }
             final ResearchLogger researchLogger = getInstance();
             // Assume that OUTPUT_ENTIRE_BUFFER is only true when we don't care about privacy (e.g.
             // during a live user test), so the normal isPotentiallyPrivate and
             // isPotentiallyRevealing flags do not apply
             researchLogger.enqueueEvent(LOGSTATEMENT_LATINIME_ONFINISHINPUTVIEWINTERNAL,
-                    isTextTruncated, text);
+                    true /* isTextTruncated */, "" /* text */);
             researchLogger.commitCurrentLogUnit();
             getInstance().stop();
         }
@@ -1214,7 +1162,6 @@
             final int lastSelectionEnd, final int oldSelStart, final int oldSelEnd,
             final int newSelStart, final int newSelEnd, final int composingSpanStart,
             final int composingSpanEnd, final boolean expectingUpdateSelection,
-            final boolean expectingUpdateSelectionFromLogger,
             final RichInputConnection connection) {
         String word = "";
         if (connection != null) {
@@ -1228,7 +1175,7 @@
         researchLogger.enqueueEvent(LOGSTATEMENT_LATINIME_ONUPDATESELECTION, lastSelectionStart,
                 lastSelectionEnd, oldSelStart, oldSelEnd, newSelStart, newSelEnd,
                 composingSpanStart, composingSpanEnd, expectingUpdateSelection,
-                expectingUpdateSelectionFromLogger, scrubbedWord);
+                false /* expectingUpdateSelectionFromLogger */, scrubbedWord);
     }
 
     /**
