diff options
author | Michael Bestas <mikeioannina@gmail.com> | 2015-01-18 17:54:11 +0200 |
---|---|---|
committer | Adnan Begovic <adnan@cyngn.com> | 2015-10-29 17:36:30 -0700 |
commit | 838253ae18943a2a0c3f6b59a1b29cc2d6a18e72 (patch) | |
tree | 3ee6155178eca012a4f42e0cb3afef4568103eae | |
parent | 3d41100aac8bc0b6776e8a17c52811e23db129e4 (diff) | |
download | packages_apps_Settings-838253ae18943a2a0c3f6b59a1b29cc2d6a18e72.zip packages_apps_Settings-838253ae18943a2a0c3f6b59a1b29cc2d6a18e72.tar.gz packages_apps_Settings-838253ae18943a2a0c3f6b59a1b29cc2d6a18e72.tar.bz2 |
Fix NPE in HighTouchSensivity
Change-Id: I7c33decbd34da8e57a22b66980a51be8e422a2b4
-rw-r--r-- | src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java b/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java index 439efbc..b583d52 100644 --- a/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java +++ b/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java @@ -176,11 +176,18 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment findPreference(KEY_POINTER_SETTINGS_CATEGORY); mHighTouchSensitivity = (SwitchPreference) findPreference(KEY_HIGH_TOUCH_SENSITIVITY); - if (!isHighTouchSensitivitySupported()) { - pointerSettingsCategory.removePreference(mHighTouchSensitivity); - mHighTouchSensitivity = null; - } else { - mHighTouchSensitivity.setChecked(HighTouchSensitivity.isEnabled()); + + if (pointerSettingsCategory != null) { + if (!isHighTouchSensitivitySupported()) { + pointerSettingsCategory.removePreference(mHighTouchSensitivity); + mHighTouchSensitivity = null; + } else { + mHighTouchSensitivity.setChecked(HighTouchSensitivity.isEnabled()); + } + + if (pointerSettingsCategory.getPreferenceCount() == 0) { + getPreferenceScreen().removePreference(pointerSettingsCategory); + } } // Enable or disable mStatusBarImeSwitcher based on boolean: config_show_cmIMESwitcher |