From 87bc3a4a62b28f9c64ced813a9af531a563b6cd9 Mon Sep 17 00:00:00 2001 From: Kurt Partridge Date: Wed, 20 Mar 2013 11:28:31 -0700 Subject: Close ResearchLogger upon onFinishInputView Previously, ResearchLogger#stop() was called both in LatinIME#onFinishInputView() and in LatinIME#onWindowHidden(). This resulted in multiple logs being written. Since onFinishInputView is the more reliable of the two (it is called in InputMethodService#onDestroy; onWindowHidden is not), the code now uses onFinishInputView as a stopping signal. Change-Id: Iae4b8c3bdab226027624eeab19b3737367e4a108 --- java/src/com/android/inputmethod/latin/LatinIME.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'java/src/com/android/inputmethod/latin') diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index ea7ee6d5b..e66bcae1f 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -803,10 +803,6 @@ public final class LatinIME extends InputMethodService implements KeyboardAction @Override public void onWindowHidden() { - if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { - ResearchLogger.latinIME_onWindowHidden(mLastSelectionStart, mLastSelectionEnd, - getCurrentInputConnection()); - } super.onWindowHidden(); final MainKeyboardView mainKeyboardView = mKeyboardSwitcher.getMainKeyboardView(); if (mainKeyboardView != null) { @@ -834,8 +830,10 @@ public final class LatinIME extends InputMethodService implements KeyboardAction // Remove pending messages related to update suggestions mHandler.cancelUpdateSuggestionStrip(); resetComposingState(true /* alsoResetLastComposedWord */); + // Notify ResearchLogger if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { - ResearchLogger.getInstance().latinIME_onFinishInputViewInternal(); + ResearchLogger.latinIME_onFinishInputViewInternal(finishingInput, mLastSelectionStart, + mLastSelectionEnd, getCurrentInputConnection()); } } -- cgit v1.2.3-83-g751a