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

Commit 58388576 authored by Song Gao's avatar Song Gao Committed by Hansong Zhang
Browse files

HF_Client: Send BTA_HF_CLIENT_RFC_CLOSE_EVT when client_cb == NULL

Bug: 146086992
Test: manual
Change-Id: I685873b0c4c74ddb4e273e2a38307ec2af0bbd13
parent 795b6b1b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -137,6 +137,10 @@ static void bta_hf_client_mgmt_cback(uint32_t code, uint16_t port_handle) {

    RFCOMM_RemoveServer(port_handle);
    p_buf->hdr.event = BTA_HF_CLIENT_RFC_CLOSE_EVT;
  } else if (client_cb == NULL) {
    // client_cb is already cleaned due to hfp client disabled.
    // Assigned a valid event value to header and send this message anyway.
    p_buf->hdr.event = BTA_HF_CLIENT_RFC_CLOSE_EVT;
  }

  p_buf->hdr.layer_specific = client_cb != NULL ? client_cb->handle : 0;