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

Commit 4ed330ff authored by Hansong Zhang's avatar Hansong Zhang
Browse files

HF Client: Flatten sec mask for outgoing connection

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I0156d12087a649fa1fdff5de181cf68667444195
parent 51c61688
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -99,7 +99,6 @@ void bta_hf_client_start_open(tBTA_HF_CLIENT_DATA* p_data) {
  /* store parameters */
  /* store parameters */
  if (p_data) {
  if (p_data) {
    client_cb->peer_addr = p_data->api_open.bd_addr;
    client_cb->peer_addr = p_data->api_open.bd_addr;
    client_cb->cli_sec_mask = p_data->api_open.sec_mask;
  }
  }


  /* Check if RFCOMM has any incoming connection to avoid collision. */
  /* Check if RFCOMM has any incoming connection to avoid collision. */
+1 −3
Original line number Original line Diff line number Diff line
@@ -76,8 +76,7 @@ void BTA_HfClientDisable(void) { bta_hf_client_api_disable(); }
 * Returns          void
 * Returns          void
 *
 *
 ******************************************************************************/
 ******************************************************************************/
void BTA_HfClientOpen(const RawAddress& bd_addr, tBTA_SEC sec_mask,
void BTA_HfClientOpen(const RawAddress& bd_addr, uint16_t* p_handle) {
                      uint16_t* p_handle) {
  APPL_TRACE_DEBUG("%s", __func__);
  APPL_TRACE_DEBUG("%s", __func__);
  tBTA_HF_CLIENT_API_OPEN* p_buf =
  tBTA_HF_CLIENT_API_OPEN* p_buf =
      (tBTA_HF_CLIENT_API_OPEN*)osi_malloc(sizeof(tBTA_HF_CLIENT_API_OPEN));
      (tBTA_HF_CLIENT_API_OPEN*)osi_malloc(sizeof(tBTA_HF_CLIENT_API_OPEN));
@@ -90,7 +89,6 @@ void BTA_HfClientOpen(const RawAddress& bd_addr, tBTA_SEC sec_mask,
  p_buf->hdr.event = BTA_HF_CLIENT_API_OPEN_EVT;
  p_buf->hdr.event = BTA_HF_CLIENT_API_OPEN_EVT;
  p_buf->hdr.layer_specific = *p_handle;
  p_buf->hdr.layer_specific = *p_handle;
  p_buf->bd_addr = bd_addr;
  p_buf->bd_addr = bd_addr;
  p_buf->sec_mask = sec_mask;


  bta_sys_sendmsg(p_buf);
  bta_sys_sendmsg(p_buf);
}
}
+0 −2
Original line number Original line Diff line number Diff line
@@ -109,7 +109,6 @@ typedef struct {
  BT_HDR hdr;
  BT_HDR hdr;
  RawAddress bd_addr;
  RawAddress bd_addr;
  uint16_t* handle;
  uint16_t* handle;
  tBTA_SEC sec_mask;
} tBTA_HF_CLIENT_API_OPEN;
} tBTA_HF_CLIENT_API_OPEN;


/* data type for BTA_HF_CLIENT_DISC_RESULT_EVT */
/* data type for BTA_HF_CLIENT_DISC_RESULT_EVT */
@@ -167,7 +166,6 @@ typedef struct {
  RawAddress peer_addr;         /* peer bd address */
  RawAddress peer_addr;         /* peer bd address */
  tSDP_DISCOVERY_DB* p_disc_db; /* pointer to discovery database */
  tSDP_DISCOVERY_DB* p_disc_db; /* pointer to discovery database */
  uint16_t conn_handle;         /* RFCOMM handle of connected service */
  uint16_t conn_handle;         /* RFCOMM handle of connected service */
  tBTA_SEC cli_sec_mask;        /* client security mask */
  tBTA_HF_CLIENT_PEER_FEAT peer_features; /* peer device features */
  tBTA_HF_CLIENT_PEER_FEAT peer_features; /* peer device features */
  tBTA_HF_CLIENT_CHLD_FEAT chld_features; /* call handling features */
  tBTA_HF_CLIENT_CHLD_FEAT chld_features; /* call handling features */
  uint16_t peer_version;                  /* profile version of peer device */
  uint16_t peer_version;                  /* profile version of peer device */
+0 −1
Original line number Original line Diff line number Diff line
@@ -330,7 +330,6 @@ void bta_hf_client_resume_open(tBTA_HF_CLIENT_CB* client_cb) {
    tBTA_HF_CLIENT_DATA msg;
    tBTA_HF_CLIENT_DATA msg;
    msg.hdr.layer_specific = client_cb->handle;
    msg.hdr.layer_specific = client_cb->handle;
    msg.api_open.bd_addr = client_cb->peer_addr;
    msg.api_open.bd_addr = client_cb->peer_addr;
    msg.api_open.sec_mask = client_cb->cli_sec_mask;
    bta_hf_client_start_open(&msg);
    bta_hf_client_start_open(&msg);
  }
  }
}
}
+1 −1
Original line number Original line Diff line number Diff line
@@ -244,7 +244,7 @@ void bta_hf_client_rfc_do_open(tBTA_HF_CLIENT_DATA* p_data) {
          UUID_SERVCLASS_HF_HANDSFREE, client_cb->peer_scn, false,
          UUID_SERVCLASS_HF_HANDSFREE, client_cb->peer_scn, false,
          BTA_HF_CLIENT_MTU, client_cb->peer_addr, &(client_cb->conn_handle),
          BTA_HF_CLIENT_MTU, client_cb->peer_addr, &(client_cb->conn_handle),
          bta_hf_client_mgmt_cback, BTM_SEC_SERVICE_HF_HANDSFREE,
          bta_hf_client_mgmt_cback, BTM_SEC_SERVICE_HF_HANDSFREE,
          client_cb->cli_sec_mask) == PORT_SUCCESS) {
          BTA_SEC_AUTHENTICATE | BTA_SEC_ENCRYPT) == PORT_SUCCESS) {
    bta_hf_client_setup_port(client_cb->conn_handle);
    bta_hf_client_setup_port(client_cb->conn_handle);
    APPL_TRACE_DEBUG("bta_hf_client_rfc_do_open : conn_handle = %d",
    APPL_TRACE_DEBUG("bta_hf_client_rfc_do_open : conn_handle = %d",
                     client_cb->conn_handle);
                     client_cb->conn_handle);
Loading