diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2012-10-10 16:30:37 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-10-10 16:30:56 -0700 |
commit | bcfc1ca8ab8bf057e20d9369af3d007d80ca83e4 (patch) | |
tree | 105532e4538a4d0839777896ee1a6d520b50d45a /media/java | |
parent | fb9010798d9352fd4f9413f882ffd214d69610b5 (diff) | |
parent | d677054ca63f55abaa1c478ea3c50f6be665a979 (diff) | |
download | frameworks_base-bcfc1ca8ab8bf057e20d9369af3d007d80ca83e4.zip frameworks_base-bcfc1ca8ab8bf057e20d9369af3d007d80ca83e4.tar.gz frameworks_base-bcfc1ca8ab8bf057e20d9369af3d007d80ca83e4.tar.bz2 |
Merge "Don't play notifications during speech recognition" into jb-mr1-dev
Diffstat (limited to 'media/java')
-rw-r--r-- | media/java/android/media/AudioManager.java | 10 | ||||
-rw-r--r-- | media/java/android/media/AudioSystem.java | 7 |
2 files changed, 17 insertions, 0 deletions
diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java index ee17bd3..035b282 100644 --- a/media/java/android/media/AudioManager.java +++ b/media/java/android/media/AudioManager.java @@ -1526,6 +1526,16 @@ public class AudioManager { /** * @hide + * Checks whether speech recognition is active + * @return true if a recording with source {@link MediaRecorder.AudioSource#VOICE_RECOGNITION} + * is underway. + */ + public boolean isSpeechRecognitionActive() { + return AudioSystem.isSourceActive(MediaRecorder.AudioSource.VOICE_RECOGNITION); + } + + /** + * @hide * If the stream is active locally or remotely, adjust its volume according to the enforced * priority rules. * Note: only AudioManager.STREAM_MUSIC is supported at the moment diff --git a/media/java/android/media/AudioSystem.java b/media/java/android/media/AudioSystem.java index 103e817..260ddc7 100644 --- a/media/java/android/media/AudioSystem.java +++ b/media/java/android/media/AudioSystem.java @@ -111,6 +111,13 @@ public class AudioSystem public static native boolean isStreamActive(int stream, int inPastMs); /* + * Checks whether the specified audio source is active. + * + * return true if any recorder using this source is currently recording + */ + public static native boolean isSourceActive(int source); + + /* * Sets a group generic audio configuration parameters. The use of these parameters * are platform dependent, see libaudio * |