• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/bt


Commit MetaInfo

Revisão63034887a1e053a443007697fd083975a5456516 (tree)
Hora2020-02-12 10:19:23
AutorJack He <siyuanh@goog...>
Commiterandroid-build-team Robot

Mensagem de Log

L2CAP socket: Stop L2CAP server by ID instead of PSM

* There could be multiple L2CAP socket control blocks with the same PSM
* The unique identifier for a L2CAP socket control block should be the

unique ID allocated during control block initialization

* Use this ID to track L2CAP socket control block instead of PSM ensure

that we close the correct socket

* Reset GAP handle and L2CAP socket ID to 0 when calling

bta_jv_free_l2c_cb() so that disconnected L2CAP control blocks does
not count

Test: CtsVerifier
Bug: 147997447
Bug: 144148429
Change-Id: Ideb428bc73aa0b36b8deb20fac280e44c8fe7db1
(cherry picked from commit ad23e6b2f473829b1819918cd3f927d1134c83b3)
(cherry picked from commit 7c901002dcf856c0102425631da3475364ac4129)

Mudança Sumário

Diff

--- a/bta/jv/bta_jv_act.cc
+++ b/bta/jv/bta_jv_act.cc
@@ -362,6 +362,8 @@ tBTA_JV_STATUS bta_jv_free_l2c_cb(tBTA_JV_L2C_CB* p_cb) {
362362 p_cb->cong = false;
363363 bta_jv_free_sec_id(&p_cb->sec_id);
364364 p_cb->p_cback = NULL;
365+ p_cb->handle = 0;
366+ p_cb->l2cap_socket_id = 0;
365367 return status;
366368 }
367369
@@ -1121,7 +1123,7 @@ void bta_jv_l2cap_start_server(int32_t type, tBTA_SEC sec_mask,
11211123 /* stops an L2CAP server */
11221124 void bta_jv_l2cap_stop_server(uint16_t local_psm, uint32_t l2cap_socket_id) {
11231125 for (int i = 0; i < BTA_JV_MAX_L2C_CONN; i++) {
1124- if (bta_jv_cb.l2c_cb[i].psm == local_psm) {
1126+ if (bta_jv_cb.l2c_cb[i].l2cap_socket_id == l2cap_socket_id) {
11251127 tBTA_JV_L2C_CB* p_cb = &bta_jv_cb.l2c_cb[i];
11261128 tBTA_JV_L2CAP_CBACK* p_cback = p_cb->p_cback;
11271129 tBTA_JV_L2CAP_CLOSE evt_data;