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

Commit 4e61aab8 authored by Yun-hao Chung's avatar Yun-hao Chung Committed by Gerrit Code Review
Browse files

Merge "Floss: Ignore multiple RemoteHostSupportedFeatureNotifications" into main

parents 0fe344d4 31d71980
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -156,15 +156,21 @@ struct RemoteNameRequestModule::impl {
  void on_remote_host_supported_features_notification(EventView view) {
    auto packet = RemoteHostSupportedFeaturesNotificationView::Create(view);
    ASSERT(packet.IsValid());
    if (pending_) {
    if (pending_ && !on_remote_host_supported_features_notification_.IsEmpty()) {
      LOG_INFO(
          "Received REMOTE_HOST_SUPPORTED_FEATURES_NOTIFICATION from %s",
          packet.GetBdAddr().ToRedactedStringForLogging().c_str());
      on_remote_host_supported_features_notification_.Invoke(packet.GetHostSupportedFeatures());
    } else {
      // Remove the callback so that we won't call it again.
      on_remote_host_supported_features_notification_ = RemoteHostSupportedFeaturesCallback();
    } else if (!pending_) {
      LOG_ERROR(
          "Received unexpected REMOTE_HOST_SUPPORTED_FEATURES_NOTIFICATION when no Remote Name "
          "Request is outstanding");
    } else {  // callback is not set, which indicates we have processed the feature notification.
      LOG_ERROR(
          "Received more than one REMOTE_HOST_SUPPORTED_FEATURES_NOTIFICATION during Remote Name "
          "Request");
    }
  }