Merge "Add StatsUtils.onPickSuggestionManually and SuggestedWords.indexOf."

main
Mohammadinamul Sheik 2014-09-08 06:52:01 +00:00 committed by Android (Google) Code Review
commit 74332597d6
3 changed files with 18 additions and 0 deletions

View File

@ -17,6 +17,7 @@
package com.android.inputmethod.latin.utils; package com.android.inputmethod.latin.utils;
import com.android.inputmethod.latin.RichInputMethodManager; import com.android.inputmethod.latin.RichInputMethodManager;
import com.android.inputmethod.latin.SuggestedWords;
import com.android.inputmethod.latin.settings.SettingsValues; import com.android.inputmethod.latin.settings.SettingsValues;
public final class StatsUtils { public final class StatsUtils {
@ -24,4 +25,9 @@ public final class StatsUtils {
public static void onCreate(final SettingsValues settingsValues, public static void onCreate(final SettingsValues settingsValues,
RichInputMethodManager richImm) { RichInputMethodManager richImm) {
} }
public static void onPickSuggestionManually(final SuggestedWords suggestedWords,
final SuggestedWords.SuggestedWordInfo suggestionInfo) {
}
} }

View File

@ -142,6 +142,15 @@ public class SuggestedWords {
return mSuggestedWordInfoList.get(index); return mSuggestedWordInfoList.get(index);
} }
/**
* Gets the suggestion index from the suggestions list.
* @param suggestedWordInfo The {@link SuggestedWordInfo} to find the index.
* @return The position of the suggestion in the suggestion list.
*/
public int indexOf(SuggestedWordInfo suggestedWordInfo) {
return mSuggestedWordInfoList.indexOf(suggestedWordInfo);
}
public String getDebugString(final int pos) { public String getDebugString(final int pos) {
if (!DebugFlags.DEBUG_ENABLED) { if (!DebugFlags.DEBUG_ENABLED) {
return null; return null;

View File

@ -60,6 +60,7 @@ import com.android.inputmethod.latin.suggestions.SuggestionStripViewAccessor;
import com.android.inputmethod.latin.utils.AsyncResultHolder; import com.android.inputmethod.latin.utils.AsyncResultHolder;
import com.android.inputmethod.latin.utils.InputTypeUtils; import com.android.inputmethod.latin.utils.InputTypeUtils;
import com.android.inputmethod.latin.utils.RecapitalizeStatus; import com.android.inputmethod.latin.utils.RecapitalizeStatus;
import com.android.inputmethod.latin.utils.StatsUtils;
import com.android.inputmethod.latin.utils.StringUtils; import com.android.inputmethod.latin.utils.StringUtils;
import com.android.inputmethod.latin.utils.TextRange; import com.android.inputmethod.latin.utils.TextRange;
@ -361,6 +362,8 @@ public final class InputLogic {
if (shouldShowAddToDictionaryIndicator) { if (shouldShowAddToDictionaryIndicator) {
mTextDecorator.showAddToDictionaryIndicator(suggestionInfo); mTextDecorator.showAddToDictionaryIndicator(suggestionInfo);
} }
StatsUtils.onPickSuggestionManually(mSuggestedWords, suggestionInfo);
return inputTransaction; return inputTransaction;
} }