Merge "Prepare using dictionaryFacilitator for amanatto updates."

This commit is contained in:
Keisuke Kuroyanagi 2014-01-08 02:09:47 +00:00 committed by Android (Google) Code Review
commit f86b830986
2 changed files with 12 additions and 4 deletions

View file

@ -524,7 +524,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
if (currentSettingsValues.mUsePersonalizedDicts) {
if (mSubtypeSwitcher.isSystemLocaleSameAsLocaleOfAllEnabledSubtypes()) {
PersonalizationDictionarySessionRegistrar.init(this);
PersonalizationDictionarySessionRegistrar.init(this,
mInputLogic.mSuggest.mDictionaryFacilitator);
} else {
PersonalizationDictionarySessionRegistrar.close(this);
}
@ -568,6 +569,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
new DictionaryFacilitatorForSuggest(this /* context */, subtypeLocale,
settingsValues, this /* DictionaryInitializationListener */,
oldDictionaryFacilitator);
PersonalizationDictionarySessionRegistrar.onConfigurationChanged(
this, getResources().getConfiguration(), dictionaryFacilitator);
final Suggest newSuggest = new Suggest(subtypeLocale, dictionaryFacilitator);
if (settingsValues.mCorrectionEnabled) {
newSuggest.setAutoCorrectionThreshold(settingsValues.mAutoCorrectionThreshold);
@ -619,7 +622,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mOptionsDialog.dismiss();
}
}
PersonalizationDictionarySessionRegistrar.onConfigurationChanged(this, conf);
PersonalizationDictionarySessionRegistrar.onConfigurationChanged(this, conf,
mInputLogic.mSuggest.mDictionaryFacilitator);
super.onConfigurationChanged(conf);
}

View file

@ -19,11 +19,15 @@ package com.android.inputmethod.latin.personalization;
import android.content.Context;
import android.content.res.Configuration;
import com.android.inputmethod.latin.DictionaryFacilitatorForSuggest;
public class PersonalizationDictionarySessionRegistrar {
public static void init(final Context context) {
public static void init(final Context context,
final DictionaryFacilitatorForSuggest dictionaryFacilitator) {
}
public static void onConfigurationChanged(final Context context, final Configuration conf) {
public static void onConfigurationChanged(final Context context, final Configuration conf,
final DictionaryFacilitatorForSuggest dictionaryFacilitator) {
}
public static void onUpdateData(final Context context, final String type) {