Added @UsedForTesting to 'missing' methods to avoid ProGuard removing them

Bug: 16864527
Change-Id: I698a1b3e09e7e9a12722169b37f87bd51c8cbd34
main
Adrian Velicu 2014-09-19 14:30:26 +09:00
parent ca93dda3fd
commit 8c889784e2
5 changed files with 9 additions and 0 deletions

View File

@ -483,6 +483,7 @@ public final class BinaryDictionary extends Dictionary {
return true;
}
@UsedForTesting
public void addMultipleDictionaryEntries(final LanguageModelParam[] languageModelParams) {
if (!isValidDictionary()) return;
int processedParamCount = 0;

View File

@ -707,6 +707,7 @@ public class DictionaryFacilitator {
getLocale(), personalizationDataChunk, spacingAndPunctuations, callback);
}
@UsedForTesting
public void addPhraseToContextualDictionary(final String[] phrase, final int probability,
final int bigramProbabilityForWords, final int bigramProbabilityForPhrases) {
// TODO: we're inserting the phrase into the dictionary for the active language. Rethink

View File

@ -23,6 +23,7 @@ import android.content.res.Resources;
import android.text.TextUtils;
import android.util.Log;
import com.android.inputmethod.annotations.UsedForTesting;
import com.android.inputmethod.latin.AssetFileAddress;
import com.android.inputmethod.latin.BinaryDictionaryGetter;
import com.android.inputmethod.latin.Constants;
@ -382,6 +383,7 @@ public class DictionaryInfoUtils {
return dictList;
}
@UsedForTesting
public static boolean looksValidForDictionaryInsertion(final CharSequence text,
final SpacingAndPunctuations spacingAndPunctuations) {
if (TextUtils.isEmpty(text)) return false;

View File

@ -21,6 +21,7 @@ import java.util.Locale;
import android.view.inputmethod.InputMethodSubtype;
import com.android.inputmethod.annotations.UsedForTesting;
import com.android.inputmethod.latin.PrevWordsInfo;
public interface DistracterFilter {
@ -36,6 +37,7 @@ public interface DistracterFilter {
public boolean isDistracterToWordsInDictionaries(final PrevWordsInfo prevWordsInfo,
final String testedWord, final Locale locale);
@UsedForTesting
public int getWordHandlingType(final PrevWordsInfo prevWordsInfo, final String testedWord,
final Locale locale);

View File

@ -18,6 +18,7 @@ package com.android.inputmethod.latin.utils;
import android.util.Log;
import com.android.inputmethod.annotations.UsedForTesting;
import com.android.inputmethod.latin.Dictionary;
import com.android.inputmethod.latin.DictionaryFacilitator;
import com.android.inputmethod.latin.PrevWordsInfo;
@ -58,12 +59,14 @@ public final class LanguageModelParam {
public final int mTimestamp;
// Constructor for unigram. TODO: support shortcuts
@UsedForTesting
public LanguageModelParam(final CharSequence word, final int unigramProbability,
final int timestamp) {
this(null /* word0 */, word, unigramProbability, Dictionary.NOT_A_PROBABILITY, timestamp);
}
// Constructor for unigram and bigram.
@UsedForTesting
public LanguageModelParam(final CharSequence word0, final CharSequence word1,
final int unigramProbability, final int bigramProbability,
final int timestamp) {