Log timing of commitChosenWord()

Bug 19987461.

Change-Id: If5bb798a350e9083ee8b67a84af132c100f0a7eb
main
Dan Zivkovic 2015-04-02 15:54:28 -07:00
parent 9731fadcb4
commit 5d2314fea0
1 changed files with 6 additions and 9 deletions

View File

@ -2065,9 +2065,6 @@ public final class InputLogic {
}
}
// TODO: Remove this before going live.
private static final boolean DEBUG_COMMIT_TIMING = true;
/**
* Commits the chosen word to the text field and saves it for later retrieval.
*
@ -2079,7 +2076,7 @@ public final class InputLogic {
private void commitChosenWord(final SettingsValues settingsValues, final String chosenWord,
final int commitType, final String separatorString) {
long startTimeMillis = 0;
if (DEBUG_COMMIT_TIMING) {
if (DebugFlags.DEBUG_ENABLED) {
startTimeMillis = System.currentTimeMillis();
Log.d(TAG, "commitChosenWord() : [" + chosenWord + "]");
}
@ -2087,7 +2084,7 @@ public final class InputLogic {
final CharSequence chosenWordWithSuggestions =
SuggestionSpanUtils.getTextWithSuggestionSpan(mLatinIME, chosenWord,
suggestedWords);
if (DEBUG_COMMIT_TIMING) {
if (DebugFlags.DEBUG_ENABLED) {
long runTimeMillis = System.currentTimeMillis() - startTimeMillis;
Log.d(TAG, "commitChosenWord() : " + runTimeMillis + " ms to run "
+ "SuggestionSpanUtils.getTextWithSuggestionSpan()");
@ -2098,7 +2095,7 @@ public final class InputLogic {
// previous word.
final NgramContext ngramContext = mConnection.getNgramContextFromNthPreviousWord(
settingsValues.mSpacingAndPunctuations, mWordComposer.isComposingWord() ? 2 : 1);
if (DEBUG_COMMIT_TIMING) {
if (DebugFlags.DEBUG_ENABLED) {
long runTimeMillis = System.currentTimeMillis() - startTimeMillis;
Log.d(TAG, "commitChosenWord() : " + runTimeMillis + " ms to run "
+ "Connection.getNgramContextFromNthPreviousWord()");
@ -2106,7 +2103,7 @@ public final class InputLogic {
startTimeMillis = System.currentTimeMillis();
}
mConnection.commitText(chosenWordWithSuggestions, 1);
if (DEBUG_COMMIT_TIMING) {
if (DebugFlags.DEBUG_ENABLED) {
long runTimeMillis = System.currentTimeMillis() - startTimeMillis;
Log.d(TAG, "commitChosenWord() : " + runTimeMillis + " ms to run "
+ "Connection.commitText");
@ -2114,7 +2111,7 @@ public final class InputLogic {
}
// Add the word to the user history dictionary
performAdditionToUserHistoryDictionary(settingsValues, chosenWord, ngramContext);
if (DEBUG_COMMIT_TIMING) {
if (DebugFlags.DEBUG_ENABLED) {
long runTimeMillis = System.currentTimeMillis() - startTimeMillis;
Log.d(TAG, "commitChosenWord() : " + runTimeMillis + " ms to run "
+ "performAdditionToUserHistoryDictionary()");
@ -2126,7 +2123,7 @@ public final class InputLogic {
// strings.
mLastComposedWord = mWordComposer.commitWord(commitType,
chosenWordWithSuggestions, separatorString, ngramContext);
if (DEBUG_COMMIT_TIMING) {
if (DebugFlags.DEBUG_ENABLED) {
long runTimeMillis = System.currentTimeMillis() - startTimeMillis;
Log.d(TAG, "commitChosenWord() : " + runTimeMillis + " ms to run "
+ "WordComposer.commitWord()");