am 5731b86b: Merge "Remove unneeded code."
* commit '5731b86b885a8cf7e3b7f9d612d4c82695bb9f73': Remove unneeded code.main
commit
6b451d56d4
|
@ -1081,16 +1081,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
+ ", ce=" + composingSpanEnd);
|
+ ", ce=" + composingSpanEnd);
|
||||||
}
|
}
|
||||||
if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) {
|
if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) {
|
||||||
final boolean expectingUpdateSelectionFromLogger =
|
|
||||||
ResearchLogger.getAndClearLatinIMEExpectingUpdateSelection();
|
|
||||||
ResearchLogger.latinIME_onUpdateSelection(mLastSelectionStart, mLastSelectionEnd,
|
ResearchLogger.latinIME_onUpdateSelection(mLastSelectionStart, mLastSelectionEnd,
|
||||||
oldSelStart, oldSelEnd, newSelStart, newSelEnd, composingSpanStart,
|
oldSelStart, oldSelEnd, newSelStart, newSelEnd, composingSpanStart,
|
||||||
composingSpanEnd, mExpectingUpdateSelection,
|
composingSpanEnd, mExpectingUpdateSelection, mConnection);
|
||||||
expectingUpdateSelectionFromLogger, mConnection);
|
|
||||||
if (expectingUpdateSelectionFromLogger) {
|
|
||||||
// TODO: Investigate. Quitting now sounds wrong - we won't do the resetting work
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final boolean selectionChanged = mLastSelectionStart != newSelStart
|
final boolean selectionChanged = mLastSelectionStart != newSelStart
|
||||||
|
|
|
@ -102,10 +102,6 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
|
||||||
&& ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS_DEBUG;
|
&& ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS_DEBUG;
|
||||||
private static final boolean DEBUG_REPLAY_AFTER_FEEDBACK = false
|
private static final boolean DEBUG_REPLAY_AFTER_FEEDBACK = false
|
||||||
&& ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS_DEBUG;
|
&& 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
|
// 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
|
// 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
|
// entered earlier. Should be true for builds internal to a development team so when the text
|
||||||
|
@ -168,9 +164,6 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
|
||||||
// U+E001 is in the "private-use area"
|
// U+E001 is in the "private-use area"
|
||||||
/* package for test */ static final String WORD_REPLACEMENT_STRING = "\uE001";
|
/* package for test */ static final String WORD_REPLACEMENT_STRING = "\uE001";
|
||||||
protected static final int SUSPEND_DURATION_IN_MINUTES = 1;
|
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
|
// used to check whether words are not unique
|
||||||
private Suggest mSuggest;
|
private Suggest mSuggest;
|
||||||
|
@ -1126,12 +1119,6 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
|
||||||
new Object[] { applicationSpecifiedCompletions });
|
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.
|
* The IME is finishing; it is either being destroyed, or is about to be hidden.
|
||||||
*
|
*
|
||||||
|
@ -1149,51 +1136,12 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
|
||||||
// if called from finishViews(), which is called from hideWindow() and onDestroy(). These
|
// if called from finishViews(), which is called from hideWindow() and onDestroy(). These
|
||||||
// are the situations in which we want to finish up the researchLog.
|
// are the situations in which we want to finish up the researchLog.
|
||||||
if (ic != null && !finishingInput) {
|
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();
|
final ResearchLogger researchLogger = getInstance();
|
||||||
// Assume that OUTPUT_ENTIRE_BUFFER is only true when we don't care about privacy (e.g.
|
// 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
|
// during a live user test), so the normal isPotentiallyPrivate and
|
||||||
// isPotentiallyRevealing flags do not apply
|
// isPotentiallyRevealing flags do not apply
|
||||||
researchLogger.enqueueEvent(LOGSTATEMENT_LATINIME_ONFINISHINPUTVIEWINTERNAL,
|
researchLogger.enqueueEvent(LOGSTATEMENT_LATINIME_ONFINISHINPUTVIEWINTERNAL,
|
||||||
isTextTruncated, text);
|
true /* isTextTruncated */, "" /* text */);
|
||||||
researchLogger.commitCurrentLogUnit();
|
researchLogger.commitCurrentLogUnit();
|
||||||
getInstance().stop();
|
getInstance().stop();
|
||||||
}
|
}
|
||||||
|
@ -1214,7 +1162,6 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
|
||||||
final int lastSelectionEnd, final int oldSelStart, final int oldSelEnd,
|
final int lastSelectionEnd, final int oldSelStart, final int oldSelEnd,
|
||||||
final int newSelStart, final int newSelEnd, final int composingSpanStart,
|
final int newSelStart, final int newSelEnd, final int composingSpanStart,
|
||||||
final int composingSpanEnd, final boolean expectingUpdateSelection,
|
final int composingSpanEnd, final boolean expectingUpdateSelection,
|
||||||
final boolean expectingUpdateSelectionFromLogger,
|
|
||||||
final RichInputConnection connection) {
|
final RichInputConnection connection) {
|
||||||
String word = "";
|
String word = "";
|
||||||
if (connection != null) {
|
if (connection != null) {
|
||||||
|
@ -1228,7 +1175,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
|
||||||
researchLogger.enqueueEvent(LOGSTATEMENT_LATINIME_ONUPDATESELECTION, lastSelectionStart,
|
researchLogger.enqueueEvent(LOGSTATEMENT_LATINIME_ONUPDATESELECTION, lastSelectionStart,
|
||||||
lastSelectionEnd, oldSelStart, oldSelEnd, newSelStart, newSelEnd,
|
lastSelectionEnd, oldSelStart, oldSelEnd, newSelStart, newSelEnd,
|
||||||
composingSpanStart, composingSpanEnd, expectingUpdateSelection,
|
composingSpanStart, composingSpanEnd, expectingUpdateSelection,
|
||||||
expectingUpdateSelectionFromLogger, scrubbedWord);
|
false /* expectingUpdateSelectionFromLogger */, scrubbedWord);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue