summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralk3pInjection <webmaster@raspii.tech>2023-06-02 00:30:40 +0800
committeralk3pInjection <webmaster@raspii.tech>2023-06-02 00:30:40 +0800
commitb5b7ccf6def93ede838bf60345104b688f1d5632 (patch)
tree4eb12c4c287cf0369a782d94f3732ac6417fc21d
parent810097b0cf3fbccb54027c408db59023f0bc13ed (diff)
parent913e85217c103e559d6d2c1a9528ef796744e57b (diff)
Merge tag 'LA.QSSI.13.0.r1-10200-qssi.0' into tachibanaHEADtachibana
"LA.QSSI.13.0.r1-10200-qssi.0" Change-Id: I4db0203d2218efb18f82aa939e00f946f7361b84
-rw-r--r--bta/dm/bta_dm_act.cc3
-rw-r--r--btif/src/btif_ahim.cc5
-rw-r--r--btif/src/btif_dm.cc1
-rw-r--r--stack/btm/btm_ble.cc7
-rw-r--r--stack/gatt/eatt_int.h1
-rw-r--r--stack/gatt/eatt_utils.cc29
-rw-r--r--stack/gatt/gatt_main.cc7
7 files changed, 46 insertions, 7 deletions
diff --git a/bta/dm/bta_dm_act.cc b/bta/dm/bta_dm_act.cc
index 6d7b04614..4c4546210 100644
--- a/bta/dm/bta_dm_act.cc
+++ b/bta/dm/bta_dm_act.cc
@@ -2865,8 +2865,7 @@ static void bta_dm_rem_name_cback (const RawAddress& bd_addr, DEV_CLASS dc, BD_N
/* If Discovery complete callback is pending to be given to upper layer when
* cancel remote name request is called on cancelling discovery then cancel
* the discovery_cb_alarm and give discovery complete callback to upper layer */
- if (bta_dm_search_cb.disc_cmpl_cb_pending &&
- bta_dm_search_cb.state == BTA_DM_SEARCH_IDLE) {
+ if (bta_dm_search_cb.disc_cmpl_cb_pending) {
if (alarm_is_scheduled(bta_dm_search_cb.discovery_cb_alarm)) {
APPL_TRACE_DEBUG("%s: RNR completed, cancel discovery_cb_alarm", __func__);
alarm_free(bta_dm_search_cb.discovery_cb_alarm);
diff --git a/btif/src/btif_ahim.cc b/btif/src/btif_ahim.cc
index c9d0de4b2..080348bbc 100644
--- a/btif/src/btif_ahim.cc
+++ b/btif/src/btif_ahim.cc
@@ -517,8 +517,7 @@ LeAudioConfiguration fetch_offload_audio_config(int profile, int direction) {
CodecIndex codec_type = (CodecIndex) pclient_cbs[profile - 1]->get_codec_type(direction);
if (codec_type == CodecIndex::CODEC_INDEX_SOURCE_APTX_ADAPTIVE_LE ||
codec_type == CodecIndex::CODEC_INDEX_SOURCE_APTX_ADAPTIVE_R4) {
- frame_duration =
- ((pclient_cbs[profile - 1]->get_min_sup_frame_dur(direction)) / 4) * 1000;
+ frame_duration = pclient_cbs[profile - 1]->get_frame_duration(direction);
LOG(ERROR) << __func__ << ": fetch frame duration: "
<< frame_duration << ", from leaudio_configs.xml";
}
@@ -554,7 +553,7 @@ LeAudioConfiguration fetch_offload_audio_config(int profile, int direction) {
if (codec_type == CodecIndex::CODEC_INDEX_SOURCE_APTX_ADAPTIVE_LE ||
codec_type == CodecIndex::CODEC_INDEX_SOURCE_APTX_ADAPTIVE_R4) {
le_vendor_config.codecSpecificData[5] = 0x11; // Aptx Adaptive Type
- le_vendor_config.codecSpecificData[8] = pclient_cbs[profile - 1]->get_min_sup_frame_dur(direction);
+ le_vendor_config.codecSpecificData[8] = frame_duration;
le_vendor_config.codecSpecificData[9] = pclient_cbs[profile - 1]->get_feature_map(direction);
if (codec_type == CodecIndex::CODEC_INDEX_SOURCE_APTX_ADAPTIVE_R4) {
le_vendor_config.vendorCodecType = VendorCodecType::APTX_ADAPTIVE_R4;
diff --git a/btif/src/btif_dm.cc b/btif/src/btif_dm.cc
index 785a089e7..8864c4e4d 100644
--- a/btif/src/btif_dm.cc
+++ b/btif/src/btif_dm.cc
@@ -707,6 +707,7 @@ void bond_state_changed(bt_status_t status, const RawAddress& bd_addr,
btif_store_adv_audio_pair_info(bd_addr);
}else if(state == BT_BOND_STATE_NONE) {
bta_dm_reset_adv_audio_pairing_info(bd_addr);
+ btif_storage_remove_bonded_device(&bd_addr);
}
}
diff --git a/stack/btm/btm_ble.cc b/stack/btm/btm_ble.cc
index f2dc1adef..1c5b38dc8 100644
--- a/stack/btm/btm_ble.cc
+++ b/stack/btm/btm_ble.cc
@@ -1855,8 +1855,13 @@ void btm_ble_link_encrypted(const RawAddress& bd_addr, uint8_t encr_enable) {
gatt_notify_enc_cmpl(p_dev_rec->ble.pseudo_addr);
/* Update EATT support */
- if (encr_enable)
+ if (encr_enable) {
gatt_update_eatt_support(p_dev_rec->ble.pseudo_addr);
+ tGATT_TCB* p_tcb = gatt_find_tcb_by_addr(p_dev_rec->ble.pseudo_addr, BT_TRANSPORT_LE);
+ if (p_tcb && p_tcb->is_eatt_supported && !p_tcb->apps_needing_eatt.empty()) {
+ gatt_establish_eatt_connect(p_tcb, 1);
+ }
+ }
}
/*******************************************************************************
diff --git a/stack/gatt/eatt_int.h b/stack/gatt/eatt_int.h
index 593cbb9a9..99cf78384 100644
--- a/stack/gatt/eatt_int.h
+++ b/stack/gatt/eatt_int.h
@@ -79,5 +79,6 @@ extern void eatt_disc_rsp_enq(tGATT_TCB* p_tcb, uint16_t cid, BT_HDR *p_msg);
extern bool eatt_congest_notify_apps(tGATT_TCB* p_tcb, uint16_t cid, bool congested);
extern tGATT_EBCB* gatt_find_eatt_bcb_using_all_cids(uint16_t lcid);
extern void gatt_send_conn_cb_after_enc_failure(tGATT_TCB* p_tcb);
+extern void gatt_move_att_ops_from_eatt_bcb(tGATT_TCB* p_tcb);
#endif
diff --git a/stack/gatt/eatt_utils.cc b/stack/gatt/eatt_utils.cc
index 4a89c0b2f..919d615e9 100644
--- a/stack/gatt/eatt_utils.cc
+++ b/stack/gatt/eatt_utils.cc
@@ -1457,3 +1457,32 @@ void gatt_send_conn_cb_after_enc_failure(tGATT_TCB* p_tcb) {
}
}
}
+
+/*******************************************************************************
+ *
+ * Function gatt_move_att_ops_from_eatt_bcb
+ *
+ * Description The function moves ATT channel ops from EATT bcb to p_tcb
+ *
+ * Returns void
+ *
+ ******************************************************************************/
+void gatt_move_att_ops_from_eatt_bcb(tGATT_TCB* p_tcb) {
+ tGATT_EBCB* p_eatt_bcb = NULL;
+
+ VLOG(1) << __func__;
+ p_eatt_bcb = gatt_find_eatt_bcb_by_cid(p_tcb, L2CAP_ATT_CID);
+ if (!p_eatt_bcb) {
+ VLOG(1) << __func__ << " p_eatt_bcb not available for ATT CID: ";
+ return;
+ }
+
+ p_tcb->payload_size = p_eatt_bcb->payload_size;
+ p_tcb->ind_ack_timer = p_eatt_bcb->ind_ack_timer;
+ p_tcb->conf_timer = p_eatt_bcb->conf_timer;
+ p_tcb->cl_cmd_q = p_eatt_bcb->cl_cmd_q;
+ p_tcb->pending_ind_q = p_eatt_bcb->pending_ind_q;
+ p_tcb->indicate_handle = p_eatt_bcb->indicate_handle;
+ p_tcb->sr_cmd = p_eatt_bcb->sr_cmd;
+ p_tcb->sr_cmd.multi_rsp_q = p_eatt_bcb->sr_cmd.multi_rsp_q;
+}
diff --git a/stack/gatt/gatt_main.cc b/stack/gatt/gatt_main.cc
index 71880b787..0486f9404 100644
--- a/stack/gatt/gatt_main.cc
+++ b/stack/gatt/gatt_main.cc
@@ -1369,6 +1369,8 @@ static void gatt_l2cif_eatt_connect_cfm_cback(RawAddress &p_bd_addr,
gatt_eatt_bcb_in_progress_dealloc(p_bd_addr);
p_tcb->apps_needing_eatt.clear();
p_tcb->is_eatt_supported = false;
+ gatt_move_att_ops_from_eatt_bcb(p_tcb);
+ gatt_eatt_bcb_dealloc(p_tcb, L2CAP_ATT_CID);
gatt_send_conn_cb_after_enc_failure(p_tcb);
return;
@@ -1401,6 +1403,8 @@ static void gatt_l2cif_eatt_connect_cfm_cback(RawAddress &p_bd_addr,
if (gatt_num_eatt_bcbs(p_tcb) == 0) {
VLOG(1) << " First EATT conn attempt rejected, set eatt as not supported";
p_tcb->is_eatt_supported = false;
+ gatt_move_att_ops_from_eatt_bcb(p_tcb);
+ gatt_eatt_bcb_dealloc(p_tcb, L2CAP_ATT_CID);
}
}
@@ -1714,7 +1718,8 @@ void gatt_data_process(tGATT_TCB& tcb, uint16_t lcid, BT_HDR* p_buf) {
STREAM_TO_UINT8(op_code, p);
LOG(INFO) << __func__ << " op_code = " << +op_code
- << ", msg_len = " << +msg_len;
+ << ", msg_len = " << +msg_len
+ << ", lcid = " << +lcid;
/* remove the two MSBs associated with sign write and write cmd */
pseudo_op_code = op_code & (~GATT_WRITE_CMD_MASK);