Commit 23453997 authored by Zhihai Xu's avatar Zhihai Xu Committed by Android Git Automerger
Browse files

am 4c938b5d: am af16d116: am 91f01220: DO NOT MERGE trouble syncing with...

am 4c938b5d: am af16d116: am 91f01220: DO NOT MERGE trouble syncing with fitbit and can\'t turn off bluetooth.

* commit '4c938b5d':
  DO NOT MERGE trouble syncing with fitbit and can't turn off bluetooth.
parents 35ed9e1d 4c938b5d
......@@ -1563,7 +1563,28 @@ void btm_ble_conn_complete(UINT8 *p, UINT16 evt_len)
role = HCI_ROLE_UNKNOWN;
if (status == HCI_ERR_DIRECTED_ADVERTISING_TIMEOUT)
{
btm_ble_dir_adv_tout();
}
/* this is to work around broadcom firmware problem to handle
* unsolicited command complete event for HCI_LE_Create_Connection_Cancel
* and LE connection complete event with status error code (0x2)
* unknown connection identifier from bluetooth controller
* the workaround is to release the HCI connection to avoid out of sync
* with bluetooth controller, which cause BT can't be turned off.
*/
else if ((status == HCI_ERR_NO_CONNECTION) &&
(btm_ble_get_conn_st() != BLE_CONN_CANCEL))
{
tL2C_LCB *p_lcb;
handle = HCID_GET_HANDLE (handle);
p_lcb = l2cu_find_lcb_by_handle (handle);
if (p_lcb != NULL)
{
l2c_link_hci_disc_comp (handle, HCI_ERR_PEER_USER);
btm_sec_disconnected (handle, HCI_ERR_PEER_USER);
}
}
}
btm_ble_set_conn_st(BLE_CONN_IDLE);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment