Loading res/values/strings.xml +4 −0 Original line number Diff line number Diff line Loading @@ -888,6 +888,10 @@ <!-- Sound settings screen, setting option summary text --> <string name="vibrate_summary">Vibrate phone for incoming calls</string> <!-- Sound settings screen, setting option name --> <string name="speaker_notifications">Always notify on speaker</string> <!-- Sound settings screen, setting option summary text --> <string name="speaker_notifications_summary">Play notifications on the speaker even when using headphones</string> <!-- Sound settings screen, setting option name --> <string name="notification_sound_title">Notification ringtone</string> <!-- Sound settings screen, setting option summary text --> <string name="notification_sound_summary">Set your default notification ringtone</string> Loading res/xml/sound_and_display_settings.xml +7 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,13 @@ android:order="6" android:persistent="false" /> <CheckBoxPreference android:key="speaker_notifications" android:title="@string/speaker_notifications" android:summary="@string/speaker_notifications_summary" android:order="7" android:persistent="false" /> <com.android.settings.DefaultRingtonePreference android:key="notification_sound" android:title="@string/notification_sound_title" Loading src/com/android/settings/SoundAndDisplaySettings.java +13 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements private static final String KEY_SILENT = "silent"; private static final String KEY_VIBRATE = "vibrate"; private static final String KEY_SPEAKER_NOTIFICATIONS = "speaker_notifications"; private static final String KEY_SCREEN_TIMEOUT = "screen_timeout"; private static final String KEY_DTMF_TONE = "dtmf_tone"; private static final String KEY_SOUND_EFFECTS = "sound_effects"; Loading Loading @@ -84,6 +85,7 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements * setting. */ private CheckBoxPreference mVibrate; private CheckBoxPreference mSpeakerNotifications; private CheckBoxPreference mDtmfTone; private CheckBoxPreference mSoundEffects; private CheckBoxPreference mHapticFeedback; Loading Loading @@ -136,6 +138,7 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements mPlayMediaNotificationSounds = (CheckBoxPreference) findPreference(KEY_PLAY_MEDIA_NOTIFICATION_SOUNDS); mVibrate = (CheckBoxPreference) findPreference(KEY_VIBRATE); mSpeakerNotifications = (CheckBoxPreference) findPreference(KEY_SPEAKER_NOTIFICATIONS); mDtmfTone = (CheckBoxPreference) findPreference(KEY_DTMF_TONE); mDtmfTone.setPersistent(false); mDtmfTone.setChecked(Settings.System.getInt(resolver, Loading Loading @@ -266,6 +269,12 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements mVibrate.setChecked(vibrateSetting); } boolean speakerNotificationSetting = Settings.Secure.getInt(getContentResolver(), Settings.System.NOTIFICATIONS_TO_SPEAKER, 1) != 0; if (speakerNotificationSetting != mSpeakerNotifications.isChecked() || force) { mSpeakerNotifications.setChecked(speakerNotificationSetting); } int silentModeStreams = Settings.System.getInt(getContentResolver(), Settings.System.MODE_RINGER_STREAMS_AFFECTED, 0); boolean isAlarmInclSilentMode = (silentModeStreams & (1 << AudioManager.STREAM_ALARM)) != 0; Loading Loading @@ -369,6 +378,10 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements Settings.System.putInt(getContentResolver(), Settings.System.HAPTIC_FEEDBACK_ENABLED, mHapticFeedback.isChecked() ? 1 : 0); } else if (preference == mSpeakerNotifications) { Settings.System.putInt(getContentResolver(), Settings.System.NOTIFICATIONS_TO_SPEAKER, mSpeakerNotifications.isChecked() ? 1 : 0); } else if (preference == mNotificationPulse) { value = mNotificationPulse.isChecked(); Settings.System.putInt(getContentResolver(), Loading Loading
res/values/strings.xml +4 −0 Original line number Diff line number Diff line Loading @@ -888,6 +888,10 @@ <!-- Sound settings screen, setting option summary text --> <string name="vibrate_summary">Vibrate phone for incoming calls</string> <!-- Sound settings screen, setting option name --> <string name="speaker_notifications">Always notify on speaker</string> <!-- Sound settings screen, setting option summary text --> <string name="speaker_notifications_summary">Play notifications on the speaker even when using headphones</string> <!-- Sound settings screen, setting option name --> <string name="notification_sound_title">Notification ringtone</string> <!-- Sound settings screen, setting option summary text --> <string name="notification_sound_summary">Set your default notification ringtone</string> Loading
res/xml/sound_and_display_settings.xml +7 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,13 @@ android:order="6" android:persistent="false" /> <CheckBoxPreference android:key="speaker_notifications" android:title="@string/speaker_notifications" android:summary="@string/speaker_notifications_summary" android:order="7" android:persistent="false" /> <com.android.settings.DefaultRingtonePreference android:key="notification_sound" android:title="@string/notification_sound_title" Loading
src/com/android/settings/SoundAndDisplaySettings.java +13 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements private static final String KEY_SILENT = "silent"; private static final String KEY_VIBRATE = "vibrate"; private static final String KEY_SPEAKER_NOTIFICATIONS = "speaker_notifications"; private static final String KEY_SCREEN_TIMEOUT = "screen_timeout"; private static final String KEY_DTMF_TONE = "dtmf_tone"; private static final String KEY_SOUND_EFFECTS = "sound_effects"; Loading Loading @@ -84,6 +85,7 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements * setting. */ private CheckBoxPreference mVibrate; private CheckBoxPreference mSpeakerNotifications; private CheckBoxPreference mDtmfTone; private CheckBoxPreference mSoundEffects; private CheckBoxPreference mHapticFeedback; Loading Loading @@ -136,6 +138,7 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements mPlayMediaNotificationSounds = (CheckBoxPreference) findPreference(KEY_PLAY_MEDIA_NOTIFICATION_SOUNDS); mVibrate = (CheckBoxPreference) findPreference(KEY_VIBRATE); mSpeakerNotifications = (CheckBoxPreference) findPreference(KEY_SPEAKER_NOTIFICATIONS); mDtmfTone = (CheckBoxPreference) findPreference(KEY_DTMF_TONE); mDtmfTone.setPersistent(false); mDtmfTone.setChecked(Settings.System.getInt(resolver, Loading Loading @@ -266,6 +269,12 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements mVibrate.setChecked(vibrateSetting); } boolean speakerNotificationSetting = Settings.Secure.getInt(getContentResolver(), Settings.System.NOTIFICATIONS_TO_SPEAKER, 1) != 0; if (speakerNotificationSetting != mSpeakerNotifications.isChecked() || force) { mSpeakerNotifications.setChecked(speakerNotificationSetting); } int silentModeStreams = Settings.System.getInt(getContentResolver(), Settings.System.MODE_RINGER_STREAMS_AFFECTED, 0); boolean isAlarmInclSilentMode = (silentModeStreams & (1 << AudioManager.STREAM_ALARM)) != 0; Loading Loading @@ -369,6 +378,10 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements Settings.System.putInt(getContentResolver(), Settings.System.HAPTIC_FEEDBACK_ENABLED, mHapticFeedback.isChecked() ? 1 : 0); } else if (preference == mSpeakerNotifications) { Settings.System.putInt(getContentResolver(), Settings.System.NOTIFICATIONS_TO_SPEAKER, mSpeakerNotifications.isChecked() ? 1 : 0); } else if (preference == mNotificationPulse) { value = mNotificationPulse.isChecked(); Settings.System.putInt(getContentResolver(), Loading