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

Commit 320bcc1e authored by Hansong Zhang's avatar Hansong Zhang
Browse files

GD L2cap shim workaround

* Fix a workflow in classic security enforcement
* Use the ACL workaround for address policy

Tag: #gd-refactor
Bug: 141555841
Test: cert/run --host
Test: Pair and connect with a headset
Change-Id: I31e439ae40f0db98aeed10ec6872a1f25c4f94d0
parent dd916bdc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -120,7 +120,7 @@ void ClassicSignallingManager::on_security_result_for_outgoing(
      dynamic_service_manager_->GetService(psm)->GetSecurityPolicy() !=
          SecurityPolicy::_SDP_ONLY_NO_SECURITY_WHATSOEVER_PLAINTEXT_TRANSPORT_OK) {
    link_->Encrypt();
    return;
    // TODO(b/171253721): If we can receive ENCRYPTION_CHANGE event, we can send command after callback is received.
  }

  PendingCommand pending_command = {next_signal_id_, CommandCode::CONNECTION_REQUEST, psm, local_cid, {}, {}, {}};
+2 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include "gd/l2cap/le/l2cap_le_module.h"
#include "gd/os/log.h"
#include "gd/os/queue.h"
#include "main/shim/acl_api.h"
#include "main/shim/btm.h"
#include "main/shim/entry.h"
#include "main/shim/helpers.h"
@@ -273,6 +274,7 @@ void bluetooth::shim::L2CA_UseLegacySecurityModule() {

  bluetooth::shim::GetL2capLeModule()->InjectSecurityEnforcementInterface(
      &le_security_enforcement_shim_);
  ACL_ConfigureLePrivacy(true);
}

/**