exynos: audiohal_comv1: Extend volume type with `VOLUME_TYPE_CALL_RX_MUTE`
* On devices that set mute via mixer ctl rather than RIL, this is useful.
This will not affect devices that don't have the mixer ctl as well,
since the ctl is specified in proxy.
* Rename `VOLUME_TYPE_CALL_MUTE` to `VOLUME_TYPE_CALL_TX_MUTE` to prevent
confusion.
Change-Id: I92985415aa3bf24fa532ad5b8db6d1edac5642bf
Signed-off-by: Francescodario Cuzzocrea <bosconovic@gmail.com>
diff --git a/include/libaudio/audiohal_comv1/audio_proxy_interface.h b/include/libaudio/audiohal_comv1/audio_proxy_interface.h
index 8858124..222273e 100644
--- a/include/libaudio/audiohal_comv1/audio_proxy_interface.h
+++ b/include/libaudio/audiohal_comv1/audio_proxy_interface.h
@@ -23,7 +23,8 @@
VOLUME_TYPE_OFFLOAD = 0,
VOLUME_TYPE_MMAP,
VOLUME_TYPE_CALL,
- VOLUME_TYPE_CALL_MUTE,
+ VOLUME_TYPE_CALL_TX_MUTE,
+ VOLUME_TYPE_CALL_RX_MUTE,
};
/* Compress Function Type */
diff --git a/libaudio/audiohal_comv1/common_audiohal/audio_hw.c b/libaudio/audiohal_comv1/common_audiohal/audio_hw.c
index 1befdc6..a0a4442 100644
--- a/libaudio/audiohal_comv1/common_audiohal/audio_hw.c
+++ b/libaudio/audiohal_comv1/common_audiohal/audio_hw.c
@@ -959,8 +959,10 @@
pthread_mutex_lock(&adev->lock);
if ((device_changed && adev->voice && voice_is_call_active(adev->voice)) ||
adev->active_playback_ausage == AUSAGE_INCALL_MUSIC) {
- if (!adev->voice->mute_voice)
+ if (!adev->voice->mute_voice) {
voice_set_rx_mute(adev->voice, true);
+ proxy_set_volume(adev->proxy, VOLUME_TYPE_CALL_RX_MUTE, true, true);
+ }
voice_set_call_active(adev->voice, false);
proxy_stop_voice_call(adev->proxy);
@@ -1900,7 +1902,7 @@
}
if (output_drives_call(adev, out) && isCallMode(adev)) {
- proxy_set_volume(adev->proxy, VOLUME_TYPE_CALL_MUTE, adev->mic_mute, adev->mic_mute);
+ proxy_set_volume(adev->proxy, VOLUME_TYPE_CALL_TX_MUTE, adev->mic_mute, adev->mic_mute);
ALOGI("%s-%s: Call Mute status updated with %d", stream_table[out->common.stream_type],
__func__, adev->mic_mute);
}
@@ -3555,7 +3557,7 @@
adev->mic_mute = state;
if (isCallMode(adev) == true)
- proxy_set_volume(adev->proxy, VOLUME_TYPE_CALL_MUTE, state, state);
+ proxy_set_volume(adev->proxy, VOLUME_TYPE_CALL_TX_MUTE, state, state);
ALOGD("device-%s: set MIC Mute to (%d)", __func__, (int)state);
pthread_mutex_unlock(&adev->lock);