From 8c78752f2bf786ca3e6f45b9dc6955d3b4bba59c Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Mon, 14 May 2012 14:09:43 -0700 Subject: Implement new volume display policy. Whenever a stream type is muted, the progress bar in volume panel is at 0. If a stream is muted by ringer mode and does not control ringer mode, the progress bar is disabled. Pressing VOL- when in vibrate or silent mode resets the last audible volume of ringtone stream (music strem on tablets) to 0. VolumePanel implementation: - Always prefer AudioManager APIs over AudioService APIs when available on both. - Do not use AudioManager.shouldVibrate() (deprecated). Change-Id: I57fcb19ada4e8d729b6b41d668496562ebe340c3 --- media/java/android/media/AudioService.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'media') diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java index 8015203..8da7d0f 100644 --- a/media/java/android/media/AudioService.java +++ b/media/java/android/media/AudioService.java @@ -701,6 +701,10 @@ public class AudioService extends IAudioService.Stub implements OnFinished { // Check if the ringer mode changes with this volume adjustment. If // it does, it will handle adjusting the volume, so we won't below adjustVolume = checkForRingerModeChange(aliasIndex, direction, step); + if ((streamTypeAlias == getMasterStreamType()) && + (mRingerMode == AudioManager.RINGER_MODE_SILENT)) { + streamState.setLastAudibleIndex(0, device); + } } // If stream is muted, adjust last audible index only -- cgit v1.1