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

Commit aec67ff9 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Remove dead end code path" am: 37107b7b am: 130c500a

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

Change-Id: I74107d23527af35a777e5c8d6402e38a4fbef79a
parents 0f54f838 130c500a
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -2625,10 +2625,6 @@ static uint8_t bta_dm_sp_cback(tBTM_SP_EVT event, tBTM_SP_EVT_DATA* p_data) {
      bta_dm_cb.p_sec_cback(BTA_DM_SP_KEYPRESS_EVT, &sec_event);
      break;

    case BTM_SP_UPGRADE_EVT:
      bta_dm_co_lk_upgrade(p_data->upgrade.bd_addr, &p_data->upgrade.upgrade);
      break;

    default:
      status = BTM_NOT_AUTHORIZED;
      break;
+0 −15
Original line number Diff line number Diff line
@@ -76,21 +76,6 @@ extern void bta_dm_co_io_req(const RawAddress& bd_addr, tBTA_IO_CAP* p_io_cap,
extern void bta_dm_co_io_rsp(const RawAddress& bd_addr, tBTA_IO_CAP io_cap,
                             tBTA_OOB_DATA oob_data, tBTA_AUTH_REQ auth_req);

/*******************************************************************************
 *
 * Function         bta_dm_co_lk_upgrade
 *
 * Description      This callout function is executed by DM to check if the
 *                  platform wants allow link key upgrade
 *
 * Parameters       bd_addr  - The peer device
 *                  *p_upgrade - true, if link key upgrade is desired.
 *
 * Returns          void.
 *
 ******************************************************************************/
extern void bta_dm_co_lk_upgrade(const RawAddress& bd_addr, bool* p_upgrade);

/*******************************************************************************
 *
 * Function         bta_dm_co_loc_oob
+0 −16
Original line number Diff line number Diff line
@@ -107,22 +107,6 @@ void bta_dm_co_io_rsp(const RawAddress& bd_addr, tBTA_IO_CAP io_cap,
  btif_dm_proc_io_rsp(bd_addr, io_cap, oob_data, auth_req);
}

/*******************************************************************************
 *
 * Function         bta_dm_co_lk_upgrade
 *
 * Description      This callout function is executed by DM to check if the
 *                  platform wants allow link key upgrade
 *
 * Parameters       bd_addr  - The peer device
 *                  *p_upgrade - true, if link key upgrade is desired.
 *
 * Returns          void.
 *
 ******************************************************************************/
void bta_dm_co_lk_upgrade(UNUSED_ATTR const RawAddress& bd_addr,
                          UNUSED_ATTR bool* p_upgrade) {}

/*******************************************************************************
 *
 * Function         bta_dm_co_loc_oob
+6 −21
Original line number Diff line number Diff line
@@ -1623,30 +1623,15 @@ static void btm_sec_check_upgrade(tBTM_SEC_DEV_REC* p_dev_rec,

  if (btm_sec_is_upgrade_possible(p_dev_rec, is_originator)) {
    BTM_TRACE_DEBUG("need upgrade!! sec_flags:0x%x", p_dev_rec->sec_flags);
    /* upgrade is possible: check if the application wants the upgrade.
     * If the application is configured to use a global MITM flag,
     * it probably would not want to upgrade the link key based on the security
     * level database */
    tBTM_SP_UPGRADE evt_data;
    evt_data.bd_addr = p_dev_rec->bd_addr;
    evt_data.upgrade = true;
    if (btm_cb.api.p_sp_callback)
      (*btm_cb.api.p_sp_callback)(BTM_SP_UPGRADE_EVT,
                                  (tBTM_SP_EVT_DATA*)&evt_data);

    BTM_TRACE_DEBUG("evt_data.upgrade:0x%x", evt_data.upgrade);
    if (evt_data.upgrade) {
    /* if the application confirms the upgrade, set the upgrade bit */
    p_dev_rec->sm4 |= BTM_SM4_UPGRADE;

    /* Clear the link key known to go through authentication/pairing again */
      p_dev_rec->sec_flags &=
          ~(BTM_SEC_LINK_KEY_KNOWN | BTM_SEC_LINK_KEY_AUTHED);
    p_dev_rec->sec_flags &= ~(BTM_SEC_LINK_KEY_KNOWN | BTM_SEC_LINK_KEY_AUTHED);
    p_dev_rec->sec_flags &= ~BTM_SEC_AUTHENTICATED;
    BTM_TRACE_DEBUG("sec_flags:0x%x", p_dev_rec->sec_flags);
  }
}
}

/*******************************************************************************
 *
+0 −9
Original line number Diff line number Diff line
@@ -1082,8 +1082,6 @@ enum {
  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 */
  BTM_SP_UPGRADE_EVT /* check if the application wants to upgrade the link key
                        */
};
typedef uint8_t tBTM_SP_EVT;

@@ -1217,12 +1215,6 @@ typedef struct {
  tBTM_STATUS status;   /* status of the simple pairing process */
} tBTM_SP_COMPLT;

/* data type for BTM_SP_UPGRADE_EVT */
typedef struct {
  RawAddress bd_addr; /* peer address */
  bool upgrade;    /* true, to upgrade the link key */
} tBTM_SP_UPGRADE;

typedef union {
  tBTM_SP_IO_REQ io_req;       /* BTM_SP_IO_REQ_EVT      */
  tBTM_SP_IO_RSP io_rsp;       /* BTM_SP_IO_RSP_EVT      */
@@ -1233,7 +1225,6 @@ typedef union {
  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_UPGRADE upgrade;     /* BTM_SP_UPGRADE_EVT      */
} tBTM_SP_EVT_DATA;

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