Loading res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -1591,6 +1591,9 @@ <string name="volume_notification_description">Notifications</string> <!-- Volume description for alarm volume --> <string name="volume_alarm_description">Alarms</string> <!-- Sound settings screen, setting option name checkbox. About vibration setting during incoming calls. [CHAR LIMIT=30] --> <string name="vibrate_when_ringing_title">Vibrate when ringing</string> <!-- Dock settings title, top level --> <string name="dock_settings">Dock</string> Loading res/xml/sound_settings.xml +5 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,11 @@ android:persistent="false" android:ringtoneType="notification" /> <CheckBoxPreference android:key="vibrate_when_ringing" android:title="@string/vibrate_when_ringing_title" android:persistent="false" /> <PreferenceCategory android:title="@string/sound_category_feedback_title"/> Loading src/com/android/settings/SoundSettings.java +14 −3 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ public class SoundSettings extends SettingsPreferenceFragment implements private static final int FALLBACK_EMERGENCY_TONE_VALUE = 0; private static final String KEY_SILENT_MODE = "silent_mode"; private static final String KEY_VIBRATE = "vibrate_on_ring"; private static final String KEY_VIBRATE = "vibrate_when_ringing"; private static final String KEY_RING_VOLUME = "ring_volume"; private static final String KEY_MUSICFX = "musicfx"; private static final String KEY_DTMF_TONE = "dtmf_tone"; Loading @@ -81,6 +81,7 @@ public class SoundSettings extends SettingsPreferenceFragment implements private static final int MSG_UPDATE_RINGTONE_SUMMARY = 1; private static final int MSG_UPDATE_NOTIFICATION_SUMMARY = 2; private CheckBoxPreference mVibrateWhenRinging; private ListPreference mSilentMode; private CheckBoxPreference mDtmfTone; private CheckBoxPreference mSoundEffects; Loading Loading @@ -141,6 +142,11 @@ public class SoundSettings extends SettingsPreferenceFragment implements mSilentMode.setOnPreferenceChangeListener(this); } mVibrateWhenRinging = (CheckBoxPreference) findPreference(KEY_VIBRATE); mVibrateWhenRinging.setPersistent(false); mVibrateWhenRinging.setChecked(Settings.System.getInt(resolver, Settings.System.VIBRATE_WHEN_RINGING, 0) != 0); mDtmfTone = (CheckBoxPreference) findPreference(KEY_DTMF_TONE); mDtmfTone.setPersistent(false); mDtmfTone.setChecked(Settings.System.getInt(resolver, Loading @@ -161,7 +167,9 @@ public class SoundSettings extends SettingsPreferenceFragment implements mRingtonePreference = findPreference(KEY_RINGTONE); mNotificationPreference = findPreference(KEY_NOTIFICATION_SOUND); if (!((Vibrator) getSystemService(Context.VIBRATOR_SERVICE)).hasVibrator()) { Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); if (vibrator == null || !vibrator.hasVibrator()) { getPreferenceScreen().removePreference(mVibrateWhenRinging); getPreferenceScreen().removePreference(mHapticFeedback); } Loading Loading @@ -294,7 +302,10 @@ public class SoundSettings extends SettingsPreferenceFragment implements @Override public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) { if (preference == mDtmfTone) { if (preference == mVibrateWhenRinging) { Settings.System.putInt(getContentResolver(), Settings.System.VIBRATE_WHEN_RINGING, mVibrateWhenRinging.isChecked() ? 1 : 0); } else if (preference == mDtmfTone) { Settings.System.putInt(getContentResolver(), Settings.System.DTMF_TONE_WHEN_DIALING, mDtmfTone.isChecked() ? 1 : 0); Loading Loading
res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -1591,6 +1591,9 @@ <string name="volume_notification_description">Notifications</string> <!-- Volume description for alarm volume --> <string name="volume_alarm_description">Alarms</string> <!-- Sound settings screen, setting option name checkbox. About vibration setting during incoming calls. [CHAR LIMIT=30] --> <string name="vibrate_when_ringing_title">Vibrate when ringing</string> <!-- Dock settings title, top level --> <string name="dock_settings">Dock</string> Loading
res/xml/sound_settings.xml +5 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,11 @@ android:persistent="false" android:ringtoneType="notification" /> <CheckBoxPreference android:key="vibrate_when_ringing" android:title="@string/vibrate_when_ringing_title" android:persistent="false" /> <PreferenceCategory android:title="@string/sound_category_feedback_title"/> Loading
src/com/android/settings/SoundSettings.java +14 −3 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ public class SoundSettings extends SettingsPreferenceFragment implements private static final int FALLBACK_EMERGENCY_TONE_VALUE = 0; private static final String KEY_SILENT_MODE = "silent_mode"; private static final String KEY_VIBRATE = "vibrate_on_ring"; private static final String KEY_VIBRATE = "vibrate_when_ringing"; private static final String KEY_RING_VOLUME = "ring_volume"; private static final String KEY_MUSICFX = "musicfx"; private static final String KEY_DTMF_TONE = "dtmf_tone"; Loading @@ -81,6 +81,7 @@ public class SoundSettings extends SettingsPreferenceFragment implements private static final int MSG_UPDATE_RINGTONE_SUMMARY = 1; private static final int MSG_UPDATE_NOTIFICATION_SUMMARY = 2; private CheckBoxPreference mVibrateWhenRinging; private ListPreference mSilentMode; private CheckBoxPreference mDtmfTone; private CheckBoxPreference mSoundEffects; Loading Loading @@ -141,6 +142,11 @@ public class SoundSettings extends SettingsPreferenceFragment implements mSilentMode.setOnPreferenceChangeListener(this); } mVibrateWhenRinging = (CheckBoxPreference) findPreference(KEY_VIBRATE); mVibrateWhenRinging.setPersistent(false); mVibrateWhenRinging.setChecked(Settings.System.getInt(resolver, Settings.System.VIBRATE_WHEN_RINGING, 0) != 0); mDtmfTone = (CheckBoxPreference) findPreference(KEY_DTMF_TONE); mDtmfTone.setPersistent(false); mDtmfTone.setChecked(Settings.System.getInt(resolver, Loading @@ -161,7 +167,9 @@ public class SoundSettings extends SettingsPreferenceFragment implements mRingtonePreference = findPreference(KEY_RINGTONE); mNotificationPreference = findPreference(KEY_NOTIFICATION_SOUND); if (!((Vibrator) getSystemService(Context.VIBRATOR_SERVICE)).hasVibrator()) { Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); if (vibrator == null || !vibrator.hasVibrator()) { getPreferenceScreen().removePreference(mVibrateWhenRinging); getPreferenceScreen().removePreference(mHapticFeedback); } Loading Loading @@ -294,7 +302,10 @@ public class SoundSettings extends SettingsPreferenceFragment implements @Override public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) { if (preference == mDtmfTone) { if (preference == mVibrateWhenRinging) { Settings.System.putInt(getContentResolver(), Settings.System.VIBRATE_WHEN_RINGING, mVibrateWhenRinging.isChecked() ? 1 : 0); } else if (preference == mDtmfTone) { Settings.System.putInt(getContentResolver(), Settings.System.DTMF_TONE_WHEN_DIALING, mDtmfTone.isChecked() ? 1 : 0); Loading