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

Commit 71309611 authored by Hui Peng's avatar Hui Peng
Browse files

[Invisalign2] Remove pin and pin_len from BTM_SecBond

Bug: 301661850
Test: m com.android.btservices
Change-Id: I8b0f7c897fb805b251464727fe5876c6815cb72d
parent e7d62032
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -161,7 +161,7 @@ void bta_dm_bond(const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type,
  const char* p_name;

  tBTM_STATUS status = get_btm_client_interface().security.BTM_SecBond(
      bd_addr, addr_type, transport, device_type, 0, NULL);
      bd_addr, addr_type, transport, device_type);

  if (bta_dm_sec_cb.p_sec_cback && (status != BTM_CMD_STARTED)) {
    memset(&sec_event, 0, sizeof(tBTA_DM_SEC));
+5 −17
Original line number Diff line number Diff line
@@ -754,15 +754,14 @@ void BTM_PINCodeReply(const RawAddress& bd_addr, tBTM_STATUS res,
 * Description      this is the bond function that will start either SSP or SMP.
 *
 * Parameters:      bd_addr      - Address of the device to bond
 *                  pin_len      - length in bytes of the PIN Code
 *                  p_pin        - pointer to array with the PIN Code
 *                  addr_type    - type of the address
 *                  transport    - transport on which to create bond
 *
 *  Note: After 2.1 parameters are not used and preserved here not to change API
 ******************************************************************************/
tBTM_STATUS btm_sec_bond_by_transport(const RawAddress& bd_addr,
                                      tBLE_ADDR_TYPE addr_type,
                                      tBT_TRANSPORT transport, uint8_t pin_len,
                                      uint8_t* p_pin) {
                                      tBT_TRANSPORT transport) {
  tBTM_SEC_DEV_REC* p_dev_rec;
  tBTM_STATUS status;
  LOG_INFO("%s: Transport used %d, bd_addr=%s", __func__, transport,
@@ -805,13 +804,6 @@ tBTM_STATUS btm_sec_bond_by_transport(const RawAddress& bd_addr,
    return (BTM_NO_RESOURCES);
  }

  /* Save the PIN code if we got a valid one */
  if (p_pin && (pin_len <= PIN_CODE_LEN) && (pin_len != 0)) {
    btm_sec_cb.pin_code_len = pin_len;
    p_dev_rec->pin_code_length = pin_len;
    memcpy(btm_sec_cb.pin_code, p_pin, PIN_CODE_LEN);
  }

  btm_sec_cb.pairing_bda = bd_addr;

  btm_sec_cb.pairing_flags = BTM_PAIR_FLAGS_WE_STARTED_DD;
@@ -921,14 +913,11 @@ tBTM_STATUS btm_sec_bond_by_transport(const RawAddress& bd_addr,
 *
 * Parameters:      bd_addr      - Address of the device to bond
 *                  transport    - doing SSP over BR/EDR or SMP over LE
 *                  pin_len      - length in bytes of the PIN Code
 *                  p_pin        - pointer to array with the PIN Code
 *
 *  Note: After 2.1 parameters are not used and preserved here not to change API
 ******************************************************************************/
tBTM_STATUS BTM_SecBond(const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type,
                        tBT_TRANSPORT transport, tBT_DEVICE_TYPE device_type,
                        uint8_t pin_len, uint8_t* p_pin) {
                        tBT_TRANSPORT transport, tBT_DEVICE_TYPE device_type) {
  if (transport == BT_TRANSPORT_AUTO) {
    if (addr_type == BLE_ADDR_PUBLIC) {
      transport =
@@ -950,8 +939,7 @@ tBTM_STATUS BTM_SecBond(const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type,
        "device on don't match");
    return BTM_ILLEGAL_ACTION;
  }
  return btm_sec_bond_by_transport(bd_addr, addr_type, transport, pin_len,
                                   p_pin);
  return btm_sec_bond_by_transport(bd_addr, addr_type, transport);
}

/*******************************************************************************
+2 −6
Original line number Diff line number Diff line
@@ -208,8 +208,7 @@ void BTM_PINCodeReply(const RawAddress& bd_addr, tBTM_STATUS res,
 ******************************************************************************/
tBTM_STATUS btm_sec_bond_by_transport(const RawAddress& bd_addr,
                                      tBLE_ADDR_TYPE addr_type,
                                      tBT_TRANSPORT transport, uint8_t pin_len,
                                      uint8_t* p_pin);
                                      tBT_TRANSPORT transport);

/*******************************************************************************
 *
@@ -221,14 +220,11 @@ tBTM_STATUS btm_sec_bond_by_transport(const RawAddress& bd_addr,
 *
 * Parameters:      bd_addr      - Address of the device to bond
 *                  transport    - doing SSP over BR/EDR or SMP over LE
 *                  pin_len      - length in bytes of the PIN Code
 *                  p_pin        - pointer to array with the PIN Code
 *
 *  Note: After 2.1 parameters are not used and preserved here not to change API
 ******************************************************************************/
tBTM_STATUS BTM_SecBond(const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type,
                        tBT_TRANSPORT transport, tBT_DEVICE_TYPE device_type,
                        uint8_t pin_len, uint8_t* p_pin);
                        tBT_TRANSPORT transport, tBT_DEVICE_TYPE device_type);

/*******************************************************************************
 *
+1 −2
Original line number Diff line number Diff line
@@ -252,8 +252,7 @@ struct tBTM_SEC_DEV_REC {
                                            uint8_t key_type);
  friend tBTM_STATUS btm_sec_bond_by_transport(const RawAddress& bd_addr,
                                               tBLE_ADDR_TYPE addr_type,
                                               tBT_TRANSPORT transport,
                                               uint8_t pin_len, uint8_t* p_pin);
                                               tBT_TRANSPORT transport);
  uint8_t pin_code_length; /* Length of the pin_code used for paring */

 public:
+1 −2
Original line number Diff line number Diff line
@@ -104,8 +104,7 @@ typedef struct {
  const char* (*BTM_SecReadDevName)(const RawAddress& bd_addr);
  tBTM_STATUS (*BTM_SecBond)(const RawAddress& bd_addr,
                             tBLE_ADDR_TYPE addr_type, tBT_TRANSPORT transport,
                             tBT_DEVICE_TYPE device_type, uint8_t pin_len,
                             uint8_t* p_pin);
                             tBT_DEVICE_TYPE device_type);
  tBTM_STATUS (*BTM_SecBondCancel)(const RawAddress& bd_addr);
  void (*BTM_SecAddBleKey)(const RawAddress& bd_addr,
                           tBTM_LE_KEY_VALUE* p_le_key,
Loading