summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2011-07-19 19:31:01 -0700
committerEric Laurent <elaurent@google.com>2011-07-19 19:31:01 -0700
commit9133a10190a4e788a5dfb616ce18c25549f5e1dc (patch)
tree620775c62dba98260b1375c38216fe02f9865633 /src
parent6ba9e021d40b0232c5d46afb366cf986b3fa9ce4 (diff)
downloadpackages_apps_settings-9133a10190a4e788a5dfb616ce18c25549f5e1dc.zip
packages_apps_settings-9133a10190a4e788a5dfb616ce18c25549f5e1dc.tar.gz
packages_apps_settings-9133a10190a4e788a5dfb616ce18c25549f5e1dc.tar.bz2
Fix issue 5012047: silent mode mutes music
Always display notification volume seek bar and ignore "use ringtone volume for notifications" check box on non voice capable devices (tablets). Change-Id: I379eb6858594a271b9ee11a2359bfdc27153c5af
Diffstat (limited to 'src')
-rw-r--r--src/com/android/settings/RingerVolumePreference.java34
1 files changed, 20 insertions, 14 deletions
diff --git a/src/com/android/settings/RingerVolumePreference.java b/src/com/android/settings/RingerVolumePreference.java
index b546265..f850b08 100644
--- a/src/com/android/settings/RingerVolumePreference.java
+++ b/src/com/android/settings/RingerVolumePreference.java
@@ -171,12 +171,15 @@ public class RingerVolumePreference extends VolumePreference implements
mNotificationsUseRingVolumeCheckbox =
(CheckBox) view.findViewById(R.id.same_notification_volume);
mNotificationsUseRingVolumeCheckbox.setOnCheckedChangeListener(this);
- mNotificationsUseRingVolumeCheckbox.setChecked(
- Utils.isVoiceCapable(getContext())
- && Settings.System.getInt(
+ mNotificationsUseRingVolumeCheckbox.setChecked(Settings.System.getInt(
getContext().getContentResolver(),
Settings.System.NOTIFICATIONS_USE_RING_VOLUME, 1) == 1);
- setNotificationVolumeVisibility(!mNotificationsUseRingVolumeCheckbox.isChecked());
+ // Notification volume always visible for non voice capable devices
+ if (Utils.isVoiceCapable(getContext())) {
+ setNotificationVolumeVisibility(!mNotificationsUseRingVolumeCheckbox.isChecked());
+ } else {
+ setNotificationVolumeVisibility(true);
+ }
disableSettingsThatNeedVoice(view);
// Register callbacks for mute/unmute buttons
@@ -240,16 +243,19 @@ public class RingerVolumePreference extends VolumePreference implements
}
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
- setNotificationVolumeVisibility(!isChecked);
-
- Settings.System.putInt(getContext().getContentResolver(),
- Settings.System.NOTIFICATIONS_USE_RING_VOLUME, isChecked ? 1 : 0);
-
- if (isChecked) {
- // The user wants the notification to be same as ring, so do a
- // one-time sync right now
- mAudioManager.setStreamVolume(AudioManager.STREAM_NOTIFICATION,
- mAudioManager.getStreamVolume(AudioManager.STREAM_RING), 0);
+ // ignore R.id.same_notification_volume checkbox for non voice capable devices
+ if (Utils.isVoiceCapable(getContext())) {
+ setNotificationVolumeVisibility(!isChecked);
+
+ Settings.System.putInt(getContext().getContentResolver(),
+ Settings.System.NOTIFICATIONS_USE_RING_VOLUME, isChecked ? 1 : 0);
+
+ if (isChecked) {
+ // The user wants the notification to be same as ring, so do a
+ // one-time sync right now
+ mAudioManager.setStreamVolume(AudioManager.STREAM_NOTIFICATION,
+ mAudioManager.getStreamVolume(AudioManager.STREAM_RING), 0);
+ }
}
}