summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/NotificationManagerService.java
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2013-07-31 14:19:18 -0700
committerJean-Michel Trivi <jmtrivi@google.com>2013-07-31 14:37:19 -0700
commit2380566debfc57eb1cc07db1306ccee23b84ddd4 (patch)
tree4d1073bd9e3c7e3d8a0408a3ee8ca0e3a0582f5b /services/java/com/android/server/NotificationManagerService.java
parent3a6f25512c0a682b10961a5a7428e3393ffb0b75 (diff)
Notification muting conditional to exclusive audio focus request
Summary of feature: Do not mute notifications when speech recognition recording is active, but when an app has requested audio focus with AudioManager.AUDIOFOCUS_GAIN_TRANSIENT_EXCLUSIVE. Implementation: Move definition of AUDIOFOCUS_NONE to AudioManager where other audio focus codes are defined. Add support for querying the current audio focus type. When audio focus is requested as GAIN_TRANSIENT_EXCLUSIVE, make the corresponding loss by LOSS_TRANSIENT. Before playing a notification, check whether GAIN_TRANSIENT_EXCLUSIVE has been requested. Bug 8251963 Change-Id: I41edc77326b70639d2fdcb4642c53109995b72a8
Diffstat (limited to 'services/java/com/android/server/NotificationManagerService.java')
-rw-r--r--services/java/com/android/server/NotificationManagerService.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java
index bdf6129f84be..3ac05fd35d4c 100644
--- a/services/java/com/android/server/NotificationManagerService.java
+++ b/services/java/com/android/server/NotificationManagerService.java
@@ -1873,9 +1873,9 @@ public class NotificationManagerService extends INotificationManager.Stub
}
mSoundNotification = r;
// do not play notifications if stream volume is 0 (typically because
- // ringer mode is silent) or if speech recognition is active.
+ // ringer mode is silent) or if there is a user of exclusive audio focus
if ((audioManager.getStreamVolume(audioStreamType) != 0)
- && !audioManager.isSpeechRecognitionActive()) {
+ && !audioManager.isAudioFocusExclusive()) {
final long identity = Binder.clearCallingIdentity();
try {
final IRingtonePlayer player = mAudioService.getRingtonePlayer();