diff options
author | Eric Laurent <elaurent@google.com> | 2014-11-13 18:17:55 -0800 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2014-11-17 18:48:08 -0800 |
commit | 29e6cecdd8562700ab625c5645ddd6a7753789f1 (patch) | |
tree | e6b4da8119778e487653f7d74e087228e0b79e80 /media | |
parent | 88ec9e992af75f9783794df5d7be31c3b018ad09 (diff) | |
download | frameworks_av-29e6cecdd8562700ab625c5645ddd6a7753789f1.zip frameworks_av-29e6cecdd8562700ab625c5645ddd6a7753789f1.tar.gz frameworks_av-29e6cecdd8562700ab625c5645ddd6a7753789f1.tar.bz2 |
audio policy: do not prevent routing to A2DP when suspended.
Allow A2DP sink selection even if A2DP is suspended.
It is not because use of A2DP is temporarily disabled by SCO
selection that the policy rule routing a given use case
to A2DP should be altered. The source will be routed to A2DP
but it will remain silent until suspend condition is cleared
which is the purpose of suspend mode.
Also make sure that accessibility prompts are audible while in call
by forcing stream type to STREAM_VOICE_CALL.
Fix inconsistent logic between AudioTrack::setStreamTypeFromAttributes()
and AudioPolicyManager::getStrategyForAttr()
Bug: 18095151.
Change-Id: I1c75dd8288ed3dd494eb942060eac9c9660dca50
Diffstat (limited to 'media')
-rw-r--r-- | media/libmedia/AudioTrack.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index 2f57b9d..c11050e 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -2149,6 +2149,11 @@ void AudioTrack::setStreamTypeFromAttributes(audio_attributes_t& aa) { mStreamType = AUDIO_STREAM_ALARM; break; } + audio_mode_t phoneState = AudioSystem::getPhoneState(); + if (phoneState == AUDIO_MODE_IN_CALL || phoneState == AUDIO_MODE_IN_COMMUNICATION) { + mStreamType = AUDIO_STREAM_VOICE_CALL; + break; + } } /// FALL THROUGH case AUDIO_USAGE_MEDIA: case AUDIO_USAGE_GAME: |