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

Commit d673d311 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "GD: Mirror LE conneciton timeout callback" am: 43520827

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1846414

Change-Id: If19560708cbf8763d9e63c55458a63022d366046
parents f0547fff 43520827
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ class LeConnectionCallbacks {
  // Invoked when controller sends Connection Complete event with Success error code
  // AddressWithType is always equal to the object used in AclManager#CreateLeConnection
  virtual void OnLeConnectSuccess(AddressWithType, std::unique_ptr<LeAclConnection>) = 0;
  // Invoked when controller sends Connection Complete event with non-Success error code
  // Invoked when create connection timeout or controller sends Connection Complete event with non-Success error code
  virtual void OnLeConnectFail(AddressWithType, ErrorCode reason) = 0;
};

+5 −1
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@
#include "hci/acl_manager/round_robin_scheduler.h"
#include "hci/le_address_manager.h"
#include "os/alarm.h"
#include "os/rand.h"

using bluetooth::crypto_toolbox::Octet16;

@@ -549,6 +548,11 @@ struct le_impl : public bluetooth::hci::LeAddressManagerCallback {
      create_connection_timeout_alarms_.at(address_with_type).Cancel();
      create_connection_timeout_alarms_.erase(address_with_type);
      cancel_connect(address_with_type);
      le_client_handler_->Post(common::BindOnce(
          &LeConnectionCallbacks::OnLeConnectFail,
          common::Unretained(le_client_callbacks_),
          address_with_type,
          ErrorCode::CONNECTION_ACCEPT_TIMEOUT));
    }
  }

+1 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@
#include "gd/hci/acl_manager/connection_management_callbacks.h"
#include "gd/hci/acl_manager/le_acl_connection.h"
#include "gd/hci/acl_manager/le_connection_management_callbacks.h"
#include "gd/hci/acl_manager/le_impl.h"
#include "gd/hci/address.h"
#include "gd/hci/class_of_device.h"
#include "gd/hci/controller.h"
+2 −0
Original line number Diff line number Diff line
@@ -155,6 +155,8 @@ void acl_ble_connection_fail(const tBLE_BD_ADDR& address_with_type,
    btm_cb.ble_ctr_cb.set_connection_state_idle();
    btm_ble_clear_topology_mask(BTM_BLE_STATE_INIT_BIT);
    btm_ble_disable_resolving_list(BTM_BLE_RL_INIT, true);
    connection_manager::on_connection_timed_out_from_shim(
        address_with_type.bda);
  } else {
    btm_cb.ble_ctr_cb.inq_var.adv_mode = BTM_BLE_ADV_DISABLE;
    btm_ble_disable_resolving_list(BTM_BLE_RL_ADV, true);
+4 −0
Original line number Diff line number Diff line
@@ -200,6 +200,10 @@ void on_connection_complete(const RawAddress& address) {
  remove_all_clients_with_pending_connections(address);
}

void on_connection_timed_out_from_shim(const RawAddress& address) {
  on_connection_timed_out(0x00, address);
}

/** Reset bg device list. If called after controller reset, set |after_reset| to
 * true, as there is no need to wipe controller acceptlist in this case. */
void reset(bool after_reset) {
Loading