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

Commit b33193c0 authored by Zach Johnson's avatar Zach Johnson
Browse files

Flatten btif_dm_cb_remove_bond

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I3f856ee7ea338a3f405aa0af92cc75ad441fde6c
parent 86c6259a
Loading
Loading
Loading
Loading
+11 −25
Original line number Diff line number Diff line
@@ -738,30 +738,6 @@ static void btif_dm_cb_create_bond(const RawAddress bd_addr,
  pairing_cb.is_local_initiated = true;
}

/*******************************************************************************
 *
 * Function         btif_dm_cb_remove_bond
 *
 * Description      remove bond initiated from the BTIF thread context
 *                  Special handling for HID devices
 *
 * Returns          void
 *
 ******************************************************************************/
void btif_dm_cb_remove_bond(const RawAddress bd_addr) {
/*special handling for HID devices */
/*  VUP needs to be sent if its a HID Device. The HID HOST module will check if
there
is a valid hid connection with this bd_addr. If yes VUP will be issued.*/
#if (BTA_HH_INCLUDED == TRUE)
  if (btif_hh_virtual_unplug(&bd_addr) != BT_STATUS_SUCCESS)
#endif
  {
    BTIF_TRACE_DEBUG("%s: Removing HH device", __func__);
    BTA_DmRemoveDevice(bd_addr);
  }
}

/*******************************************************************************
 *
 * Function         btif_dm_get_connection_state
@@ -2259,7 +2235,17 @@ void btif_dm_remove_bond(const RawAddress bd_addr) {
  btif_stats_add_bond_event(bd_addr, BTIF_DM_FUNC_REMOVE_BOND,
                            pairing_cb.state);

  btif_dm_cb_remove_bond(bd_addr);
  // special handling for HID devices
  // VUP needs to be sent if its a HID Device. The HID HOST module will check if
  // there is a valid hid connection with this bd_addr. If yes VUP will be
  // issued.
#if (BTA_HH_INCLUDED == TRUE)
  if (btif_hh_virtual_unplug(&bd_addr) != BT_STATUS_SUCCESS)
#endif
  {
    BTIF_TRACE_DEBUG("%s: Removing HH device", __func__);
    BTA_DmRemoveDevice(bd_addr);
  }
}

/*******************************************************************************
+0 −1
Original line number Diff line number Diff line
@@ -135,7 +135,6 @@ extern void bta_hh_co_send_hid_info(btif_hh_device_t* p_dev,
                                    uint8_t ctry_code, int dscp_len,
                                    uint8_t* p_dscp);
extern bool check_cod(const RawAddress* remote_bdaddr, uint32_t cod);
extern void btif_dm_cb_remove_bond(const RawAddress* bd_addr);
extern bool check_cod_hid(const RawAddress* remote_bdaddr);
extern int scru_ascii_2_hex(char* p_ascii, int len, uint8_t* p_hex);
extern void btif_dm_hh_open_failed(RawAddress* bdaddr);