Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 12e702e2 authored by Hansong Zhang's avatar Hansong Zhang
Browse files

L2CA_RegisterLECoc fix

We should register security record when we are server, so the condition
should be the same as "vpsm == psm", as in line 412 below.  So we should
use "pL2CA_ConnectInd_Cb != nullptr" (server has to have an incoming
connection handler), OR "psm < LE_DYNAMIC_PSM_START" (Fixed PSM service,
as it's treated like this for vpsm).

Tag: #stability
Bug: 193142224
Test: CtsVerifier LE COC client and server
Change-Id: I627e4dcd0aca4c113966952b53fad2be0f9d7104
parent 33c4ed7f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -382,7 +382,7 @@ uint16_t L2CA_RegisterLECoc(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info,
    return bluetooth::shim::L2CA_RegisterLECoc(psm, p_cb_info, sec_level, cfg);
  }

  if (p_cb_info.pL2CA_ConnectInd_Cb != nullptr && psm < LE_DYNAMIC_PSM_START) {
  if (p_cb_info.pL2CA_ConnectInd_Cb != nullptr || psm < LE_DYNAMIC_PSM_START) {
    //  If we register LE COC for outgoing connection only, don't register with
    //  BTM_Sec, because it's handled by L2CA_ConnectLECocReq.
    BTM_SetSecurityLevel(false, "", 0, sec_level, psm, 0, 0);