case BTA_HD_VC_UNPLUG_EVT:
HAL_CBACK(bt_hd_callbacks, connection_state_cb,
(RawAddress*)&p_data->conn.bda, BTHD_CONN_STATE_DISCONNECTED);
- if (bta_dm_check_if_only_hd_connected(p_data->conn.bda)) {
- BTIF_TRACE_DEBUG("%s: Removing bonding as only HID profile connected",
- __func__);
- BTA_DmRemoveDevice(p_data->conn.bda);
- } else {
- RawAddress* bd_addr = (RawAddress*)&p_data->conn.bda;
- BTIF_TRACE_DEBUG(
- "%s: Only removing HID data as some other profiles "
- "connected",
- __func__);
- btif_hd_remove_device(*bd_addr);
- }
+ LOG(INFO) << __func__ << ": Only removing HID data";
+ btif_hd_remove_device(p_data->conn.bda);
HAL_CBACK(bt_hd_callbacks, vc_unplug_cb);
break;
BTIF_TRACE_DEBUG("%s: uhid fd=%d local_vup=%d", __func__, p_dev->fd,
p_dev->local_vup);
btif_hh_stop_vup_timer(&(p_dev->bd_addr));
- /* If this is a locally initiated VUP, remove the bond as ACL got
- * disconnected while VUP being processed.
- */
- if (p_dev->local_vup) {
- p_dev->local_vup = false;
- BTA_DmRemoveDevice(p_dev->bd_addr);
- }
btif_hh_cb.status = (BTIF_HH_STATUS)BTIF_HH_DEV_DISCONNECTED;
p_dev->dev_status = BTHH_CONN_STATE_DISCONNECTED;
HAL_CBACK(bt_hh_callbacks, connection_state_cb, &(p_dev->bd_addr),
p_dev->dev_status);
BTIF_TRACE_DEBUG("%s---Removing HID bond", __func__);
- /* If it is locally initiated VUP or remote device has its major COD as
- Peripheral removed the bond.*/
- if (p_dev->local_vup || check_cod_hid(&(p_dev->bd_addr))) {
- p_dev->local_vup = false;
- BTA_DmRemoveDevice(p_dev->bd_addr);
- } else
- btif_hh_remove_device(p_dev->bd_addr);
+ btif_hh_remove_device(p_dev->bd_addr);
HAL_CBACK(bt_hh_callbacks, virtual_unplug_cb, &(p_dev->bd_addr),
(bthh_status_t)p_data->dev_status.status);
}