diff options
Diffstat (limited to 'src/com/android/settings/SoundSettings.java')
-rw-r--r-- | src/com/android/settings/SoundSettings.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/com/android/settings/SoundSettings.java b/src/com/android/settings/SoundSettings.java index 8de9707..9757b63 100644 --- a/src/com/android/settings/SoundSettings.java +++ b/src/com/android/settings/SoundSettings.java @@ -85,6 +85,7 @@ public class SoundSettings extends SettingsPreferenceFragment implements private static final String KEY_QUIET_HOURS = "quiet_hours"; private static final String KEY_VOLBTN_MUSIC_CTRL = "volbtn_music_controls"; private static final String KEY_HEADSET_CONNECT_PLAYER = "headset_connect_player"; + private static final String KEY_CONVERT_SOUND_TO_VIBRATE = "notification_convert_sound_to_vibration"; private static final String RING_MODE_NORMAL = "normal"; private static final String RING_MODE_VIBRATE = "vibrate"; @@ -108,6 +109,7 @@ public class SoundSettings extends SettingsPreferenceFragment implements private CheckBoxPreference mLockSounds; private CheckBoxPreference mVolBtnMusicCtrl; private CheckBoxPreference mHeadsetConnectPlayer; + private CheckBoxPreference mConvertSoundToVibration; private Preference mRingtonePreference; private Preference mNotificationPreference; private PreferenceScreen mQuietHours; @@ -218,6 +220,12 @@ public class SoundSettings extends SettingsPreferenceFragment implements mHeadsetConnectPlayer.setChecked(Settings.System.getInt(resolver, Settings.System.HEADSET_CONNECT_PLAYER, 0) != 0); + mConvertSoundToVibration = (CheckBoxPreference) findPreference(KEY_CONVERT_SOUND_TO_VIBRATE); + + mConvertSoundToVibration.setPersistent(false); + mConvertSoundToVibration.setChecked(Settings.System.getInt(resolver, + Settings.System.NOTIFICATION_CONVERT_SOUND_TO_VIBRATION, 1) != 0); + mRingtonePreference = findPreference(KEY_RINGTONE); mNotificationPreference = findPreference(KEY_NOTIFICATION_SOUND); @@ -397,6 +405,10 @@ public class SoundSettings extends SettingsPreferenceFragment implements Settings.System.putInt(getContentResolver(), Settings.System.LOCKSCREEN_SOUNDS_ENABLED, mLockSounds.isChecked() ? 1 : 0); + } else if (preference == mConvertSoundToVibration) { + Settings.System.putInt(getContentResolver(), Settings.System.NOTIFICATION_CONVERT_SOUND_TO_VIBRATION, + mConvertSoundToVibration.isChecked() ? 1 : 0); + } else if (preference == mMusicFx) { // let the framework fire off the intent return false; |