summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Lee <lerobert@google.com>2019-04-16 18:46:02 +0800
committerRobert Lee <lerobert@google.com>2019-04-19 05:30:09 +0000
commitc5271f78092ef5662b661fb2d8cfa3cbeac15fb0 (patch)
treee409633ef515d9c454460e7dface1cf26d419e92
parent8c373e4c415df9698377de20b5202243a5c9c377 (diff)
downloadandroid_hardware_qcom_audio-c5271f78092ef5662b661fb2d8cfa3cbeac15fb0.tar.gz
android_hardware_qcom_audio-c5271f78092ef5662b661fb2d8cfa3cbeac15fb0.tar.bz2
android_hardware_qcom_audio-c5271f78092ef5662b661fb2d8cfa3cbeac15fb0.zip
audio: fix resume music not smooth after press end call with touch sound
There are three usecases, the first is low-latency-playback(touch sound), the second is audio-playback-voip(end call tone), the third is deep-buffer-playback or compress-offload-playback(Music). When low-latency-playback stop, it will trigger reroute to handset for audio-playback-voip first then reroute to speaker for deep-buffer-playback or compress-offload-playback. The fix is to trigger reroute only when audio-playback-voip stop. Bug: 130128135 Test: Music resume smoothly after press end call button w/ touch sound Change-Id: Id5e8cefd53a852d0ce98a9f5ce095bee5832cb5a Signed-off-by: Robert Lee <lerobert@google.com>
-rw-r--r--hal/audio_hw.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 2807bcc9..e4ccb36c 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -2208,8 +2208,6 @@ static int stop_output_stream(struct stream_out *out)
int i, ret = 0;
struct audio_usecase *uc_info;
struct audio_device *adev = out->dev;
- bool has_voip_usecase =
- get_usecase_from_list(adev, USECASE_AUDIO_PLAYBACK_VOIP) != NULL;
ALOGV("%s: enter: usecase(%d: %s)", __func__,
out->usecase, use_case_table[out->usecase]);
@@ -2259,8 +2257,8 @@ static int stop_output_stream(struct stream_out *out)
speaker when voip stops.
2) trigger voip input to reroute when voip output changes to
hearing aid. */
- if (has_voip_usecase ||
- out->devices & AUDIO_DEVICE_OUT_SPEAKER_SAFE) {
+ if (out->usecase == USECASE_AUDIO_PLAYBACK_VOIP ||
+ out->devices & AUDIO_DEVICE_OUT_SPEAKER_SAFE) {
struct listnode *node;
struct audio_usecase *usecase;
list_for_each(node, &adev->usecase_list) {