Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ce0cad1 authored by Jim Miller's avatar Jim Miller Committed by Android (Google) Code Review
Browse files

Merge "Issue 3371080: fix volume update in mute state." into honeycomb

parents 4fe3e53e 0f31fe09
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -236,16 +236,13 @@ 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) {
                if (mSeekBar != null && mAudioManager != null) {
                    int volume = mAudioManager.isStreamMute(mStreamType) ?
                            mAudioManager.getLastAudibleStreamVolume(mStreamType)
                            : mAudioManager.getStreamVolume(mStreamType);
                    mSeekBar.setProgress(volume);
                }
            }
            }
        };

        public SeekBarVolumizer(Context context, SeekBar seekBar, int streamType) {