hal: fix music playback mute issues for a2dp suspended scenarios

Music may not be resumed after A2DP resumed due to improper mute
applied and not restored.

CRs-Fixed: 2088539

Change-Id: I3a222f128659de603504f6bed4d4e3cdcc7a125b
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 996a9a1..6d6adaa 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -1731,10 +1731,10 @@
             voice_check_and_update_aanc_path(adev, usecase->out_snd_device, false);
     }
 
-    if ((usecase->out_snd_device == SND_DEVICE_OUT_SPEAKER_AND_BT_A2DP) &&
+    if ((out_snd_device == SND_DEVICE_OUT_SPEAKER_AND_BT_A2DP) &&
         (!audio_extn_a2dp_is_ready())) {
         ALOGW("%s: A2DP profile is not ready, routing to speaker only", __func__);
-        usecase->out_snd_device = SND_DEVICE_OUT_SPEAKER;
+        out_snd_device = SND_DEVICE_OUT_SPEAKER;
     }
 
     /* Disable current sound devices */
@@ -3113,7 +3113,7 @@
                     audio_extn_perf_lock_release(&adev->perf_lock_handle);
                 if ((out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) &&
                     out->a2dp_compress_mute &&
-                    (!(out->devices & AUDIO_DEVICE_OUT_ALL_A2DP))) {
+                    (!(out->devices & AUDIO_DEVICE_OUT_ALL_A2DP) || audio_extn_a2dp_is_ready())) {
                     pthread_mutex_lock(&out->compr_mute_lock);
                     out->a2dp_compress_mute = false;
                     out_set_compr_volume(&out->stream, out->volume_l, out->volume_r);