hal: VoIP call auto recovery if SSR happens during call

Add support for VoIP call auto recovery if subsystem
restart(SSR) happens during VoIP call.

CRs-Fixed: 689087
Change-Id: I5617c22b79548de668b28a97c116008e7c704dee
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 037f1f4..247918f 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -1790,6 +1790,10 @@
     if (ret != 0) {
         if (out->pcm)
             ALOGE("%s: error %d - %s", __func__, ret, pcm_get_error(out->pcm));
+        if (out->usecase == USECASE_COMPRESS_VOIP_CALL) {
+            voice_extn_compress_voip_close_output_stream(&out->stream.common);
+            out->standby = true;
+        }
         out_standby(&out->stream.common);
         usleep(bytes * 1000000 / audio_stream_frame_size(&out->stream.common) /
                         out_get_sample_rate(&out->stream.common));
@@ -2202,6 +2206,10 @@
     pthread_mutex_unlock(&in->lock);
 
     if (ret != 0) {
+        if (in->usecase == USECASE_COMPRESS_VOIP_CALL) {
+            voice_extn_compress_voip_close_input_stream(&in->stream.common);
+            in->standby = true;
+        }
         in_standby(&in->stream.common);
         ALOGV("%s: read failed - sleeping for buffer duration", __func__);
         usleep(bytes * 1000000 / audio_stream_frame_size(&in->stream.common) /