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

Commit 8eb2d0c0 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Revert "gd: Plumb through ReadRemoteExtendedFeatures""

parents 07fe29dc 066bb77f
Loading
Loading
Loading
Loading
+10 −13
Original line number Diff line number Diff line
@@ -116,16 +116,12 @@ class AclConnectionTracker : public ConnectionManagementCallbacks {
  void OnRoleChange(Role new_role) override {
    SAVE_OR_CALL(OnRoleChange, new_role)
  }
  void OnReadRemoteVersionInformationComplete(
      uint8_t lmp_version, uint16_t manufacturer_name, uint16_t sub_version) override {
    SAVE_OR_CALL(OnReadRemoteVersionInformationComplete, lmp_version, manufacturer_name, sub_version);
  }
  void OnReadRemoteExtendedFeaturesComplete(uint8_t page_number, uint8_t max_page_number, uint64_t features) override {
    SAVE_OR_CALL(OnReadRemoteExtendedFeaturesComplete, page_number, max_page_number, features);
  }
  void OnDisconnection(ErrorCode reason) {
    SAVE_OR_CALL(OnDisconnection, reason);
  }
  void OnReadRemoteVersionInformationComplete(uint8_t lmp_version, uint16_t manufacturer_name, uint16_t sub_version) {
    SAVE_OR_CALL(OnReadRemoteVersionInformationComplete, lmp_version, manufacturer_name, sub_version);
  }

#undef SAVE_OR_CALL

@@ -257,6 +253,7 @@ class AclConnectionTracker : public ConnectionManagementCallbacks {

  void on_read_remote_version_information_status(CommandStatusView view) {
    ASSERT_LOG(view.IsValid(), "Bad status packet!");
    LOG_INFO("UNIMPLEMENTED called: %s", hci::ErrorCodeText(view.GetStatus()).c_str());
  }

  void on_read_remote_supported_features_status(CommandStatusView view) {
@@ -265,9 +262,9 @@ class AclConnectionTracker : public ConnectionManagementCallbacks {
  }

  void on_read_remote_extended_features_status(CommandStatusView view) {
    ASSERT_LOG(view.IsValid(), "Bad status packet!");
    ASSERT_LOG(view.IsValid(), "Broken");
    LOG_INFO("UNIMPLEMENTED called: %s", hci::ErrorCodeText(view.GetStatus()).c_str());
  }

  void on_read_clock_complete(CommandCompleteView view) {
    auto complete_view = ReadClockCompleteView::Create(view);
    if (!complete_view.IsValid()) {
@@ -536,11 +533,11 @@ bool ClassicAclConnection::ReadRemoteSupportedFeatures() {
  return true;
}

bool ClassicAclConnection::ReadRemoteExtendedFeatures(uint8_t page_number) {
bool ClassicAclConnection::ReadRemoteExtendedFeatures() {
  acl_connection_interface_->EnqueueCommand(
      ReadRemoteExtendedFeaturesBuilder::Create(handle_, page_number),
      pimpl_->tracker.client_handler_->BindOnceOn(
          &pimpl_->tracker, &AclConnectionTracker::on_read_remote_extended_features_status));
      ReadRemoteExtendedFeaturesBuilder::Create(handle_, 1),
      pimpl_->tracker.client_handler_->BindOnceOn(&pimpl_->tracker,
                                                  &AclConnectionTracker::on_read_remote_extended_features_status));
  return true;
}

+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ class ClassicAclConnection : public AclConnection {
  virtual bool ReadClock(WhichClock which_clock);
  virtual bool ReadRemoteVersionInformation();
  virtual bool ReadRemoteSupportedFeatures();
  virtual bool ReadRemoteExtendedFeatures(uint8_t page_number);
  virtual bool ReadRemoteExtendedFeatures();

  // Called once before passing the connection to the client
  virtual ConnectionManagementCallbacks* GetEventCallbacks();
+2 −8
Original line number Diff line number Diff line
@@ -457,10 +457,7 @@ struct classic_impl : public DisconnectorForLe, public security::ISecurityManage
      LOG_ERROR("Received on_read_remote_version_information_complete with error code %s", error_code.c_str());
      return;
    }
    uint16_t handle = view.GetConnectionHandle();
    auto& acl_connection = acl_connections_.find(handle)->second;
    acl_connection.connection_management_callbacks_->OnReadRemoteVersionInformationComplete(
        view.GetVersion(), view.GetManufacturerName(), view.GetSubVersion());
    LOG_INFO("UNIMPLEMENTED called");
  }

  void on_read_remote_supported_features_complete(EventPacketView packet) {
@@ -472,10 +469,7 @@ struct classic_impl : public DisconnectorForLe, public security::ISecurityManage
  void on_read_remote_extended_features_complete(EventPacketView packet) {
    auto view = ReadRemoteExtendedFeaturesCompleteView::Create(packet);
    ASSERT_LOG(view.IsValid(), "Read remote extended features packet invalid");
    uint16_t handle = view.GetConnectionHandle();
    auto& acl_connection = acl_connections_.find(handle)->second;
    acl_connection.connection_management_callbacks_->OnReadRemoteExtendedFeaturesComplete(
        view.GetPageNumber(), view.GetMaximumPageNumber(), view.GetExtendedLmpFeatures());
    LOG_INFO("UNIMPLEMENTED called");
  }

  void on_link_supervision_timeout_changed(EventPacketView packet) {
+0 −3
Original line number Diff line number Diff line
@@ -79,9 +79,6 @@ class ConnectionManagementCallbacks {
  // Invoked when controller sends Read Remote Version Information Complete
  virtual void OnReadRemoteVersionInformationComplete(
      uint8_t lmp_version, uint16_t manufacturer_name, uint16_t sub_version) = 0;
  // Invoked when controller sends Read Remote Extended Features Complete
  virtual void OnReadRemoteExtendedFeaturesComplete(
      uint8_t page_number, uint8_t max_page_number, uint64_t features) = 0;
};

}  // namespace acl_manager
+0 −2
Original line number Diff line number Diff line
@@ -502,8 +502,6 @@ class AclManagerWithConnectionTest : public AclManagerTest {
    MOCK_METHOD3(
        OnReadRemoteVersionInformationComplete,
        void(uint8_t lmp_version, uint16_t manufacturer_name, uint16_t sub_version));
    MOCK_METHOD3(
        OnReadRemoteExtendedFeaturesComplete, void(uint8_t page_number, uint8_t max_page_number, uint64_t features));
  } mock_connection_management_callbacks_;
};

Loading