diff options
-rw-r--r-- | src/com/android/settings/SecuritySettings.java | 9 | ||||
-rw-r--r-- | src/com/android/settings/SoundSettings.java | 9 |
2 files changed, 14 insertions, 4 deletions
diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java index dd51295..9236013 100644 --- a/src/com/android/settings/SecuritySettings.java +++ b/src/com/android/settings/SecuritySettings.java @@ -33,6 +33,7 @@ import android.database.Cursor; import android.location.LocationManager; import android.os.Bundle; import android.os.SystemProperties; +import android.os.Vibrator; import android.preference.CheckBoxPreference; import android.preference.ListPreference; import android.preference.Preference; @@ -68,6 +69,7 @@ public class SecuritySettings extends SettingsPreferenceFragment private static final String KEY_LOCK_ENABLED = "lockenabled"; private static final String KEY_VISIBLE_PATTERN = "visiblepattern"; private static final String KEY_TACTILE_FEEDBACK_ENABLED = "unlock_tactile_feedback"; + private static final String KEY_SECURITY_CATEGORY = "security_category"; // Encrypted File Systems constants private static final String PROPERTY_EFS_ENABLED = "persist.security.efs.enabled"; @@ -208,6 +210,13 @@ public class SecuritySettings extends SettingsPreferenceFragment // tactile feedback. Should be common to all unlock preference screens. mTactileFeedback = (CheckBoxPreference) pm.findPreference(KEY_TACTILE_FEEDBACK_ENABLED); + if (!((Vibrator) getSystemService(Context.VIBRATOR_SERVICE)).hasVibrator()) { + PreferenceGroup securityCategory = (PreferenceGroup) + pm.findPreference(KEY_SECURITY_CATEGORY); + if (securityCategory != null && mTactileFeedback != null) { + securityCategory.removePreference(mTactileFeedback); + } + } int activePhoneType = TelephonyManager.getDefault().getPhoneType(); diff --git a/src/com/android/settings/SoundSettings.java b/src/com/android/settings/SoundSettings.java index 686dbe2..4c5fadf 100644 --- a/src/com/android/settings/SoundSettings.java +++ b/src/com/android/settings/SoundSettings.java @@ -114,10 +114,6 @@ public class SoundSettings extends SettingsPreferenceFragment implements mVibrate = (ListPreference) findPreference(KEY_VIBRATE); mVibrate.setOnPreferenceChangeListener(this); - if (!((Vibrator)getSystemService(Context.VIBRATOR_SERVICE)).hasVibrator()) { - getPreferenceScreen().removePreference(mVibrate); - } - mDtmfTone = (CheckBoxPreference) findPreference(KEY_DTMF_TONE); mDtmfTone.setPersistent(false); mDtmfTone.setChecked(Settings.System.getInt(resolver, @@ -135,6 +131,11 @@ public class SoundSettings extends SettingsPreferenceFragment implements mLockSounds.setChecked(Settings.System.getInt(resolver, Settings.System.LOCKSCREEN_SOUNDS_ENABLED, 1) != 0); + if (!((Vibrator) getSystemService(Context.VIBRATOR_SERVICE)).hasVibrator()) { + getPreferenceScreen().removePreference(mVibrate); + getPreferenceScreen().removePreference(mHapticFeedback); + } + if (TelephonyManager.PHONE_TYPE_CDMA == activePhoneType) { ListPreference emergencyTonePreference = (ListPreference) findPreference(KEY_EMERGENCY_TONE); |