Loading system/bta/dm/bta_dm_act.cc +2 −0 Original line number Diff line number Diff line Loading @@ -2436,6 +2436,7 @@ void bta_dm_acl_up(const RawAddress& bd_addr, tBT_TRANSPORT transport) { tBTA_DM_SEC conn; memset(&conn, 0, sizeof(tBTA_DM_SEC)); conn.link_up.bd_addr = bd_addr; conn.link_up.transport_link_type = transport; bta_dm_cb.p_sec_cback(BTA_DM_LINK_UP_EVT, &conn); LOG_DEBUG("Executed security callback for new connection available"); Loading Loading @@ -2522,6 +2523,7 @@ static void bta_dm_acl_down(const RawAddress& bd_addr, tBTA_DM_SEC conn; memset(&conn, 0, sizeof(tBTA_DM_SEC)); conn.link_down.bd_addr = bd_addr; conn.link_down.transport_link_type = transport; bta_dm_cb.p_sec_cback(BTA_DM_LINK_DOWN_EVT, &conn); if (issue_unpair_cb) bta_dm_cb.p_sec_cback(BTA_DM_DEV_UNPAIRED_EVT, &conn); Loading system/bta/include/bta_api.h +2 −0 Original line number Diff line number Diff line Loading @@ -303,11 +303,13 @@ typedef struct { /* Structure associated with BTA_DM_LINK_UP_EVT */ typedef struct { RawAddress bd_addr; /* BD address peer device. */ tBT_TRANSPORT transport_link_type; } tBTA_DM_LINK_UP; /* Structure associated with BTA_DM_LINK_DOWN_EVT */ typedef struct { RawAddress bd_addr; /* BD address peer device. */ tBT_TRANSPORT transport_link_type; } tBTA_DM_LINK_DOWN; #define BTA_AUTH_SP_YES \ Loading system/btif/include/btif_common.h +3 −2 Original line number Diff line number Diff line Loading @@ -214,9 +214,10 @@ void invoke_oob_data_request_cb(tBT_TRANSPORT t, bool valid, Octet16 c, Octet16 r, RawAddress raw_address, uint8_t address_type); void invoke_bond_state_changed_cb(bt_status_t status, RawAddress bd_addr, bt_bond_state_t state); bt_bond_state_t state, int fail_reason); void invoke_acl_state_changed_cb(bt_status_t status, RawAddress bd_addr, bt_acl_state_t state, bt_hci_error_code_t hci_reason); bt_acl_state_t state, int transport_link_type, bt_hci_error_code_t hci_reason); void invoke_thread_evt_cb(bt_cb_thread_evt event); void invoke_le_test_mode_cb(bt_status_t status, uint16_t count); void invoke_energy_info_cb(bt_activity_energy_info energy_info, Loading system/btif/src/bluetooth.cc +14 −13 Original line number Diff line number Diff line Loading @@ -784,28 +784,29 @@ void invoke_oob_data_request_cb(tBT_TRANSPORT t, bool valid, Octet16 c, } void invoke_bond_state_changed_cb(bt_status_t status, RawAddress bd_addr, bt_bond_state_t state) { do_in_jni_thread( FROM_HERE, base::BindOnce( [](bt_status_t status, RawAddress bd_addr, bt_bond_state_t state) { HAL_CBACK(bt_hal_cbacks, bond_state_changed_cb, status, &bd_addr, state); bt_bond_state_t state, int fail_reason) { do_in_jni_thread(FROM_HERE, base::BindOnce( [](bt_status_t status, RawAddress bd_addr, bt_bond_state_t state, int fail_reason) { HAL_CBACK(bt_hal_cbacks, bond_state_changed_cb, status, &bd_addr, state, fail_reason); }, status, bd_addr, state)); status, bd_addr, state, fail_reason)); } void invoke_acl_state_changed_cb(bt_status_t status, RawAddress bd_addr, bt_acl_state_t state, bt_hci_error_code_t hci_reason) { bt_acl_state_t state, int transport_link_type, bt_hci_error_code_t hci_reason) { do_in_jni_thread( FROM_HERE, base::BindOnce( [](bt_status_t status, RawAddress bd_addr, bt_acl_state_t state, bt_hci_error_code_t hci_reason) { int transport_link_type, bt_hci_error_code_t hci_reason) { HAL_CBACK(bt_hal_cbacks, acl_state_changed_cb, status, &bd_addr, state, hci_reason); state, transport_link_type, hci_reason); }, status, bd_addr, state, hci_reason)); status, bd_addr, state, transport_link_type, hci_reason)); } void invoke_thread_evt_cb(bt_cb_thread_evt event) { Loading system/btif/src/btif_dm.cc +13 −7 Original line number Diff line number Diff line Loading @@ -129,6 +129,7 @@ typedef struct { bool is_le_only; bool is_le_nc; /* LE Numeric comparison */ btif_dm_ble_cb_t ble; uint8_t fail_reason; } btif_dm_pairing_cb_t; // TODO(jpawlowski): unify ? Loading Loading @@ -444,7 +445,8 @@ static void bond_state_changed(bt_status_t status, const RawAddress& bd_addr, if ((pairing_cb.state == state) && (state == BT_BOND_STATE_BONDING)) { // Cross key pairing so send callback for static address if (!pairing_cb.static_bdaddr.IsEmpty()) { invoke_bond_state_changed_cb(status, bd_addr, state); invoke_bond_state_changed_cb(status, bd_addr, state, pairing_cb.fail_reason); } return; } Loading @@ -467,7 +469,7 @@ static void bond_state_changed(bt_status_t status, const RawAddress& bd_addr, << bd_addr; } } invoke_bond_state_changed_cb(status, bd_addr, state); invoke_bond_state_changed_cb(status, bd_addr, state, pairing_cb.fail_reason); int dev_type; if (!btif_get_device_type(bd_addr, &dev_type)) { Loading Loading @@ -920,6 +922,8 @@ static void btif_dm_auth_cmpl_evt(tBTA_DM_AUTH_CMPL* p_auth_cmpl) { pairing_cb.state, p_auth_cmpl->success, p_auth_cmpl->key_present); pairing_cb.fail_reason = p_auth_cmpl->fail_reason; RawAddress bd_addr = p_auth_cmpl->bd_addr; if (!bluetooth::shim::is_gd_security_enabled()) { if ((p_auth_cmpl->success) && (p_auth_cmpl->key_present)) { Loading Loading @@ -1573,8 +1577,9 @@ static void btif_dm_upstreams_evt(uint16_t event, char* p_param) { btif_update_remote_version_property(&bd_addr); invoke_acl_state_changed_cb(BT_STATUS_SUCCESS, bd_addr, BT_ACL_STATE_CONNECTED, HCI_SUCCESS); invoke_acl_state_changed_cb( BT_STATUS_SUCCESS, bd_addr, BT_ACL_STATE_CONNECTED, (int)p_data->link_up.transport_link_type, HCI_SUCCESS); break; case BTA_DM_LINK_DOWN_EVT: Loading @@ -1582,8 +1587,9 @@ static void btif_dm_upstreams_evt(uint16_t event, char* p_param) { btm_set_bond_type_dev(p_data->link_down.bd_addr, tBTM_SEC_DEV_REC::BOND_TYPE_UNKNOWN); btif_av_acl_disconnected(bd_addr); invoke_acl_state_changed_cb(BT_STATUS_SUCCESS, bd_addr, BT_ACL_STATE_DISCONNECTED, invoke_acl_state_changed_cb( BT_STATUS_SUCCESS, bd_addr, BT_ACL_STATE_DISCONNECTED, (int)p_data->link_down.transport_link_type, static_cast<bt_hci_error_code_t>(btm_get_acl_disc_reason_code())); LOG_DEBUG( "Sent BT_ACL_STATE_DISCONNECTED upward as ACL link down event " Loading Loading
system/bta/dm/bta_dm_act.cc +2 −0 Original line number Diff line number Diff line Loading @@ -2436,6 +2436,7 @@ void bta_dm_acl_up(const RawAddress& bd_addr, tBT_TRANSPORT transport) { tBTA_DM_SEC conn; memset(&conn, 0, sizeof(tBTA_DM_SEC)); conn.link_up.bd_addr = bd_addr; conn.link_up.transport_link_type = transport; bta_dm_cb.p_sec_cback(BTA_DM_LINK_UP_EVT, &conn); LOG_DEBUG("Executed security callback for new connection available"); Loading Loading @@ -2522,6 +2523,7 @@ static void bta_dm_acl_down(const RawAddress& bd_addr, tBTA_DM_SEC conn; memset(&conn, 0, sizeof(tBTA_DM_SEC)); conn.link_down.bd_addr = bd_addr; conn.link_down.transport_link_type = transport; bta_dm_cb.p_sec_cback(BTA_DM_LINK_DOWN_EVT, &conn); if (issue_unpair_cb) bta_dm_cb.p_sec_cback(BTA_DM_DEV_UNPAIRED_EVT, &conn); Loading
system/bta/include/bta_api.h +2 −0 Original line number Diff line number Diff line Loading @@ -303,11 +303,13 @@ typedef struct { /* Structure associated with BTA_DM_LINK_UP_EVT */ typedef struct { RawAddress bd_addr; /* BD address peer device. */ tBT_TRANSPORT transport_link_type; } tBTA_DM_LINK_UP; /* Structure associated with BTA_DM_LINK_DOWN_EVT */ typedef struct { RawAddress bd_addr; /* BD address peer device. */ tBT_TRANSPORT transport_link_type; } tBTA_DM_LINK_DOWN; #define BTA_AUTH_SP_YES \ Loading
system/btif/include/btif_common.h +3 −2 Original line number Diff line number Diff line Loading @@ -214,9 +214,10 @@ void invoke_oob_data_request_cb(tBT_TRANSPORT t, bool valid, Octet16 c, Octet16 r, RawAddress raw_address, uint8_t address_type); void invoke_bond_state_changed_cb(bt_status_t status, RawAddress bd_addr, bt_bond_state_t state); bt_bond_state_t state, int fail_reason); void invoke_acl_state_changed_cb(bt_status_t status, RawAddress bd_addr, bt_acl_state_t state, bt_hci_error_code_t hci_reason); bt_acl_state_t state, int transport_link_type, bt_hci_error_code_t hci_reason); void invoke_thread_evt_cb(bt_cb_thread_evt event); void invoke_le_test_mode_cb(bt_status_t status, uint16_t count); void invoke_energy_info_cb(bt_activity_energy_info energy_info, Loading
system/btif/src/bluetooth.cc +14 −13 Original line number Diff line number Diff line Loading @@ -784,28 +784,29 @@ void invoke_oob_data_request_cb(tBT_TRANSPORT t, bool valid, Octet16 c, } void invoke_bond_state_changed_cb(bt_status_t status, RawAddress bd_addr, bt_bond_state_t state) { do_in_jni_thread( FROM_HERE, base::BindOnce( [](bt_status_t status, RawAddress bd_addr, bt_bond_state_t state) { HAL_CBACK(bt_hal_cbacks, bond_state_changed_cb, status, &bd_addr, state); bt_bond_state_t state, int fail_reason) { do_in_jni_thread(FROM_HERE, base::BindOnce( [](bt_status_t status, RawAddress bd_addr, bt_bond_state_t state, int fail_reason) { HAL_CBACK(bt_hal_cbacks, bond_state_changed_cb, status, &bd_addr, state, fail_reason); }, status, bd_addr, state)); status, bd_addr, state, fail_reason)); } void invoke_acl_state_changed_cb(bt_status_t status, RawAddress bd_addr, bt_acl_state_t state, bt_hci_error_code_t hci_reason) { bt_acl_state_t state, int transport_link_type, bt_hci_error_code_t hci_reason) { do_in_jni_thread( FROM_HERE, base::BindOnce( [](bt_status_t status, RawAddress bd_addr, bt_acl_state_t state, bt_hci_error_code_t hci_reason) { int transport_link_type, bt_hci_error_code_t hci_reason) { HAL_CBACK(bt_hal_cbacks, acl_state_changed_cb, status, &bd_addr, state, hci_reason); state, transport_link_type, hci_reason); }, status, bd_addr, state, hci_reason)); status, bd_addr, state, transport_link_type, hci_reason)); } void invoke_thread_evt_cb(bt_cb_thread_evt event) { Loading
system/btif/src/btif_dm.cc +13 −7 Original line number Diff line number Diff line Loading @@ -129,6 +129,7 @@ typedef struct { bool is_le_only; bool is_le_nc; /* LE Numeric comparison */ btif_dm_ble_cb_t ble; uint8_t fail_reason; } btif_dm_pairing_cb_t; // TODO(jpawlowski): unify ? Loading Loading @@ -444,7 +445,8 @@ static void bond_state_changed(bt_status_t status, const RawAddress& bd_addr, if ((pairing_cb.state == state) && (state == BT_BOND_STATE_BONDING)) { // Cross key pairing so send callback for static address if (!pairing_cb.static_bdaddr.IsEmpty()) { invoke_bond_state_changed_cb(status, bd_addr, state); invoke_bond_state_changed_cb(status, bd_addr, state, pairing_cb.fail_reason); } return; } Loading @@ -467,7 +469,7 @@ static void bond_state_changed(bt_status_t status, const RawAddress& bd_addr, << bd_addr; } } invoke_bond_state_changed_cb(status, bd_addr, state); invoke_bond_state_changed_cb(status, bd_addr, state, pairing_cb.fail_reason); int dev_type; if (!btif_get_device_type(bd_addr, &dev_type)) { Loading Loading @@ -920,6 +922,8 @@ static void btif_dm_auth_cmpl_evt(tBTA_DM_AUTH_CMPL* p_auth_cmpl) { pairing_cb.state, p_auth_cmpl->success, p_auth_cmpl->key_present); pairing_cb.fail_reason = p_auth_cmpl->fail_reason; RawAddress bd_addr = p_auth_cmpl->bd_addr; if (!bluetooth::shim::is_gd_security_enabled()) { if ((p_auth_cmpl->success) && (p_auth_cmpl->key_present)) { Loading Loading @@ -1573,8 +1577,9 @@ static void btif_dm_upstreams_evt(uint16_t event, char* p_param) { btif_update_remote_version_property(&bd_addr); invoke_acl_state_changed_cb(BT_STATUS_SUCCESS, bd_addr, BT_ACL_STATE_CONNECTED, HCI_SUCCESS); invoke_acl_state_changed_cb( BT_STATUS_SUCCESS, bd_addr, BT_ACL_STATE_CONNECTED, (int)p_data->link_up.transport_link_type, HCI_SUCCESS); break; case BTA_DM_LINK_DOWN_EVT: Loading @@ -1582,8 +1587,9 @@ static void btif_dm_upstreams_evt(uint16_t event, char* p_param) { btm_set_bond_type_dev(p_data->link_down.bd_addr, tBTM_SEC_DEV_REC::BOND_TYPE_UNKNOWN); btif_av_acl_disconnected(bd_addr); invoke_acl_state_changed_cb(BT_STATUS_SUCCESS, bd_addr, BT_ACL_STATE_DISCONNECTED, invoke_acl_state_changed_cb( BT_STATUS_SUCCESS, bd_addr, BT_ACL_STATE_DISCONNECTED, (int)p_data->link_down.transport_link_type, static_cast<bt_hci_error_code_t>(btm_get_acl_disc_reason_code())); LOG_DEBUG( "Sent BT_ACL_STATE_DISCONNECTED upward as ACL link down event " Loading