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

Commit 77187b84 authored by Chris Manton's avatar Chris Manton
Browse files

le_impl: Move le_client_callbacks_ check to exit earlier

Bug: 204433265
Tag: #refactor
Test: gd/cert/run

Change-Id: I84654e036262165413320456534483015ebab7b0
parent df1d2145
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -429,6 +429,11 @@ struct le_impl : public bluetooth::hci::LeAddressManagerCallback {
  }
  }


  void create_le_connection(AddressWithType address_with_type, bool add_to_connect_list, bool is_direct) {
  void create_le_connection(AddressWithType address_with_type, bool add_to_connect_list, bool is_direct) {
    if (le_client_callbacks_ == nullptr) {
      LOG_ERROR("No callbacks to call");
      return;
    }

    // TODO: Configure default LE connection parameters?
    // TODO: Configure default LE connection parameters?
    if (add_to_connect_list) {
    if (add_to_connect_list) {
      add_device_to_connect_list(address_with_type);
      add_device_to_connect_list(address_with_type);
@@ -462,10 +467,6 @@ struct le_impl : public bluetooth::hci::LeAddressManagerCallback {
      canceled_connections_.insert(address_with_type);
      canceled_connections_.insert(address_with_type);
      return;
      return;
    }
    }
    if (le_client_callbacks_ == nullptr) {
      LOG_ERROR("No callbacks to call");
      return;
    }


    uint16_t le_scan_interval = kScanIntervalSlow;
    uint16_t le_scan_interval = kScanIntervalSlow;
    uint16_t le_scan_window = kScanWindowSlow;
    uint16_t le_scan_window = kScanWindowSlow;