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

Commit ef6c70e4 authored by Chris Manton's avatar Chris Manton
Browse files

acl_disconnect_after_role_switch:Check for valid acl

Bug: 173763477
Test: gd/cert/run --host
Tag: #refactor

Change-Id: I738f2a13e3378bc924315eff9ef9ffb95be20af7
parent 43758b5c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2703,6 +2703,10 @@ void acl_disconnect(const RawAddress& bd_addr, tBT_TRANSPORT transport,

void acl_disconnect_after_role_switch(uint16_t conn_handle, uint16_t reason) {
  tACL_CONN* p_acl = internal_.acl_get_connection_from_handle(conn_handle);
  if (p_acl == nullptr) {
    LOG_WARN("Unable to find active acl");
    return;
  }

  /* If a role switch is in progress, delay the HCI Disconnect to avoid
   * controller problem */