Remove a vibration-related option when there's no vibrator

Bug: 6567160
Change-Id: I1b5d425ffb64b2d7390cd0b7be0825f6aca17f41
This commit is contained in:
Jean Chalard 2012-05-30 14:57:24 +09:00
parent 902275cb5d
commit c7f2878cf5

View file

@ -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(