Loading system/btif/src/btif_dm.cc +19 −12 Original line number Diff line number Diff line Loading @@ -215,7 +215,7 @@ static void btif_dm_ble_oob_req_evt(tBTA_DM_SP_RMT_OOB* req_oob_type); static void btif_dm_ble_sc_oob_req_evt(tBTA_DM_SP_RMT_OOB* req_oob_type); static void bte_scan_filt_param_cfg_evt(uint8_t action_type, uint8_t avbl_space, uint8_t ref_value, uint8_t status); uint8_t ref_value, uint8_t btm_status); static char* btif_get_default_local_name(); Loading Loading @@ -1213,8 +1213,11 @@ static void btif_dm_search_devices_evt(tBTA_DM_SEARCH_EVT event, } break; case BTA_DM_INQ_CMPL_EVT: { BTM_BleAdvFilterParamSetup(BTM_BLE_SCAN_COND_DELETE, 0, nullptr, base::Bind(&bte_scan_filt_param_cfg_evt, 0)); BTM_BleAdvFilterParamSetup(BTM_BLE_SCAN_COND_DELETE, static_cast<tBTM_BLE_PF_FILT_INDEX>(0), nullptr, base::Bind(&bte_scan_filt_param_cfg_evt, btm_status_value(BTM_SUCCESS))); } break; case BTA_DM_DISC_CMPL_EVT: { invoke_discovery_state_changed_cb(BT_DISCOVERY_STOPPED); Loading @@ -1233,7 +1236,8 @@ static void btif_dm_search_devices_evt(tBTA_DM_SEARCH_EVT event, btgatt_filt_param_setup_t adv_filt_param; memset(&adv_filt_param, 0, sizeof(btgatt_filt_param_setup_t)); BTM_BleAdvFilterParamSetup(BTM_BLE_SCAN_COND_DELETE, 0, nullptr, base::Bind(&bte_scan_filt_param_cfg_evt, 0)); base::Bind(&bte_scan_filt_param_cfg_evt, btm_status_value(BTM_SUCCESS))); invoke_discovery_state_changed_cb(BT_DISCOVERY_STOPPED); } } break; Loading Loading @@ -1780,12 +1784,13 @@ static void bta_energy_info_cb(tBTM_BLE_TX_TIME_MS tx_time, /* Scan filter param config event */ static void bte_scan_filt_param_cfg_evt(uint8_t ref_value, uint8_t avbl_space, uint8_t action_type, uint8_t status) { uint8_t action_type, uint8_t btm_status) { /* This event occurs on calling BTA_DmBleCfgFilterCondition internally, ** and that is why there is no HAL callback */ if (BTA_SUCCESS != status) { BTIF_TRACE_ERROR("%s, %d", __func__, status); if (btm_status != btm_status_value(BTM_SUCCESS)) { BTIF_TRACE_ERROR("%s, %d", __func__, btm_status); } else { BTIF_TRACE_DEBUG("%s", __func__); } Loading @@ -1808,8 +1813,9 @@ void btif_dm_start_discovery(void) { BTIF_TRACE_EVENT("%s", __func__); /* Cleanup anything remaining on index 0 */ BTM_BleAdvFilterParamSetup(BTM_BLE_SCAN_COND_DELETE, 0, nullptr, base::Bind(&bte_scan_filt_param_cfg_evt, 0)); BTM_BleAdvFilterParamSetup( BTM_BLE_SCAN_COND_DELETE, static_cast<tBTM_BLE_PF_FILT_INDEX>(0), nullptr, base::Bind(&bte_scan_filt_param_cfg_evt, btm_status_value(BTM_SUCCESS))); auto adv_filt_param = std::make_unique<btgatt_filt_param_setup_t>(); /* Add an allow-all filter on index 0*/ Loading @@ -1819,9 +1825,10 @@ void btif_dm_start_discovery(void) { adv_filt_param->list_logic_type = BTA_DM_BLE_PF_LIST_LOGIC_OR; adv_filt_param->rssi_low_thres = LOWEST_RSSI_VALUE; adv_filt_param->rssi_high_thres = LOWEST_RSSI_VALUE; BTM_BleAdvFilterParamSetup(BTM_BLE_SCAN_COND_ADD, 0, BTM_BleAdvFilterParamSetup( BTM_BLE_SCAN_COND_ADD, static_cast<tBTM_BLE_PF_FILT_INDEX>(0), std::move(adv_filt_param), base::Bind(&bte_scan_filt_param_cfg_evt, 0)); base::Bind(&bte_scan_filt_param_cfg_evt, btm_status_value(BTM_SUCCESS))); /* Will be enabled to true once inquiry busy level has been received */ btif_dm_inquiry_in_progress = false; Loading system/gd/hci/controller.cc +10 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,9 @@ struct Controller::impl { // SSP is managed by security layer once enabled if (!common::init_flags::gd_security_is_enabled()) { write_simple_pairing_mode(Enable::ENABLED); hci_->EnqueueCommand( WriteSecureConnectionsHostSupportBuilder::Create(Enable::ENABLED), handler->BindOnceOn(this, &Controller::impl::write_secure_connections_host_support_complete_handler)); } hci_->EnqueueCommand(ReadLocalNameBuilder::Create(), handler->BindOnceOn(this, &Controller::impl::read_local_name_complete_handler)); Loading Loading @@ -189,6 +192,13 @@ struct Controller::impl { acl_monitor_credits_callback_ = {}; } void write_secure_connections_host_support_complete_handler(CommandCompleteView view) { auto complete_view = WriteSecureConnectionsHostSupportCompleteView::Create(view); ASSERT(complete_view.IsValid()); ErrorCode status = complete_view.GetStatus(); ASSERT_LOG(status == ErrorCode::SUCCESS, "Status 0x%02hhx, %s", status, ErrorCodeText(status).c_str()); } void read_local_name_complete_handler(CommandCompleteView view) { auto complete_view = ReadLocalNameCompleteView::Create(view); ASSERT(complete_view.IsValid()); Loading system/main/shim/btm_api.cc +1 −1 Original line number Diff line number Diff line Loading @@ -548,7 +548,7 @@ tBTM_STATUS bluetooth::shim::BTM_StartInquiry(tBTM_INQ_RESULTS_CB* p_results_cb, uint8_t classic_mode = inqparms.mode & 0x0f; if (!Stack::GetInstance()->GetBtm()->StartInquiry( classic_mode, inqparms.duration, 0, [](uint16_t status, uint8_t inquiry_mode) { [](tBTM_STATUS status, uint8_t inquiry_mode) { LOG_INFO("%s Inquiry is complete status:%hd inquiry_mode:%hhd", __func__, status, inquiry_mode); btm_cb.btm_inq_vars.inqparms.mode &= ~(inquiry_mode); Loading system/main/shim/le_scanning_manager.cc +7 −4 Original line number Diff line number Diff line Loading @@ -117,7 +117,8 @@ class BleScannerInterfaceImpl : public BleScannerInterface, bluetooth::shim::GetScanning()->ScanFilterParameterSetup( apcf_action, filter_index, advertising_filter_parameter); // TODO refactor callback mechanism do_in_jni_thread(FROM_HERE, base::Bind(cb, 0, 0, 0)); do_in_jni_thread(FROM_HERE, base::Bind(cb, 0, 0, btm_status_value(BTM_SUCCESS))); } /** Configure a scan filter condition */ Loading @@ -135,7 +136,8 @@ class BleScannerInterfaceImpl : public BleScannerInterface, new_filters.push_back(command); } bluetooth::shim::GetScanning()->ScanFilterAdd(filter_index, new_filters); do_in_jni_thread(FROM_HERE, base::Bind(cb, 0, 0, 0, 0)); do_in_jni_thread(FROM_HERE, base::Bind(cb, 0, 0, 0, btm_status_value(BTM_SUCCESS))); } /** Clear all scan filter conditions for specific filter index*/ Loading @@ -150,7 +152,8 @@ class BleScannerInterfaceImpl : public BleScannerInterface, bluetooth::shim::GetScanning()->ScanFilterEnable(enable); uint8_t action = enable ? 1 : 0; do_in_jni_thread(FROM_HERE, base::Bind(cb, action, 0)); do_in_jni_thread(FROM_HERE, base::Bind(cb, action, btm_status_value(BTM_SUCCESS))); } /** Sets the LE scan interval and window in units of N*0.625 msec */ Loading system/main/test/common/mock_stack_acl.cc +0 −3 Original line number Diff line number Diff line Loading @@ -298,9 +298,6 @@ void acl_write_automatic_flush_timeout(const RawAddress& bd_addr, uint16_t flush_timeout_in_ticks) { mock_function_count_map[__func__]++; } void btm_acl_chk_peer_pkt_type_support(tACL_CONN* p, uint16_t* p_pkt_type) { mock_function_count_map[__func__]++; } void btm_acl_connected(const RawAddress& bda, uint16_t handle, tHCI_STATUS status, uint8_t enc_mode) { mock_function_count_map[__func__]++; Loading Loading
system/btif/src/btif_dm.cc +19 −12 Original line number Diff line number Diff line Loading @@ -215,7 +215,7 @@ static void btif_dm_ble_oob_req_evt(tBTA_DM_SP_RMT_OOB* req_oob_type); static void btif_dm_ble_sc_oob_req_evt(tBTA_DM_SP_RMT_OOB* req_oob_type); static void bte_scan_filt_param_cfg_evt(uint8_t action_type, uint8_t avbl_space, uint8_t ref_value, uint8_t status); uint8_t ref_value, uint8_t btm_status); static char* btif_get_default_local_name(); Loading Loading @@ -1213,8 +1213,11 @@ static void btif_dm_search_devices_evt(tBTA_DM_SEARCH_EVT event, } break; case BTA_DM_INQ_CMPL_EVT: { BTM_BleAdvFilterParamSetup(BTM_BLE_SCAN_COND_DELETE, 0, nullptr, base::Bind(&bte_scan_filt_param_cfg_evt, 0)); BTM_BleAdvFilterParamSetup(BTM_BLE_SCAN_COND_DELETE, static_cast<tBTM_BLE_PF_FILT_INDEX>(0), nullptr, base::Bind(&bte_scan_filt_param_cfg_evt, btm_status_value(BTM_SUCCESS))); } break; case BTA_DM_DISC_CMPL_EVT: { invoke_discovery_state_changed_cb(BT_DISCOVERY_STOPPED); Loading @@ -1233,7 +1236,8 @@ static void btif_dm_search_devices_evt(tBTA_DM_SEARCH_EVT event, btgatt_filt_param_setup_t adv_filt_param; memset(&adv_filt_param, 0, sizeof(btgatt_filt_param_setup_t)); BTM_BleAdvFilterParamSetup(BTM_BLE_SCAN_COND_DELETE, 0, nullptr, base::Bind(&bte_scan_filt_param_cfg_evt, 0)); base::Bind(&bte_scan_filt_param_cfg_evt, btm_status_value(BTM_SUCCESS))); invoke_discovery_state_changed_cb(BT_DISCOVERY_STOPPED); } } break; Loading Loading @@ -1780,12 +1784,13 @@ static void bta_energy_info_cb(tBTM_BLE_TX_TIME_MS tx_time, /* Scan filter param config event */ static void bte_scan_filt_param_cfg_evt(uint8_t ref_value, uint8_t avbl_space, uint8_t action_type, uint8_t status) { uint8_t action_type, uint8_t btm_status) { /* This event occurs on calling BTA_DmBleCfgFilterCondition internally, ** and that is why there is no HAL callback */ if (BTA_SUCCESS != status) { BTIF_TRACE_ERROR("%s, %d", __func__, status); if (btm_status != btm_status_value(BTM_SUCCESS)) { BTIF_TRACE_ERROR("%s, %d", __func__, btm_status); } else { BTIF_TRACE_DEBUG("%s", __func__); } Loading @@ -1808,8 +1813,9 @@ void btif_dm_start_discovery(void) { BTIF_TRACE_EVENT("%s", __func__); /* Cleanup anything remaining on index 0 */ BTM_BleAdvFilterParamSetup(BTM_BLE_SCAN_COND_DELETE, 0, nullptr, base::Bind(&bte_scan_filt_param_cfg_evt, 0)); BTM_BleAdvFilterParamSetup( BTM_BLE_SCAN_COND_DELETE, static_cast<tBTM_BLE_PF_FILT_INDEX>(0), nullptr, base::Bind(&bte_scan_filt_param_cfg_evt, btm_status_value(BTM_SUCCESS))); auto adv_filt_param = std::make_unique<btgatt_filt_param_setup_t>(); /* Add an allow-all filter on index 0*/ Loading @@ -1819,9 +1825,10 @@ void btif_dm_start_discovery(void) { adv_filt_param->list_logic_type = BTA_DM_BLE_PF_LIST_LOGIC_OR; adv_filt_param->rssi_low_thres = LOWEST_RSSI_VALUE; adv_filt_param->rssi_high_thres = LOWEST_RSSI_VALUE; BTM_BleAdvFilterParamSetup(BTM_BLE_SCAN_COND_ADD, 0, BTM_BleAdvFilterParamSetup( BTM_BLE_SCAN_COND_ADD, static_cast<tBTM_BLE_PF_FILT_INDEX>(0), std::move(adv_filt_param), base::Bind(&bte_scan_filt_param_cfg_evt, 0)); base::Bind(&bte_scan_filt_param_cfg_evt, btm_status_value(BTM_SUCCESS))); /* Will be enabled to true once inquiry busy level has been received */ btif_dm_inquiry_in_progress = false; Loading
system/gd/hci/controller.cc +10 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,9 @@ struct Controller::impl { // SSP is managed by security layer once enabled if (!common::init_flags::gd_security_is_enabled()) { write_simple_pairing_mode(Enable::ENABLED); hci_->EnqueueCommand( WriteSecureConnectionsHostSupportBuilder::Create(Enable::ENABLED), handler->BindOnceOn(this, &Controller::impl::write_secure_connections_host_support_complete_handler)); } hci_->EnqueueCommand(ReadLocalNameBuilder::Create(), handler->BindOnceOn(this, &Controller::impl::read_local_name_complete_handler)); Loading Loading @@ -189,6 +192,13 @@ struct Controller::impl { acl_monitor_credits_callback_ = {}; } void write_secure_connections_host_support_complete_handler(CommandCompleteView view) { auto complete_view = WriteSecureConnectionsHostSupportCompleteView::Create(view); ASSERT(complete_view.IsValid()); ErrorCode status = complete_view.GetStatus(); ASSERT_LOG(status == ErrorCode::SUCCESS, "Status 0x%02hhx, %s", status, ErrorCodeText(status).c_str()); } void read_local_name_complete_handler(CommandCompleteView view) { auto complete_view = ReadLocalNameCompleteView::Create(view); ASSERT(complete_view.IsValid()); Loading
system/main/shim/btm_api.cc +1 −1 Original line number Diff line number Diff line Loading @@ -548,7 +548,7 @@ tBTM_STATUS bluetooth::shim::BTM_StartInquiry(tBTM_INQ_RESULTS_CB* p_results_cb, uint8_t classic_mode = inqparms.mode & 0x0f; if (!Stack::GetInstance()->GetBtm()->StartInquiry( classic_mode, inqparms.duration, 0, [](uint16_t status, uint8_t inquiry_mode) { [](tBTM_STATUS status, uint8_t inquiry_mode) { LOG_INFO("%s Inquiry is complete status:%hd inquiry_mode:%hhd", __func__, status, inquiry_mode); btm_cb.btm_inq_vars.inqparms.mode &= ~(inquiry_mode); Loading
system/main/shim/le_scanning_manager.cc +7 −4 Original line number Diff line number Diff line Loading @@ -117,7 +117,8 @@ class BleScannerInterfaceImpl : public BleScannerInterface, bluetooth::shim::GetScanning()->ScanFilterParameterSetup( apcf_action, filter_index, advertising_filter_parameter); // TODO refactor callback mechanism do_in_jni_thread(FROM_HERE, base::Bind(cb, 0, 0, 0)); do_in_jni_thread(FROM_HERE, base::Bind(cb, 0, 0, btm_status_value(BTM_SUCCESS))); } /** Configure a scan filter condition */ Loading @@ -135,7 +136,8 @@ class BleScannerInterfaceImpl : public BleScannerInterface, new_filters.push_back(command); } bluetooth::shim::GetScanning()->ScanFilterAdd(filter_index, new_filters); do_in_jni_thread(FROM_HERE, base::Bind(cb, 0, 0, 0, 0)); do_in_jni_thread(FROM_HERE, base::Bind(cb, 0, 0, 0, btm_status_value(BTM_SUCCESS))); } /** Clear all scan filter conditions for specific filter index*/ Loading @@ -150,7 +152,8 @@ class BleScannerInterfaceImpl : public BleScannerInterface, bluetooth::shim::GetScanning()->ScanFilterEnable(enable); uint8_t action = enable ? 1 : 0; do_in_jni_thread(FROM_HERE, base::Bind(cb, action, 0)); do_in_jni_thread(FROM_HERE, base::Bind(cb, action, btm_status_value(BTM_SUCCESS))); } /** Sets the LE scan interval and window in units of N*0.625 msec */ Loading
system/main/test/common/mock_stack_acl.cc +0 −3 Original line number Diff line number Diff line Loading @@ -298,9 +298,6 @@ void acl_write_automatic_flush_timeout(const RawAddress& bd_addr, uint16_t flush_timeout_in_ticks) { mock_function_count_map[__func__]++; } void btm_acl_chk_peer_pkt_type_support(tACL_CONN* p, uint16_t* p_pkt_type) { mock_function_count_map[__func__]++; } void btm_acl_connected(const RawAddress& bda, uint16_t handle, tHCI_STATUS status, uint8_t enc_mode) { mock_function_count_map[__func__]++; Loading