am ef103e1f: Merge "Close ResearchLogger upon onFinishInputView"
* commit 'ef103e1f2e0a94e9445dd9b55516dcf59b05ee2f': Close ResearchLogger upon onFinishInputViewmain
commit
bf62dc036f
|
@ -803,10 +803,6 @@ public final class LatinIME extends InputMethodService implements KeyboardAction
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onWindowHidden() {
|
public void onWindowHidden() {
|
||||||
if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) {
|
|
||||||
ResearchLogger.latinIME_onWindowHidden(mLastSelectionStart, mLastSelectionEnd,
|
|
||||||
getCurrentInputConnection());
|
|
||||||
}
|
|
||||||
super.onWindowHidden();
|
super.onWindowHidden();
|
||||||
final MainKeyboardView mainKeyboardView = mKeyboardSwitcher.getMainKeyboardView();
|
final MainKeyboardView mainKeyboardView = mKeyboardSwitcher.getMainKeyboardView();
|
||||||
if (mainKeyboardView != null) {
|
if (mainKeyboardView != null) {
|
||||||
|
@ -834,8 +830,10 @@ public final class LatinIME extends InputMethodService implements KeyboardAction
|
||||||
// Remove pending messages related to update suggestions
|
// Remove pending messages related to update suggestions
|
||||||
mHandler.cancelUpdateSuggestionStrip();
|
mHandler.cancelUpdateSuggestionStrip();
|
||||||
resetComposingState(true /* alsoResetLastComposedWord */);
|
resetComposingState(true /* alsoResetLastComposedWord */);
|
||||||
|
// Notify ResearchLogger
|
||||||
if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) {
|
if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) {
|
||||||
ResearchLogger.getInstance().latinIME_onFinishInputViewInternal();
|
ResearchLogger.latinIME_onFinishInputViewInternal(finishingInput, mLastSelectionStart,
|
||||||
|
mLastSelectionEnd, getCurrentInputConnection());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1122,10 +1122,6 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void latinIME_onFinishInputViewInternal() {
|
|
||||||
stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Log a change in preferences.
|
* Log a change in preferences.
|
||||||
*
|
*
|
||||||
|
@ -1208,16 +1204,22 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Log a call to LatinIME.onWindowHidden().
|
* The IME is finishing; it is either being destroyed, or is about to be hidden.
|
||||||
*
|
*
|
||||||
* UserAction: The user has performed an action that has caused the IME to be closed. They may
|
* UserAction: The user has performed an action that has caused the IME to be closed. They may
|
||||||
* have focused on something other than a text field, or explicitly closed it.
|
* have focused on something other than a text field, or explicitly closed it.
|
||||||
*/
|
*/
|
||||||
private static final LogStatement LOGSTATEMENT_LATINIME_ONWINDOWHIDDEN =
|
private static final LogStatement LOGSTATEMENT_LATINIME_ONFINISHINPUTVIEWINTERNAL =
|
||||||
new LogStatement("LatinIMEOnWindowHidden", false, false, "isTextTruncated", "text");
|
new LogStatement("LatinIMEOnFinishInputViewInternal", false, false, "isTextTruncated",
|
||||||
public static void latinIME_onWindowHidden(final int savedSelectionStart,
|
"text");
|
||||||
final int savedSelectionEnd, final InputConnection ic) {
|
public static void latinIME_onFinishInputViewInternal(final boolean finishingInput,
|
||||||
if (ic != null) {
|
final int savedSelectionStart, final int savedSelectionEnd, final InputConnection ic) {
|
||||||
|
// The finishingInput flag is set in InputMethodService. It is true if called from
|
||||||
|
// doFinishInput(), which can be called as part of doStartInput(). This can happen at times
|
||||||
|
// when the IME is not closing, such as when powering up. The finishinInput flag is false
|
||||||
|
// 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 boolean isTextTruncated;
|
||||||
final String text;
|
final String text;
|
||||||
if (LOG_FULL_TEXTVIEW_CONTENTS) {
|
if (LOG_FULL_TEXTVIEW_CONTENTS) {
|
||||||
|
@ -1261,8 +1263,8 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
|
||||||
// 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_ONWINDOWHIDDEN, isTextTruncated,
|
researchLogger.enqueueEvent(LOGSTATEMENT_LATINIME_ONFINISHINPUTVIEWINTERNAL,
|
||||||
text);
|
isTextTruncated, text);
|
||||||
researchLogger.commitCurrentLogUnit();
|
researchLogger.commitCurrentLogUnit();
|
||||||
getInstance().stop();
|
getInstance().stop();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue