diff options
author | nadlabak <pavel@doshaska.net> | 2015-03-23 23:48:52 +0100 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2015-11-07 13:32:38 -0800 |
commit | a91ad73273062403bb85c3e11369bc5e6a26eaf1 (patch) | |
tree | 61dcf9c27c7197f5ea3b16bac88c91f7df980964 /services | |
parent | cd70dd0b5b3062e608909afa0b808a1c44e68ea2 (diff) | |
download | frameworks_av-a91ad73273062403bb85c3e11369bc5e6a26eaf1.zip frameworks_av-a91ad73273062403bb85c3e11369bc5e6a26eaf1.tar.gz frameworks_av-a91ad73273062403bb85c3e11369bc5e6a26eaf1.tar.bz2 |
audiopolicy: Fix call recording for legacy qcom HAL
Change-Id: I774f75b493c47386ca1eaf004d663432f1041a66
Diffstat (limited to 'services')
-rw-r--r-- | services/audiopolicy/common/managerdefinitions/include/ConfigParsingUtils.h | 5 | ||||
-rw-r--r-- | services/audiopolicy/managerdefault/AudioPolicyManager.cpp | 16 |
2 files changed, 21 insertions, 0 deletions
diff --git a/services/audiopolicy/common/managerdefinitions/include/ConfigParsingUtils.h b/services/audiopolicy/common/managerdefinitions/include/ConfigParsingUtils.h index edcc07e..03b45c2 100644 --- a/services/audiopolicy/common/managerdefinitions/include/ConfigParsingUtils.h +++ b/services/audiopolicy/common/managerdefinitions/include/ConfigParsingUtils.h @@ -251,6 +251,11 @@ const StringToEnum sInChannelsNameToEnumTable[] = { STRING_TO_ENUM(AUDIO_CHANNEL_IN_STEREO), STRING_TO_ENUM(AUDIO_CHANNEL_IN_FRONT_BACK), STRING_TO_ENUM(AUDIO_CHANNEL_IN_5POINT1), +#ifdef LEGACY_ALSA_AUDIO + STRING_TO_ENUM(AUDIO_CHANNEL_IN_VOICE_CALL_MONO), + STRING_TO_ENUM(AUDIO_CHANNEL_IN_VOICE_DNLINK_MONO), + STRING_TO_ENUM(AUDIO_CHANNEL_IN_VOICE_UPLINK_MONO), +#endif }; const StringToEnum sIndexChannelsNameToEnumTable[] = { diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp index c8834da..ee3b72e 100644 --- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp +++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp @@ -1390,6 +1390,22 @@ status_t AudioPolicyManager::getInputForAttr(const audio_attributes_t *attr, } else { *inputType = API_INPUT_LEGACY; } +#ifdef LEGACY_ALSA_AUDIO + // adapt channel selection to input source + switch (inputSource) { + case AUDIO_SOURCE_VOICE_UPLINK: + channelMask |= AUDIO_CHANNEL_IN_VOICE_UPLINK; + break; + case AUDIO_SOURCE_VOICE_DOWNLINK: + channelMask |= AUDIO_CHANNEL_IN_VOICE_DNLINK; + break; + case AUDIO_SOURCE_VOICE_CALL: + channelMask |= AUDIO_CHANNEL_IN_VOICE_UPLINK | AUDIO_CHANNEL_IN_VOICE_DNLINK; + break; + default: + break; + } +#endif if (inputSource == AUDIO_SOURCE_HOTWORD) { ssize_t index = mSoundTriggerSessions.indexOfKey(session); if (index >= 0) { |