summaryrefslogtreecommitdiffstats
path: root/core/java/android/preference
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2011-02-03 17:34:39 -0800
committerEric Laurent <elaurent@google.com>2011-02-03 17:34:39 -0800
commit0f31fe096856b957d1a0ed96541d7731dcc14177 (patch)
tree2f70ecdd091e112475b41c9ee975bece34b6c706 /core/java/android/preference
parentcc84ea17680e566f79fdfc1f3c1d7169c37dd1c2 (diff)
downloadframeworks_base-0f31fe096856b957d1a0ed96541d7731dcc14177.zip
frameworks_base-0f31fe096856b957d1a0ed96541d7731dcc14177.tar.gz
frameworks_base-0f31fe096856b957d1a0ed96541d7731dcc14177.tar.bz2
Issue 3371080: fix volume update in mute state.
VolumePreference should take the stream mute state into account when updating the progress bar if a change is received by the content observer Change-Id: Ia1a8af9d4cc349d2d57753d865e8d2e58daf04f1
Diffstat (limited to 'core/java/android/preference')
-rw-r--r--core/java/android/preference/VolumePreference.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/core/java/android/preference/VolumePreference.java b/core/java/android/preference/VolumePreference.java
index 50ca71e..3b12780 100644
--- a/core/java/android/preference/VolumePreference.java
+++ b/core/java/android/preference/VolumePreference.java
@@ -236,14 +236,11 @@ public class VolumePreference extends SeekBarPreference implements
@Override
public void onChange(boolean selfChange) {
super.onChange(selfChange);
- if (mSeekBar != null) {
- int volume = System.getInt(mContext.getContentResolver(),
- System.VOLUME_SETTINGS[mStreamType], -1);
- // Works around an atomicity problem with volume updates
- // TODO: Fix the actual issue, probably in AudioService
- if (volume >= 0) {
- mSeekBar.setProgress(volume);
- }
+ if (mSeekBar != null && mAudioManager != null) {
+ int volume = mAudioManager.isStreamMute(mStreamType) ?
+ mAudioManager.getLastAudibleStreamVolume(mStreamType)
+ : mAudioManager.getStreamVolume(mStreamType);
+ mSeekBar.setProgress(volume);
}
}
};