Loading java/src/com/android/inputmethod/latin/LatinIME.java +6 −2 Original line number Diff line number Diff line Loading @@ -523,7 +523,11 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen suggest.close(); } if (currentSettingsValues.mUsePersonalizedDicts) { if (mSubtypeSwitcher.isSystemLocaleSameAsLocaleOfAllEnabledSubtypes()) { PersonalizationDictionarySessionRegistrar.init(this); } else { PersonalizationDictionarySessionRegistrar.close(this); } } else { PersonalizationHelper.removeAllPersonalizedDictionaries(this); PersonalizationDictionarySessionRegistrar.resetAll(this); Loading Loading @@ -595,7 +599,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen ResearchLogger.getInstance().onDestroy(); } unregisterReceiver(mDictionaryPackInstallReceiver); PersonalizationDictionarySessionRegistrar.onDestroy(this); PersonalizationDictionarySessionRegistrar.close(this); LatinImeLogger.commit(); LatinImeLogger.onDestroy(); super.onDestroy(); Loading java/src/com/android/inputmethod/latin/SubtypeSwitcher.java +12 −0 Original line number Diff line number Diff line Loading @@ -273,6 +273,18 @@ public final class SubtypeSwitcher { return mNeedsToDisplayLanguage.getValue(); } public boolean isSystemLocaleSameAsLocaleOfAllEnabledSubtypes() { final Locale systemLocale = mResources.getConfiguration().locale; final List<InputMethodSubtype> enabledSubtypesOfThisIme = mRichImm.getMyEnabledInputMethodSubtypeList(true); for (final InputMethodSubtype subtype : enabledSubtypesOfThisIme) { if (!systemLocale.equals(SubtypeLocaleUtils.getSubtypeLocale(subtype))) { return false; } } return true; } private static InputMethodSubtype sForcedSubtypeForTesting = null; @UsedForTesting void forceSubtype(final InputMethodSubtype subtype) { Loading java/src/com/android/inputmethod/latin/personalization/PersonalizationDictionarySessionRegistrar.java +1 −1 Original line number Diff line number Diff line Loading @@ -35,6 +35,6 @@ public class PersonalizationDictionarySessionRegistrar { public static void resetAll(final Context context) { } public static void onDestroy(final Context context) { public static void close(final Context context) { } } Loading
java/src/com/android/inputmethod/latin/LatinIME.java +6 −2 Original line number Diff line number Diff line Loading @@ -523,7 +523,11 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen suggest.close(); } if (currentSettingsValues.mUsePersonalizedDicts) { if (mSubtypeSwitcher.isSystemLocaleSameAsLocaleOfAllEnabledSubtypes()) { PersonalizationDictionarySessionRegistrar.init(this); } else { PersonalizationDictionarySessionRegistrar.close(this); } } else { PersonalizationHelper.removeAllPersonalizedDictionaries(this); PersonalizationDictionarySessionRegistrar.resetAll(this); Loading Loading @@ -595,7 +599,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen ResearchLogger.getInstance().onDestroy(); } unregisterReceiver(mDictionaryPackInstallReceiver); PersonalizationDictionarySessionRegistrar.onDestroy(this); PersonalizationDictionarySessionRegistrar.close(this); LatinImeLogger.commit(); LatinImeLogger.onDestroy(); super.onDestroy(); Loading
java/src/com/android/inputmethod/latin/SubtypeSwitcher.java +12 −0 Original line number Diff line number Diff line Loading @@ -273,6 +273,18 @@ public final class SubtypeSwitcher { return mNeedsToDisplayLanguage.getValue(); } public boolean isSystemLocaleSameAsLocaleOfAllEnabledSubtypes() { final Locale systemLocale = mResources.getConfiguration().locale; final List<InputMethodSubtype> enabledSubtypesOfThisIme = mRichImm.getMyEnabledInputMethodSubtypeList(true); for (final InputMethodSubtype subtype : enabledSubtypesOfThisIme) { if (!systemLocale.equals(SubtypeLocaleUtils.getSubtypeLocale(subtype))) { return false; } } return true; } private static InputMethodSubtype sForcedSubtypeForTesting = null; @UsedForTesting void forceSubtype(final InputMethodSubtype subtype) { Loading
java/src/com/android/inputmethod/latin/personalization/PersonalizationDictionarySessionRegistrar.java +1 −1 Original line number Diff line number Diff line Loading @@ -35,6 +35,6 @@ public class PersonalizationDictionarySessionRegistrar { public static void resetAll(final Context context) { } public static void onDestroy(final Context context) { public static void close(final Context context) { } }