Merge "Share decoders among latinime components."

This commit is contained in:
Jatin Matani 2015-02-26 17:54:25 +00:00 committed by Android (Google) Code Review
commit 48b071249c
3 changed files with 5 additions and 3 deletions

View file

@ -20,7 +20,7 @@ package com.android.inputmethod.latin;
* Factory for instantiating DictionaryFacilitator objects.
*/
public class DictionaryFacilitatorProvider {
public static DictionaryFacilitator getDictionaryFacilitator() {
public static DictionaryFacilitator getDictionaryFacilitator(boolean isNeededForSpellChecking) {
return new DictionaryFacilitatorImpl();
}
}

View file

@ -41,7 +41,8 @@ public class DictionaryFacilitatorLruCache {
public DictionaryFacilitatorLruCache(final Context context, final String dictionaryNamePrefix) {
mContext = context;
mDictionaryNamePrefix = dictionaryNamePrefix;
mDictionaryFacilitator = DictionaryFacilitatorProvider.getDictionaryFacilitator();
mDictionaryFacilitator = DictionaryFacilitatorProvider.getDictionaryFacilitator(
true /* isNeededForSpellChecking */);
}
private static void waitForLoadingMainDictionary(

View file

@ -126,7 +126,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
final Settings mSettings;
private final DictionaryFacilitator mDictionaryFacilitator =
DictionaryFacilitatorProvider.getDictionaryFacilitator();
DictionaryFacilitatorProvider.getDictionaryFacilitator(
false /* isNeededForSpellChecking */);
final InputLogic mInputLogic = new InputLogic(this /* LatinIME */,
this /* SuggestionStripViewAccessor */, mDictionaryFacilitator);
// We expect to have only one decoder in almost all cases, hence the default capacity of 1.