diff options
author | Eric Laurent <elaurent@google.com> | 2014-09-26 22:59:58 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-09-26 22:59:59 +0000 |
commit | 504de531a08facd130fa00f64fdc00521a975175 (patch) | |
tree | 7a4511c4c58cb07bb368929cf5c5c32a4f779691 /media/libmedia/AudioTrack.cpp | |
parent | 5f5d0544454f062c1f37acad1a72d8c47b4a32b2 (diff) | |
parent | bb6c9a05840d924b502ce0f1868fca4881ada1ed (diff) | |
download | frameworks_av-504de531a08facd130fa00f64fdc00521a975175.zip frameworks_av-504de531a08facd130fa00f64fdc00521a975175.tar.gz frameworks_av-504de531a08facd130fa00f64fdc00521a975175.tar.bz2 |
Merge "audio: fix stream type for accessibility usage" into lmp-dev
Diffstat (limited to 'media/libmedia/AudioTrack.cpp')
-rw-r--r-- | media/libmedia/AudioTrack.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index ea7b279..e3beba5 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -2124,9 +2124,16 @@ void AudioTrack::setStreamTypeFromAttributes(audio_attributes_t& aa) { // usage to stream type mapping switch (aa.usage) { + case AUDIO_USAGE_ASSISTANCE_ACCESSIBILITY: + // TODO once AudioPolicyManager fully supports audio_attributes_t, + // remove stream change based on phone state + if (AudioSystem::getPhoneState() == AUDIO_MODE_RINGTONE) { + mStreamType = AUDIO_STREAM_RING; + break; + } + /// FALL THROUGH case AUDIO_USAGE_MEDIA: case AUDIO_USAGE_GAME: - case AUDIO_USAGE_ASSISTANCE_ACCESSIBILITY: case AUDIO_USAGE_ASSISTANCE_NAVIGATION_GUIDANCE: mStreamType = AUDIO_STREAM_MUSIC; return; |