From c7f2878cf5d507cce19adbe7dcb75f359366ccd9 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Wed, 30 May 2012 14:57:24 +0900 Subject: [PATCH] Remove a vibration-related option when there's no vibrator Bug: 6567160 Change-Id: I1b5d425ffb64b2d7390cd0b7be0825f6aca17f41 --- java/src/com/android/inputmethod/latin/Settings.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/java/src/com/android/inputmethod/latin/Settings.java b/java/src/com/android/inputmethod/latin/Settings.java index 08f3e8456..c9ff0a5a8 100644 --- a/java/src/com/android/inputmethod/latin/Settings.java +++ b/java/src/com/android/inputmethod/latin/Settings.java @@ -151,6 +151,11 @@ public class Settings extends InputMethodSettingsFragment if (!VibratorUtils.getInstance(context).hasVibrator()) { generalSettings.removePreference(findPreference(PREF_VIBRATE_ON)); + final PreferenceGroup advancedSettings = + (PreferenceGroup) findPreference(PREF_ADVANCED_SETTINGS); + if (null != advancedSettings) { // Theoretically advancedSettings cannot be null + advancedSettings.removePreference(findPreference(PREF_VIBRATION_DURATION_SETTINGS)); + } } final boolean showPopupOption = res.getBoolean(