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

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

Merge changes If5e336e6,Ica34fcfb,I42aa96a6

* changes:
  Fix advertising enable completion callbacks
  Simplify TestHciLayer
  Revert^2 Move TestHciLayer into a separate file
parents 3b190fb0 8656bf9a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ table InitFlagsData {
    redact_log_is_enabled:bool (privacy:"Any");
    sdp_serialization_is_enabled:bool (privacy:"Any");
    sdp_skip_rnr_if_known_is_enabled:bool (privacy:"Any");
    trigger_advertising_callbacks_on_first_resume_after_pause_is_enabled:bool (privacy:"Any");
}
// LINT.ThenChange(/system/gd/dumpsys/init_flags.cc)

+2 −0
Original line number Diff line number Diff line
@@ -56,6 +56,8 @@ flatbuffers::Offset<bluetooth::common::InitFlagsData> bluetooth::dumpsys::InitFl
  builder.add_redact_log_is_enabled(initFlags::redact_log_is_enabled());
  builder.add_sdp_serialization_is_enabled(initFlags::sdp_serialization_is_enabled());
  builder.add_sdp_skip_rnr_if_known_is_enabled(initFlags::sdp_skip_rnr_if_known_is_enabled());
  builder.add_trigger_advertising_callbacks_on_first_resume_after_pause_is_enabled(
      initFlags::trigger_advertising_callbacks_on_first_resume_after_pause_is_enabled());

  return builder.Finish();
}
+1 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ filegroup {
        "class_of_device_unittest.cc",
        "controller_test.cc",
        "controller_unittest.cc",
        "hci_layer_fake.cc",
        "hci_layer_test.cc",
        "hci_layer_unittest.cc",
        "hci_packets_test.cc",
+6 −5
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@

#include "hci/acl_manager/le_connection_management_callbacks.h"
#include "hci/address_with_type.h"
#include "hci/hci_layer_fake.h"
#include "hci/hci_packets.h"
#include "hci/le_acl_connection_interface.h"
#include "os/handler.h"
@@ -59,7 +60,8 @@ constexpr uint16_t kTimeout = 0x80;
constexpr uint16_t kContinuationNumber = 0x32;

namespace bluetooth::hci::acl_manager {
hci::PacketView<hci::kLittleEndian> GetPacketView(std::unique_ptr<packet::BasePacketBuilder> packet);

namespace {

class TestLeConnectionManagementCallbacks : public hci::acl_manager::LeConnectionManagementCallbacks {
  void OnConnectionUpdate(
@@ -90,7 +92,6 @@ class TestLeConnectionManagementCallbacks : public hci::acl_manager::LeConnectio
  FRIEND_TEST(LeAclConnectionTest, LeSubrateRequest_success);
  FRIEND_TEST(LeAclConnectionTest, LeSubrateRequest_error);
};
}  // namespace bluetooth::hci::acl_manager

class TestLeAclConnectionInterface : public hci::LeAclConnectionInterface {
 private:
@@ -161,8 +162,6 @@ class TestLeAclConnectionInterface : public hci::LeAclConnectionInterface {
  std::unique_ptr<std::future<void>> command_future_;
};

namespace bluetooth::hci::acl_manager {

class LeAclConnectionTest : public ::testing::Test {
 protected:
  void SetUp() override {
@@ -250,4 +249,6 @@ TEST_F(LeAclConnectionTest, LeSubrateRequest_error) {
  on_status.Invoke(std::move(command_status));
  sync_handler();
}

}  // namespace
}  // namespace bluetooth::hci::acl_manager
 No newline at end of file
+3 −0
Original line number Diff line number Diff line
@@ -163,6 +163,8 @@ namespace bluetooth {
namespace hci {
namespace acl_manager {

namespace {

PacketView<kLittleEndian> GetPacketView(std::unique_ptr<packet::BasePacketBuilder> packet) {
  auto bytes = std::make_shared<std::vector<uint8_t>>();
  BitInserter i(*bytes);
@@ -382,6 +384,7 @@ class TestHciLayer : public HciLayer {
  std::unique_ptr<std::future<void>> command_future_;
  CommandInterfaceImpl<AclCommandBuilder> le_acl_connection_manager_interface_{*this};
};
}  // namespace

class MockLeConnectionCallbacks : public LeConnectionCallbacks {
 public:
Loading