diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2012-10-10 12:03:41 -0700 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2012-10-10 12:03:41 -0700 |
commit | d677054ca63f55abaa1c478ea3c50f6be665a979 (patch) | |
tree | c27e68851c9140ad650d84245e9758625cfec0d5 /services/java/com/android/server | |
parent | a8a6b0848d1c11c3ed0fcb846e3d6c39b91536a0 (diff) | |
download | frameworks_base-d677054ca63f55abaa1c478ea3c50f6be665a979.zip frameworks_base-d677054ca63f55abaa1c478ea3c50f6be665a979.tar.gz frameworks_base-d677054ca63f55abaa1c478ea3c50f6be665a979.tar.bz2 |
Don't play notifications during speech recognition
Add support for querying AudioManager to know whether speech
recognition is currently underway.
Don't play a notification if speech recognition is underway.
Bug 7314859
Change-Id: I1bd013a3168cfe1a6b6dcfd28565e1c3c512eb6a
Diffstat (limited to 'services/java/com/android/server')
-rwxr-xr-x | services/java/com/android/server/NotificationManagerService.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java index 85b488c..2e7a54b 100755 --- a/services/java/com/android/server/NotificationManagerService.java +++ b/services/java/com/android/server/NotificationManagerService.java @@ -1066,8 +1066,9 @@ public class NotificationManagerService extends INotificationManager.Stub } mSoundNotification = r; // do not play notifications if stream volume is 0 - // (typically because ringer mode is silent). - if (audioManager.getStreamVolume(audioStreamType) != 0) { + // (typically because ringer mode is silent) or if speech recognition is active. + if ((audioManager.getStreamVolume(audioStreamType) != 0) + && !audioManager.isSpeechRecognitionActive()) { final long identity = Binder.clearCallingIdentity(); try { final IRingtonePlayer player = mAudioService.getRingtonePlayer(); |