From 9a5d2ba03e7c8caf82cce64aa254d2177a72a8cf Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Thu, 10 Feb 2011 16:26:38 +0900 Subject: [PATCH] Stop listening on shared preferences change. It appears it is not useful to listen to this change, because in any case, settings will be reloaded when the view is shown again or when IME is changed. Change-Id: I08dddccc630b01718da7fab011ce14f189dd31c3 --- .../com/android/inputmethod/latin/LatinIME.java | 17 +---------------- .../inputmethod/latin/SubtypeSwitcher.java | 8 -------- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 67a9f3203..fcd9229ec 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -81,8 +81,7 @@ import java.util.Locale; /** * Input method implementation for Qwerty'ish keyboard. */ -public class LatinIME extends InputMethodService implements KeyboardActionListener, - SharedPreferences.OnSharedPreferenceChangeListener { +public class LatinIME extends InputMethodService implements KeyboardActionListener { private static final String TAG = "LatinIME"; private static final boolean PERF_DEBUG = false; private static final boolean TRACE = false; @@ -395,7 +394,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); registerReceiver(mReceiver, filter); mVoiceConnector = VoiceIMEConnector.init(this, prefs, mHandler); - prefs.registerOnSharedPreferenceChangeListener(this); } /** @@ -1941,19 +1939,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen switcher.updateShiftState(); } - @Override - public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, - String key) { - mSubtypeSwitcher.onSharedPreferenceChanged(sharedPreferences, key); - if (Settings.PREF_SELECTED_LANGUAGES.equals(key)) { - mRefreshKeyboardRequired = true; - } else if (Settings.PREF_RECORRECTION_ENABLED.equals(key)) { - mReCorrectionEnabled = sharedPreferences.getBoolean( - Settings.PREF_RECORRECTION_ENABLED, - mResources.getBoolean(R.bool.config_default_recorrection_enabled)); - } - } - @Override public void onSwipeDown() { if (mConfigSwipeDownDismissKeyboardEnabled) diff --git a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java index d8c89a0d4..dee3da425 100644 --- a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java +++ b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java @@ -472,14 +472,6 @@ public class SubtypeSwitcher { } } - public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { - if (mConfigUseSpacebarLanguageSwitcher) { - if (Settings.PREF_SELECTED_LANGUAGES.equals(key)) { - mLanguageSwitcher.loadLocales(sharedPreferences); - } - } - } - /** * Change system locale for this application * @param newLocale