From 97f855ba4582eb1304aa013e4abf94ae0a3cc480 Mon Sep 17 00:00:00 2001 From: satok Date: Mon, 25 Apr 2011 20:30:54 +0900 Subject: [PATCH] Refresh the dictionary when the language settings were changed on Dogfood keyboard Bug: 4339319 Change-Id: Id6361927f579797932c465988f6728191748f143 --- .../inputmethod/deprecated/LanguageSwitcherProxy.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/java/src/com/android/inputmethod/deprecated/LanguageSwitcherProxy.java b/java/src/com/android/inputmethod/deprecated/LanguageSwitcherProxy.java index 73f0b7a2d..e14a49c49 100644 --- a/java/src/com/android/inputmethod/deprecated/LanguageSwitcherProxy.java +++ b/java/src/com/android/inputmethod/deprecated/LanguageSwitcherProxy.java @@ -29,6 +29,7 @@ import java.util.Locale; // This class is used only when the IME doesn't use method.xml for language switching. public class LanguageSwitcherProxy implements SharedPreferences.OnSharedPreferenceChangeListener { private static final LanguageSwitcherProxy sInstance = new LanguageSwitcherProxy(); + private LatinIME mService; private LanguageSwitcher mLanguageSwitcher; private SharedPreferences mPrefs; @@ -43,6 +44,7 @@ public class LanguageSwitcherProxy implements SharedPreferences.OnSharedPreferen sInstance.mLanguageSwitcher = new LanguageSwitcher(service); sInstance.mLanguageSwitcher.loadLocales(prefs, conf.locale); sInstance.mPrefs = prefs; + sInstance.mService = service; prefs.registerOnSharedPreferenceChangeListener(sInstance); } @@ -80,6 +82,9 @@ public class LanguageSwitcherProxy implements SharedPreferences.OnSharedPreferen if (key.equals(Settings.PREF_SELECTED_LANGUAGES) || key.equals(Settings.PREF_INPUT_LANGUAGE)) { mLanguageSwitcher.loadLocales(prefs, null); + if (mService != null) { + mService.onRefreshKeyboard(); + } } } }