summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2014-11-01 00:33:01 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-11-01 00:33:01 +0000
commit16ef7c8241925b898d842decc023c73d4790c8cd (patch)
treec76b92294c2b769f8504b72045dbeb84df44c799 /media
parentd3a24af8c242aba843022eef51d2c0505bdd281e (diff)
parent7957cf094ae4d6c88f535a8f9c4833fb9eaf449f (diff)
downloadframeworks_av-16ef7c8241925b898d842decc023c73d4790c8cd.zip
frameworks_av-16ef7c8241925b898d842decc023c73d4790c8cd.tar.gz
frameworks_av-16ef7c8241925b898d842decc023c73d4790c8cd.tar.bz2
am 7957cf09: am d9cfeb44: Support speaker routing for FLAG_BEACON
* commit '7957cf094ae4d6c88f535a8f9c4833fb9eaf449f': Support speaker routing for FLAG_BEACON
Diffstat (limited to 'media')
-rw-r--r--media/libmedia/AudioTrack.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp
index 0a89fbb..97c8d84 100644
--- a/media/libmedia/AudioTrack.cpp
+++ b/media/libmedia/AudioTrack.cpp
@@ -278,7 +278,9 @@ status_t AudioTrack::set(
}
// handle default values first.
- if (streamType == AUDIO_STREAM_DEFAULT) {
+ // TODO once AudioPolicyManager fully supports audio_attributes_t,
+ // remove stream "text-to-speech" redirect
+ if ((streamType == AUDIO_STREAM_DEFAULT) || (streamType == AUDIO_STREAM_TTS)) {
streamType = AUDIO_STREAM_MUSIC;
}
@@ -2124,6 +2126,12 @@ void AudioTrack::setStreamTypeFromAttributes(audio_attributes_t& aa) {
mStreamType = AUDIO_STREAM_BLUETOOTH_SCO;
return;
}
+ // TODO once AudioPolicyManager fully supports audio_attributes_t,
+ // remove stream remap, the flag will be enough
+ if ((aa.flags & AUDIO_FLAG_BEACON) == AUDIO_FLAG_BEACON) {
+ mStreamType = AUDIO_STREAM_TTS;
+ return;
+ }
// usage to stream type mapping
switch (aa.usage) {
@@ -2174,7 +2182,7 @@ void AudioTrack::setStreamTypeFromAttributes(audio_attributes_t& aa) {
bool AudioTrack::isValidAttributes(const audio_attributes_t *paa) {
// has flags that map to a strategy?
- if ((paa->flags & (AUDIO_FLAG_AUDIBILITY_ENFORCED | AUDIO_FLAG_SCO)) != 0) {
+ if ((paa->flags & (AUDIO_FLAG_AUDIBILITY_ENFORCED | AUDIO_FLAG_SCO | AUDIO_FLAG_BEACON)) != 0) {
return true;
}