summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/RingerVolumePreference.java
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2012-05-14 14:06:23 -0700
committerEric Laurent <elaurent@google.com>2012-05-14 14:06:23 -0700
commit9d078e984e5b73c499050dff3443622a4b595524 (patch)
treeeb087943279b8ee79c9d009b8bb72a293ee7d9a8 /src/com/android/settings/RingerVolumePreference.java
parente5050b1be72c5552bfc9c734d5a0e89f215bed62 (diff)
downloadpackages_apps_settings-9d078e984e5b73c499050dff3443622a4b595524.zip
packages_apps_settings-9d078e984e5b73c499050dff3443622a4b595524.tar.gz
packages_apps_settings-9d078e984e5b73c499050dff3443622a4b595524.tar.bz2
Implement new volume display policy.
Whenever a stream type is muted, the progress bar in volume preference is at 0. If a stream is muted by ringer mode and does not control ringer mode, the progress bar is disabled. Change-Id: I29a5e459754f989369dc80504c18ce7ca08ed891
Diffstat (limited to 'src/com/android/settings/RingerVolumePreference.java')
-rw-r--r--src/com/android/settings/RingerVolumePreference.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/com/android/settings/RingerVolumePreference.java b/src/com/android/settings/RingerVolumePreference.java
index c80cd35..a79f4a5 100644
--- a/src/com/android/settings/RingerVolumePreference.java
+++ b/src/com/android/settings/RingerVolumePreference.java
@@ -116,8 +116,8 @@ public class RingerVolumePreference extends VolumePreference {
boolean muted = mAudioManager.isStreamMute(streamType);
if (mCheckBoxes[i] != null) {
- if (streamType == AudioManager.STREAM_RING && muted
- && !(mAudioManager.getRingerMode() == AudioManager.RINGER_MODE_SILENT)) {
+ if ((streamType == AudioManager.STREAM_RING) &&
+ (mAudioManager.getRingerMode() == AudioManager.RINGER_MODE_VIBRATE)) {
mCheckBoxes[i].setImageResource(
com.android.internal.R.drawable.ic_audio_ring_notif_vibrate);
} else {
@@ -126,9 +126,13 @@ public class RingerVolumePreference extends VolumePreference {
}
}
if (mSeekBars[i] != null) {
- final int volume = muted ? mAudioManager.getLastAudibleStreamVolume(streamType)
- : mAudioManager.getStreamVolume(streamType);
+ final int volume = mAudioManager.getStreamVolume(streamType);
mSeekBars[i].setProgress(volume);
+ if (streamType != mAudioManager.getMasterStreamType() && muted) {
+ mSeekBars[i].setEnabled(false);
+ } else {
+ mSeekBars[i].setEnabled(true);
+ }
}
}
}
@@ -169,9 +173,6 @@ public class RingerVolumePreference extends VolumePreference {
}
}
- final int silentableStreams = System.getInt(getContext().getContentResolver(),
- System.MODE_RINGER_STREAMS_AFFECTED,
- ((1 << AudioSystem.STREAM_NOTIFICATION) | (1 << AudioSystem.STREAM_RING)));
// Register callbacks for mute/unmute buttons
for (int i = 0; i < mCheckBoxes.length; i++) {
ImageView checkbox = (ImageView) view.findViewById(CHECKBOX_VIEW_ID[i]);