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

Commit 9857069d authored by Chris Manton's avatar Chris Manton
Browse files

contextual_callback: Remove unused apis

Bug: 336298374
Test: m .
Flag: EXEMPT, Unused Code Removal
Change-Id: I8b9c933d7bc10c45d4ab24853e92bcd10fd8dc00
parent 0164b9b9
Loading
Loading
Loading
Loading
+0 −16
Original line number Diff line number Diff line
@@ -48,14 +48,6 @@ class ContextualOnceCallback<R(Args...)> {
    return context_ && callback_;
  }

  void Invoke(Args... args) {
    context_->Post(common::BindOnce(std::move(callback_), std::forward<Args>(args)...));
  }

  bool IsEmpty() {
    return context_ == nullptr;
  }

 private:
  common::OnceCallback<R(Args...)> callback_;
  IPostableContext* context_;
@@ -90,14 +82,6 @@ class ContextualCallback<R(Args...)> {
    return context_ && callback_;
  }

  void Invoke(Args... args) {
    context_->Post(common::BindOnce(callback_, std::forward<Args>(args)...));
  }

  bool IsEmpty() {
    return context_ == nullptr;
  }

 private:
  common::Callback<R(Args...)> callback_;
  IPostableContext* context_;
+1 −1
Original line number Diff line number Diff line
@@ -228,7 +228,7 @@ struct HciLayer::impl {
          CommandCompleteView::Create(EventView::Create(PacketView<kLittleEndian>(complete)));
      log::assert_that(
          command_complete_view.IsValid(), "assert failed: command_complete_view.IsValid()");
      command_queue_.front().GetCallback<CommandCompleteView>()->Invoke(command_complete_view);
      (*command_queue_.front().GetCallback<CommandCompleteView>())(command_complete_view);
    } else {
      log::assert_that(
          command_queue_.front().waiting_for_status_ == is_status,
+1 −1
Original line number Diff line number Diff line
@@ -177,7 +177,7 @@ struct RemoteNameRequestModule::impl {
  void on_remote_host_supported_features_notification(EventView view) {
    auto packet = RemoteHostSupportedFeaturesNotificationView::Create(view);
    log::assert_that(packet.IsValid(), "assert failed: packet.IsValid()");
    if (pending_ && !on_remote_host_supported_features_notification_.IsEmpty()) {
    if (pending_ && on_remote_host_supported_features_notification_) {
      log::info(
          "Received REMOTE_HOST_SUPPORTED_FEATURES_NOTIFICATION from {}",
          packet.GetBdAddr().ToRedactedStringForLogging());
+1 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ hci::AddressWithType DynamicChannelImpl::GetDevice() const {
}

void DynamicChannelImpl::RegisterOnCloseCallback(DynamicChannel::OnCloseCallback on_close_callback) {
  log::assert_that(on_close_callback_.IsEmpty(), "OnCloseCallback can only be registered once");
  log::assert_that(!on_close_callback_, "OnCloseCallback can only be registered once");
  // If channel is already closed, call the callback immediately without saving it
  if (closed_) {
    on_close_callback(close_reason_);