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

Commit 740a4a62 authored by Eric Shih's avatar Eric Shih Committed by Automerger Merge Worker
Browse files

Merge "Fix missing CoD information when getting connection_request" am: bc73c58e

parents a638b00f bc73c58e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -261,6 +261,12 @@ struct classic_impl : public security::ISecurityManagerListener {
        return;

      case ConnectionRequestLinkType::ACL:
        // Need to upstream Cod information when getting connection_request
        client_handler_->CallOn(
            client_callbacks_,
            &ConnectionCallbacks::OnConnectRequest,
            address,
            request.GetClassOfDevice());
        break;

      case ConnectionRequestLinkType::ESCO:
+2 −0
Original line number Diff line number Diff line
@@ -32,6 +32,8 @@ class ConnectionCallbacks {
  virtual ~ConnectionCallbacks() = default;
  // Invoked when controller sends Connection Complete event with Success error code
  virtual void OnConnectSuccess(std::unique_ptr<ClassicAclConnection>) = 0;
  // Invoked when controller sends Connection Request
  virtual void OnConnectRequest(Address, ClassOfDevice) = 0;
  // Invoked when controller sends Connection Complete event with non-Success error code
  virtual void OnConnectFail(Address, ErrorCode reason, bool locally_initiated) = 0;

+1 −1
Original line number Diff line number Diff line
@@ -217,7 +217,7 @@ class AclManagerNoCallbacksTest : public ::testing::Test {
    void Clear() {
      connections_.clear();
    }

    MOCK_METHOD(void, OnConnectRequest, (Address, ClassOfDevice), (override));
    MOCK_METHOD(void, OnConnectFail, (Address, ErrorCode reason, bool locally_initiated), (override));

    MOCK_METHOD(void, HACK_OnEscoConnectRequest, (Address, ClassOfDevice), (override));
+1 −0
Original line number Diff line number Diff line
@@ -350,6 +350,7 @@ class MockConnectionCallback : public ConnectionCallbacks {
      connection_promise_.set_value(connections_.back());
    }
  }
  MOCK_METHOD(void, OnConnectRequest, (Address, ClassOfDevice), (override));
  MOCK_METHOD(void, OnConnectFail, (Address, ErrorCode reason, bool locally_initiated), (override));

  MOCK_METHOD(void, HACK_OnEscoConnectRequest, (Address, ClassOfDevice), (override));
+4 −0
Original line number Diff line number Diff line
@@ -376,6 +376,10 @@ class AclManagerFacadeService : public AclManagerFacade::Service, public Connect
    current_connection_request_++;
  }

  void OnConnectRequest(Address address, ClassOfDevice cod) override {
    LOG_ERROR("Remote connect request unimplemented");
  }

  void OnConnectFail(Address address, ErrorCode reason, bool locally_initiated) override {
    LOG_INFO("addr=%s, reason=%s",
             ADDRESS_TO_LOGGABLE_CSTR(address), ErrorCodeText(reason).c_str());
Loading