diff options
Diffstat (limited to 'java/src/com/android/inputmethod/latin/KeyboardSwitcher.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/KeyboardSwitcher.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java index ec422174d..3a54904d3 100644 --- a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java +++ b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java @@ -160,11 +160,10 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha // Indicates whether or not we have the settings key private boolean mHasSettingsKey; private static final int SETTINGS_KEY_MODE_AUTO = R.string.settings_key_mode_auto; - private static final int SETTINGS_KEY_MODE_ALWAYS_SHOW = R.string.settings_key_mode_always_show; - // NOTE: No need to have SETTINGS_KEY_MODE_ALWAYS_HIDE here because it's not being referred to - // in the source code now. - // Default is SETTINGS_KEY_MODE_AUTO. - private static final int DEFAULT_SETTINGS_KEY_MODE = SETTINGS_KEY_MODE_AUTO; + private static final int SETTINGS_KEY_MODE_ALWAYS_SHOW = + R.string.settings_key_mode_always_show; + private static final int SETTINGS_KEY_MODE_ALWAYS_HIDE = + R.string.settings_key_mode_always_hide; private int mLastDisplayWidth; private LanguageSwitcher mLanguageSwitcher; @@ -543,8 +542,12 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha private void updateSettingsKeyState(SharedPreferences prefs) { Resources resources = mInputMethodService.getResources(); + final boolean showSettingsKeyOption = resources.getBoolean( + R.bool.config_enable_show_settings_key_option); + final int defaultSettingsKeyMode = showSettingsKeyOption + ? SETTINGS_KEY_MODE_AUTO : SETTINGS_KEY_MODE_ALWAYS_HIDE; final String settingsKeyMode = prefs.getString(LatinIMESettings.PREF_SETTINGS_KEY, - resources.getString(DEFAULT_SETTINGS_KEY_MODE)); + resources.getString(defaultSettingsKeyMode)); // We show the settings key when 1) SETTINGS_KEY_MODE_ALWAYS_SHOW or // 2) SETTINGS_KEY_MODE_AUTO and there are two or more enabled IMEs on the system if (settingsKeyMode.equals(resources.getString(SETTINGS_KEY_MODE_ALWAYS_SHOW)) |