diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2024-07-29 04:59:21 -0700 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2024-07-29 04:59:21 -0700 |
commit | 9b47cb505a57a38aab0e73088cda3fe725998bbf (patch) | |
tree | 4a769bdab128830d29bd3407921bad394d762cff | |
parent | 5e29ec1881e1a012fa8c7a9dcec84d19575d35ae (diff) | |
parent | b24649139d7270e071b3868eda06d71f873ac5a1 (diff) |
Merge b24649139d7270e071b3868eda06d71f873ac5a1 on remote branch
Change-Id: I752eb58f88bece57947f8ba66a13eb507d5e7994
-rw-r--r-- | bta/dm/bta_dm_api.cc | 2 | ||||
-rw-r--r-- | bta/hh/bta_hh_le.cc | 4 | ||||
-rw-r--r-- | btif/src/btif_a2dp_source.cc | 10 | ||||
-rw-r--r-- | btif/src/btif_dm.cc | 8 | ||||
-rwxr-xr-x | stack/smp/smp_act.cc | 12 | ||||
-rw-r--r-- | stack/smp/smp_int.h | 1 |
6 files changed, 31 insertions, 6 deletions
diff --git a/bta/dm/bta_dm_api.cc b/bta/dm/bta_dm_api.cc index ff102e15b..67330644d 100644 --- a/bta/dm/bta_dm_api.cc +++ b/bta/dm/bta_dm_api.cc @@ -1417,7 +1417,7 @@ void BTA_DmProcessQueuedServiceDiscovery(void) { if (p_data->discover.transport != BT_TRANSPORT_INVALID) { transport = p_data->discover.transport; } - if (BTM_IsAclConnectionUp(bda, transport)) { + if ((transport == BT_TRANSPORT_BR_EDR) || BTM_IsAclConnectionUp(bda, transport)) { bta_sys_sendmsg(p_data); break; } diff --git a/bta/hh/bta_hh_le.cc b/bta/hh/bta_hh_le.cc index e8978ee8a..6982cd80b 100644 --- a/bta/hh/bta_hh_le.cc +++ b/bta/hh/bta_hh_le.cc @@ -254,9 +254,7 @@ void bta_hh_le_deregister(void) { BTA_GATTC_AppDeregister(bta_hh_cb.gatt_if); } * ******************************************************************************/ bool bta_hh_is_le_device(tBTA_HH_DEV_CB* p_cb, const RawAddress& remote_bda) { - p_cb->is_le_device = BTM_UseLeLink(remote_bda); - - return p_cb->is_le_device; + return BTM_UseLeLink(remote_bda); } /****************************************************************************** diff --git a/btif/src/btif_a2dp_source.cc b/btif/src/btif_a2dp_source.cc index 837d0fbb2..df89c6295 100644 --- a/btif/src/btif_a2dp_source.cc +++ b/btif/src/btif_a2dp_source.cc @@ -183,7 +183,7 @@ extern bool btif_av_is_tws_suspend_triggered(int index); extern bool btif_acm_check_in_call_tracker_timer_exist(); extern void stop_stream_acm_initiator_now(); - +extern bool btif_av_check_is_reconfig_pending_flag_set(RawAddress address); extern bool bt_split_a2dp_sink_enabled; extern thread_t* get_sink_worker_thread(); @@ -1780,13 +1780,19 @@ void btif_a2dp_update_sink_latency_change() { APPL_TRACE_EVENT("%s latency/delay value %d", __func__, sink_latency); #if AHIM_ENABLED btif_ahim_set_remote_delay(sink_latency, A2DP); + if (!btif_av_check_is_reconfig_pending_flag_set(btif_av_get_addr_by_index(idx))){ + btif_ahim_setup_codec(A2DP); + }else{ + APPL_TRACE_EVENT("%s reconfig is pending", __func__); + } + + #else bluetooth::audio::a2dp::set_remote_delay(sink_latency); #endif } else { btif_a2dp_audio_send_sink_latency(); } - btif_ahim_setup_codec(A2DP); } void btif_a2dp_source_command_ack(tA2DP_CTRL_CMD cmd, tA2DP_CTRL_ACK status) { diff --git a/btif/src/btif_dm.cc b/btif/src/btif_dm.cc index 991d1c1e5..9eaf52471 100644 --- a/btif/src/btif_dm.cc +++ b/btif/src/btif_dm.cc @@ -442,6 +442,7 @@ static void btif_dm_sdp_delay_timer_cback(void* data) { BTIF_TRACE_DEBUG("%s: initiating SDP after delay ", __func__); // Ensure inquiry is stopped before attempting service discovery + if (btif_dm_inquiry_in_progress == true) btif_dm_cancel_discovery(); /* Trigger SDP on the device */ @@ -997,6 +998,7 @@ static void btif_dm_cb_create_bond(const RawAddress& bd_addr, bta_adv_audio_update_bond_db(bd_addr, transport); BTIF_TRACE_DEBUG("%s make sure inquiry was stopped before create LEA bond", __func__); + if (btif_dm_inquiry_in_progress == true) btif_dm_cancel_discovery(); pairing_cb.is_adv_audio = 1; pairing_cb.lea_bd_addr = bd_addr; @@ -1483,6 +1485,7 @@ static void btif_dm_auth_cmpl_evt(tBTA_DM_AUTH_CMPL* p_auth_cmpl) { if (!is_crosskey || !(stack_config_get_interface()->get_pts_crosskey_sdp_disable())) { // Ensure inquiry is stopped before attempting service discovery + if (btif_dm_inquiry_in_progress == true) btif_dm_cancel_discovery(); /* Trigger SDP on the device */ @@ -1843,6 +1846,8 @@ static void btif_dm_search_devices_evt(uint16_t event, char* p_param) { case BTA_DM_DISC_CMPL_EVT: { HAL_CBACK(bt_hal_cbacks, discovery_state_changed_cb, BT_DISCOVERY_STOPPED); + + btif_dm_inquiry_in_progress = false; } break; case BTA_DM_SEARCH_CANCEL_CMPL_EVT: { /* if inquiry is not in progress and we get a cancel event, then @@ -2099,6 +2104,7 @@ static void btif_dm_search_services_evt(uint16_t event, char* p_param) { BTIF_TRACE_DEBUG("%s: discovery is stopped", __func__); HAL_CBACK(bt_hal_cbacks, discovery_state_changed_cb, BT_DISCOVERY_STOPPED); + btif_dm_inquiry_in_progress = false; break; case BTA_DM_DISC_BLE_RES_EVT: { @@ -2346,6 +2352,7 @@ static void btif_dm_upstreams_evt(uint16_t event, char* p_param) { btif_dm_SDP_interrupt_transport == p_data->link_up.link_type) { /* Trigger SDP*/ BTIF_TRACE_DEBUG("SDP for %s was interrupted previously, continue SDP", bd_addr.ToString().c_str()); + if (btif_dm_inquiry_in_progress == true) btif_dm_cancel_discovery(); pairing_cb.bd_addr = bd_addr; @@ -2795,6 +2802,7 @@ static void btif_dm_generic_evt(uint16_t event, char* p_param) { case BTIF_DM_CB_DISCOVERY_STARTED: { HAL_CBACK(bt_hal_cbacks, discovery_state_changed_cb, BT_DISCOVERY_STARTED); + btif_dm_inquiry_in_progress = true; } break; case BTIF_DM_CB_CREATE_BOND: { diff --git a/stack/smp/smp_act.cc b/stack/smp/smp_act.cc index 34c052a52..3e4ffb193 100755 --- a/stack/smp/smp_act.cc +++ b/stack/smp/smp_act.cc @@ -307,6 +307,7 @@ void smp_send_pair_rsp(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { void smp_send_confirm(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { SMP_TRACE_DEBUG("%s", __func__); smp_send_cmd(SMP_OPCODE_CONFIRM, p_cb); + p_cb->flags |= SMP_PAIR_FLAGS_CMD_CONFIRM_SENT; } /******************************************************************************* @@ -668,6 +669,17 @@ void smp_proc_init(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { return; } + if (!((p_cb->loc_auth_req & SMP_SC_SUPPORT_BIT) && + (p_cb->peer_auth_req & SMP_SC_SUPPORT_BIT)) && + !(p_cb->flags & SMP_PAIR_FLAGS_CMD_CONFIRM_SENT)) { + // in legacy pairing, the peer should send its rand after + // we send our confirm + tSMP_INT_DATA smp_int_data{}; + smp_int_data.status = SMP_INVALID_PARAMETERS; + smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &smp_int_data); + return; + } + /* save the SRand for comparison */ STREAM_TO_ARRAY(p_cb->rrand.data(), p, OCTET16_LEN); } diff --git a/stack/smp/smp_int.h b/stack/smp/smp_int.h index f63ccd0cd..2696c164f 100644 --- a/stack/smp/smp_int.h +++ b/stack/smp/smp_int.h @@ -248,6 +248,7 @@ enum { (1 << 7) /* used to resolve race condition */ #define SMP_PAIR_FLAG_HAVE_LOCAL_PUBL_KEY \ (1 << 8) /* used on slave to resolve race condition */ +#define SMP_PAIR_FLAGS_CMD_CONFIRM_SENT (1 << 9) /* check if authentication requirement need MITM protection */ #define SMP_NO_MITM_REQUIRED(x) (((x)&SMP_AUTH_YN_BIT) == 0) |