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

Commit 24f55294 authored by Weiyin Jiang's avatar Weiyin Jiang
Browse files

hal: notify input/output streams of snd card status upon request

Notify input and output stream of snd card status only if it's
requested. There's no need to notify other irrelevant events.

CRs-Fixed: 2842096
Change-Id: I35cc0e2bbf489268b8da5ff2173355ce36eaa037
parent 8d7aa691
Loading
Loading
Loading
Loading
+14 −11
Original line number Diff line number Diff line
@@ -8789,6 +8789,8 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs)
    /* notify adev and input/output streams on the snd card status */
    adev_snd_mon_cb((void *)adev, parms);

    ret = str_parms_get_str(parms, "SND_CARD_STATUS", value, sizeof(value));
    if (ret >= 0) {
        list_for_each(node, &adev->active_outputs_list) {
            streams_output_ctxt_t *out_ctxt = node_to_item(node,
                                                streams_output_ctxt_t,
@@ -8802,6 +8804,7 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs)
                                                list);
            in_snd_mon_cb((void *)in_ctxt->input, parms);
        }
    }

    pthread_mutex_lock(&adev->lock);
    ret = str_parms_get_str(parms, "BT_SCO", value, sizeof(value));