hal: Add proper check for incall recording
is_incall_rec_usecase flag is getting set even incase of PCM_PLAYBACK
usecase resulting in wrong PATH sent to acdb_send_audio_cal, add
check of PCM_CAPTURE before setting is_incall_rec_usecase true in
platform_send_audio_calibration.
Change-Id: I2bbeffa61aea5c4bda9092c7bbfba47058c904df
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index e97fd5c..ba1c9cf 100755
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -5469,7 +5469,7 @@
struct audio_backend_cfg backend_cfg = {0};
bool is_bus_dev_usecase = false;
- if (voice_is_in_call_or_call_screen(my_data->adev))
+ if (voice_is_in_call_or_call_screen(my_data->adev) && (usecase->type == PCM_CAPTURE))
is_incall_rec_usecase = voice_is_in_call_rec_stream(usecase->stream.in);
if (compare_device_type(&usecase->device_list, AUDIO_DEVICE_OUT_BUS))
@@ -5477,7 +5477,7 @@
if (usecase->type == PCM_PLAYBACK)
snd_device = usecase->out_snd_device;
- else if ((usecase->type == PCM_CAPTURE) && is_incall_rec_usecase)
+ else if (is_incall_rec_usecase)
snd_device = voice_get_incall_rec_snd_device(usecase->in_snd_device);
else if ((usecase->type == PCM_HFP_CALL) || (usecase->type == PCM_CAPTURE)||
(usecase->type == ICC_CALL) || (usecase->type == SYNTH_LOOPBACK))