From 4024984c1efa394018631ca1bb46deba3efa629c Mon Sep 17 00:00:00 2001 From: Mohammadinamul Sheik Date: Tue, 17 Mar 2015 15:18:21 -0700 Subject: [PATCH] Pass DictionaryFacilitator for autocorrection and suggestion stats Bug: 19715579 Change-Id: Ic48de74bde0f9f5d5e68e8289948cc5e92cbfa1e --- .../src/com/android/inputmethod/latin/utils/StatsUtils.java | 6 ++++-- .../android/inputmethod/latin/inputlogic/InputLogic.java | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtils.java b/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtils.java index 21a806878..b8f835ee3 100644 --- a/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtils.java +++ b/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtils.java @@ -18,6 +18,7 @@ package com.android.inputmethod.latin.utils; import android.view.inputmethod.InputMethodSubtype; +import com.android.inputmethod.latin.DictionaryFacilitator; import com.android.inputmethod.latin.RichInputMethodManager; import com.android.inputmethod.latin.SuggestedWords; import com.android.inputmethod.latin.settings.SettingsValues; @@ -36,7 +37,8 @@ public final class StatsUtils { } public static void onPickSuggestionManually(final SuggestedWords suggestedWords, - final SuggestedWords.SuggestedWordInfo suggestionInfo) { + final SuggestedWords.SuggestedWordInfo suggestionInfo, + final DictionaryFacilitator dictionaryFacilitator) { } public static void onBackspaceWordDelete(int wordLength) { @@ -70,7 +72,7 @@ public final class StatsUtils { } public static void onAutoCorrection(final String typedWord, final String autoCorrectionWord, - final boolean isBatchInput, @Nullable final String dictionaryType) { + final boolean isBatchInput, final DictionaryFacilitator dictionaryType) { } public static void onWordCommitUserTyped(final String commitWord, final boolean isBatchMode) { diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java index f02a63e57..00175f024 100644 --- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java @@ -324,7 +324,8 @@ public final class InputLogic { // That's going to be predictions (or punctuation suggestions), so INPUT_STYLE_NONE. handler.postUpdateSuggestionStrip(SuggestedWords.INPUT_STYLE_NONE); - StatsUtils.onPickSuggestionManually(mSuggestedWords, suggestionInfo); + StatsUtils.onPickSuggestionManually( + mSuggestedWords, suggestionInfo, mDictionaryFacilitator); StatsUtils.onWordCommitSuggestionPickedManually( suggestionInfo.mWord, mWordComposer.isBatchMode()); return inputTransaction; @@ -2053,8 +2054,7 @@ public final class InputLogic { mConnection.getExpectedSelectionEnd() - stringToCommit.length(), typedWord, stringToCommit)); StatsUtils.onAutoCorrection(typedWord, stringToCommit, isBatchMode, - null == autoCorrectionOrNull - ? null : autoCorrectionOrNull.mSourceDict.mDictType); + mDictionaryFacilitator); StatsUtils.onWordCommitAutoCorrect(stringToCommit, isBatchMode); } else { StatsUtils.onWordCommitUserTyped(stringToCommit, isBatchMode);