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

Commit f6ba0ba1 authored by Weiyin Jiang's avatar Weiyin Jiang Committed by Gerrit - the friendly Code Review server
Browse files

audio: check for USB device state when opening in/out stream

Check for USB headset device state when opening in/out stream,
and report error if USB headset is not in connected state. That's
to handle error condition gracefully to avoid further crashes in
audio flinger.

Change-Id: Ib33489fec00ac0b5c500fc1fa2dbeb021b51cbef
CRs-Fixed: 2261252
parent a08b7aa5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1157,7 +1157,7 @@ bool audio_extn_usb_connected(struct str_parms *parms) {
    struct usb_card_config *usb_card_info;
    bool usb_connected = false;

    if (str_parms_get_int(parms, "card", &card) >= 0) {
    if ((parms != NULL) && str_parms_get_int(parms, "card", &card) >= 0) {
        usb_connected = audio_extn_usb_alive(card);
    } else {
        list_for_each(node_i, &usbmod->usb_card_conf_list) {