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

Commit ee4b704b authored by Zach Johnson's avatar Zach Johnson Committed by Automerger Merge Worker
Browse files

Remove BTM_SP_COMPLT_EVT, it's not used am: 32a40f0f am: a582739e

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1394468

Change-Id: I87193b134c38a904c232df5ac8be839d8a71e9c9
parents 217236fc a582739e
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -2559,11 +2559,6 @@ static uint8_t bta_dm_sp_cback(tBTM_SP_EVT event, tBTM_SP_EVT_DATA* p_data) {
      bta_dm_co_rmt_oob(p_data->rmt_oob.bd_addr);
      break;

    case BTM_SP_COMPLT_EVT:
      /* do not report this event - handled by link_key_callback or
       * auth_complete_callback */
      break;

    default:
      status = BTM_NOT_AUTHORIZED;
      break;
+5 −16
Original line number Diff line number Diff line
@@ -3211,17 +3211,17 @@ void btm_proc_sp_req_evt(tBTM_SP_EVT event, uint8_t* p) {
 *
 ******************************************************************************/
void btm_simple_pair_complete(uint8_t* p) {
  tBTM_SP_COMPLT evt_data;
  RawAddress bd_addr;
  tBTM_SEC_DEV_REC* p_dev_rec;
  uint8_t status;
  bool disc = false;

  status = *p++;
  STREAM_TO_BDADDR(evt_data.bd_addr, p);
  STREAM_TO_BDADDR(bd_addr, p);

  p_dev_rec = btm_find_dev(evt_data.bd_addr);
  p_dev_rec = btm_find_dev(bd_addr);
  if (p_dev_rec == NULL) {
    LOG(ERROR) << __func__ << " with unknown BDA: " << evt_data.bd_addr;
    LOG(ERROR) << __func__ << " with unknown BDA: " << bd_addr;
    return;
  }

@@ -3229,9 +3229,7 @@ void btm_simple_pair_complete(uint8_t* p) {
      "btm_simple_pair_complete()  Pair State: %s  Status:%d  sec_state: %u",
      btm_pair_state_descr(btm_cb.pairing_state), status, p_dev_rec->sec_state);

  evt_data.status = BTM_ERR_PROCESSING;
  if (status == HCI_SUCCESS) {
    evt_data.status = BTM_SUCCESS;
    p_dev_rec->sec_flags |= BTM_SEC_AUTHENTICATED;
  } else {
    if (status == HCI_ERR_PAIRING_NOT_ALLOWED) {
@@ -3241,7 +3239,7 @@ void btm_simple_pair_complete(uint8_t* p) {
      /* Change the timer to 1 second */
      alarm_set_on_mloop(btm_cb.pairing_timer, BT_1SEC_TIMEOUT_MS,
                         btm_sec_pairing_timeout, NULL);
    } else if (btm_cb.pairing_bda == evt_data.bd_addr) {
    } else if (btm_cb.pairing_bda == bd_addr) {
      /* stop the timer */
      alarm_cancel(btm_cb.pairing_timer);

@@ -3254,15 +3252,6 @@ void btm_simple_pair_complete(uint8_t* p) {
      disc = true;
  }

  /* Let the pairing state stay active, p_auth_complete_callback will report the
   * failure */
  evt_data.bd_addr = p_dev_rec->bd_addr;
  memcpy(evt_data.dev_class, p_dev_rec->dev_class, DEV_CLASS_LEN);

  if (btm_cb.api.p_sp_callback)
    (*btm_cb.api.p_sp_callback)(BTM_SP_COMPLT_EVT,
                                (tBTM_SP_EVT_DATA*)&evt_data);

  if (disc) {
    /* simple pairing failed */
    /* Avoid sending disconnect on HCI_ERR_PEER_USER */
+0 −10
Original line number Diff line number Diff line
@@ -871,7 +871,6 @@ enum {
  BTM_SP_KEY_REQ_EVT,   /* received USER_PASSKEY_REQUEST event */
  BTM_SP_LOC_OOB_EVT,   /* received result for READ_LOCAL_OOB_DATA command */
  BTM_SP_RMT_OOB_EVT,   /* received REMOTE_OOB_DATA_REQUEST event */
  BTM_SP_COMPLT_EVT,    /* received SIMPLE_PAIRING_COMPLETE event */
};
typedef uint8_t tBTM_SP_EVT;

@@ -981,14 +980,6 @@ typedef struct {
  tBTM_BD_NAME bd_name; /* peer device name */
} tBTM_SP_RMT_OOB;

/* data type for BTM_SP_COMPLT_EVT */
typedef struct {
  RawAddress bd_addr;   /* peer address */
  DEV_CLASS dev_class;  /* peer CoD */
  tBTM_BD_NAME bd_name; /* peer device name */
  tBTM_STATUS status;   /* status of the simple pairing process */
} tBTM_SP_COMPLT;

typedef union {
  tBTM_SP_IO_REQ io_req;       /* BTM_SP_IO_REQ_EVT      */
  tBTM_SP_IO_RSP io_rsp;       /* BTM_SP_IO_RSP_EVT      */
@@ -997,7 +988,6 @@ typedef union {
  tBTM_SP_KEY_REQ key_req;     /* BTM_SP_KEY_REQ_EVT     */
  tBTM_SP_LOC_OOB loc_oob;     /* BTM_SP_LOC_OOB_EVT     */
  tBTM_SP_RMT_OOB rmt_oob;     /* BTM_SP_RMT_OOB_EVT     */
  tBTM_SP_COMPLT complt;       /* BTM_SP_COMPLT_EVT      */
} tBTM_SP_EVT_DATA;

/* Simple Pairing Events.  Called by the stack when Simple Pairing related