From 8600534df66c2ff5846ed230b50c56229322d48a Mon Sep 17 00:00:00 2001 From: John Spurlock Date: Fri, 23 May 2014 11:58:00 -0400 Subject: VolumeZen: combine ringer/notification volume and zen. - Implement a new volume panel widget, combining volume and zen mode + conditions. - Show zen mode + conditions when modifying ringer or notification streams. - Host the volume panel widget in a dialog when being controlled by the audio service / volume keys. - Remove support for multiple sliders in the volume panel. - Remove support for separate ringer + notification volumes in the volume panel. - Move volume panel resources up to SystemUI. - Create a new combined Notifications quick settings tile. - Host the volume panel widget in the quick settings panel under Notifications. - When the quick settings detail panel is visible, route the volume keys to the embedded widget instead of showing a redundant dialog. - Create common styles for quick settings text to be closer to spec. - Update the framework resources for the ringer stream. - Show the ringer icons in global actions. - Add "until you turn this off" back as a separate zen condition. - Disable time condition buttons when they are N/A. - Don't allow volume changes to set ringer mode silent. Bug:15186070 Change-Id: Id5e321dd1d5e7c4cf3917027ffbdf7e80d38b00d --- media/java/android/media/AudioService.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'media') diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java index c736fc7..5b620fd 100644 --- a/media/java/android/media/AudioService.java +++ b/media/java/android/media/AudioService.java @@ -112,6 +112,9 @@ public class AudioService extends IAudioService.Stub { private static final boolean USE_SESSIONS = true; private static final boolean DEBUG_SESSIONS = true; + /** Allow volume changes to set ringer mode to silent? */ + private static final boolean VOLUME_SETS_RINGER_MODE_SILENT = false; + /** How long to delay before persisting a change in volume/ringer mode. */ private static final int PERSIST_DELAY = 500; @@ -1019,7 +1022,8 @@ public class AudioService extends IAudioService.Stub { int newRingerMode; if (index == 0) { newRingerMode = mHasVibrator ? AudioManager.RINGER_MODE_VIBRATE - : AudioManager.RINGER_MODE_SILENT; + : VOLUME_SETS_RINGER_MODE_SILENT ? AudioManager.RINGER_MODE_SILENT + : AudioManager.RINGER_MODE_NORMAL; } else { newRingerMode = AudioManager.RINGER_MODE_NORMAL; } @@ -2552,7 +2556,9 @@ public class AudioService extends IAudioService.Stub { } } else { // (oldIndex < step) is equivalent to (old UI index == 0) - if ((oldIndex < step) && mPrevVolDirection != AudioManager.ADJUST_LOWER) { + if ((oldIndex < step) + && VOLUME_SETS_RINGER_MODE_SILENT + && mPrevVolDirection != AudioManager.ADJUST_LOWER) { ringerMode = RINGER_MODE_SILENT; } } @@ -2565,7 +2571,8 @@ public class AudioService extends IAudioService.Stub { break; } if ((direction == AudioManager.ADJUST_LOWER)) { - if (mPrevVolDirection != AudioManager.ADJUST_LOWER) { + if (VOLUME_SETS_RINGER_MODE_SILENT + && mPrevVolDirection != AudioManager.ADJUST_LOWER) { ringerMode = RINGER_MODE_SILENT; } } else if (direction == AudioManager.ADJUST_RAISE) { -- cgit v1.1