summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2014-05-23 11:58:00 -0400
committerJohn Spurlock <jspurlock@google.com>2014-05-27 10:08:00 -0400
commit8600534df66c2ff5846ed230b50c56229322d48a (patch)
treedbd483a1171fc8cc1107e4cce0d3cc749f98748e /media
parent41b170d6066cb52bb3e396c608b01f2981b95e5d (diff)
downloadframeworks_base-8600534df66c2ff5846ed230b50c56229322d48a.zip
frameworks_base-8600534df66c2ff5846ed230b50c56229322d48a.tar.gz
frameworks_base-8600534df66c2ff5846ed230b50c56229322d48a.tar.bz2
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
Diffstat (limited to 'media')
-rw-r--r--media/java/android/media/AudioService.java13
1 files changed, 10 insertions, 3 deletions
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) {