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

Commit 99b36e35 authored by Rahul Arya's avatar Rahul Arya Committed by Gerrit Code Review
Browse files

Merge "[Connection Manager] Remove locally_initiated field for LE"

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

}  // namespace acl_manager
+1 −4
Original line number Diff line number Diff line
@@ -36,10 +36,7 @@ class MockLeConnectionCallbacks : public LeConnectionCallbacks {
      (AddressWithType address_with_type, std::unique_ptr<LeAclConnection> connection),
      (override));
  MOCK_METHOD(
      void,
      OnLeConnectFail,
      (AddressWithType address_with_type, ErrorCode reason, bool locally_initiated),
      (override));
      void, OnLeConnectFail, (AddressWithType address_with_type, ErrorCode reason), (override));
};

}  // namespace acl_manager
+5 −10
Original line number Diff line number Diff line
@@ -390,8 +390,7 @@ struct le_impl : public bluetooth::hci::LeAddressManagerCallback {
            &LeConnectionCallbacks::OnLeConnectFail,
            common::Unretained(le_client_callbacks_),
            remote_address,
            status,
            true /* locally_initiated */));
            status));
        return;
      }
    } else {
@@ -408,8 +407,7 @@ struct le_impl : public bluetooth::hci::LeAddressManagerCallback {
            &LeConnectionCallbacks::OnLeConnectFail,
            common::Unretained(le_client_callbacks_),
            remote_address,
            status,
            false /* locally_initiated */));
            status));
        return;
      }

@@ -545,8 +543,7 @@ struct le_impl : public bluetooth::hci::LeAddressManagerCallback {
            &LeConnectionCallbacks::OnLeConnectFail,
            common::Unretained(le_client_callbacks_),
            remote_address,
            status,
            true /* locally_initiated */));
            status));
        return;
      }

@@ -564,8 +561,7 @@ struct le_impl : public bluetooth::hci::LeAddressManagerCallback {
            &LeConnectionCallbacks::OnLeConnectFail,
            common::Unretained(le_client_callbacks_),
            remote_address,
            status,
            false /* locally_initiated */));
            status));
        return;
      }

@@ -1129,8 +1125,7 @@ struct le_impl : public bluetooth::hci::LeAddressManagerCallback {
          &LeConnectionCallbacks::OnLeConnectFail,
          common::Unretained(le_client_callbacks_),
          address_with_type,
          ErrorCode::CONNECTION_ACCEPT_TIMEOUT,
          true /* locally_initiated */));
          ErrorCode::CONNECTION_ACCEPT_TIMEOUT));
    }
  }

+4 −2
Original line number Diff line number Diff line
@@ -402,7 +402,7 @@ class MockLeConnectionCallbacks : public LeConnectionCallbacks {
      (AddressWithType address_with_type, std::unique_ptr<LeAclConnection> connection),
      (override));
  MOCK_METHOD(
      void, OnLeConnectFail, (AddressWithType address_with_type, ErrorCode reason, bool locally_initiated), (override));
      void, OnLeConnectFail, (AddressWithType address_with_type, ErrorCode reason), (override));
};

class MockLeConnectionManagementCallbacks : public LeConnectionManagementCallbacks {
@@ -1477,7 +1477,9 @@ TEST_F(LeImplTest, on_le_connection_canceled_on_pause) {
}

TEST_F(LeImplTest, on_create_connection_timeout) {
  EXPECT_CALL(mock_le_connection_callbacks_, OnLeConnectFail(_, ErrorCode::CONNECTION_ACCEPT_TIMEOUT, _)).Times(1);
  EXPECT_CALL(
      mock_le_connection_callbacks_, OnLeConnectFail(_, ErrorCode::CONNECTION_ACCEPT_TIMEOUT))
      .Times(1);
  le_impl_->create_connection_timeout_alarms_.emplace(
      std::piecewise_construct,
      std::forward_as_tuple(
+1 −2
Original line number Diff line number Diff line
@@ -487,8 +487,7 @@ TEST_F(AclManagerTest, invoke_registered_callback_le_connection_complete_fail) {

  EXPECT_CALL(
      mock_le_connection_callbacks_,
      OnLeConnectFail(
          remote_with_type, ErrorCode::CONNECTION_REJECTED_LIMITED_RESOURCES, /* locally_initiated */ true));
      OnLeConnectFail(remote_with_type, ErrorCode::CONNECTION_REJECTED_LIMITED_RESOURCES));

  test_hci_layer_->IncomingLeMetaEvent(LeConnectionCompleteBuilder::Create(
      ErrorCode::CONNECTION_REJECTED_LIMITED_RESOURCES,
Loading