Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ab723cfc authored by Mingshu Pang's avatar Mingshu Pang
Browse files

Audio: Remove unnecessary unmute when A2dp device disconnects.

It will cause the audio leak if stream unmutes when Bt-A2dp
disconnect event is received, which will be done in the routing
to non-a2dp device.

Remove unnecessary unmute action when A2dp device disconnects.

CRs-Fixed: 2533905
Change-Id: I74207d13c763a7c0ff5f95bbd90c8ac7b0d61562
parent c4acc925
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -8395,21 +8395,6 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs)
                adev->allow_afe_proxy_usage = true;
            }
        }
        if (audio_is_a2dp_out_device(device)) {
           struct audio_usecase *usecase;
           struct listnode *node;
           list_for_each(node, &adev->usecase_list) {
               usecase = node_to_item(node, struct audio_usecase, list);
               if (PCM_PLAYBACK == usecase->type && usecase->stream.out &&
                  (usecase->stream.out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) &&
                   usecase->stream.out->a2dp_compress_mute) {
                   struct stream_out *out = usecase->stream.out;
                   ALOGD("Unmuting the stream when Bt-A2dp disconnected and stream is mute");
                   out->a2dp_compress_mute = false;
                   out_set_compr_volume(&out->stream, out->volume_l, out->volume_r);
               }
           }
        }
    }

    audio_extn_hfp_set_parameters(adev, parms);