hal: fix incorrect routing for voip calls

-VOIP usecase uses primary output for routing and volume
 control, if no active output is explicitly associated
 with the usecase. But the usecase is getting updated with
 primary output even when an active VOIP output is still
 associated with the usecase, and only input stream is closed.
 This result in incorrect routing for the usecase, as primary
 output is not active and would not have updated device info.
-To fix the issue associate primary output with VOIP usecase
 only if the usecase is not having any other output associated
 but still have a valid input which can be used for voip call.

CRs-Fixed: 2026594
Change-Id: Ib40698cb8cd7577093f98d061ec3923dbe20b7e2
diff --git a/hal/voice_extn/compress_voip.c b/hal/voice_extn/compress_voip.c
index f23ff5b..43dedc5 100644
--- a/hal/voice_extn/compress_voip.c
+++ b/hal/voice_extn/compress_voip.c
@@ -288,7 +288,7 @@
         ALOGV("%s: unexpected because out_stream_count=%d, in_stream_count=%d",
                __func__, voip_data.out_stream_count, voip_data.in_stream_count);
         uc_info = get_usecase_from_list(adev, USECASE_COMPRESS_VOIP_CALL);
-        if (uc_info)
+        if (uc_info && !voip_data.out_stream_count)
             uc_info->stream.out = adev->primary_output;
         ret = -EINVAL;
     }