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

Commit 3754e4c3 authored by William Escande's avatar William Escande Committed by Gerrit Code Review
Browse files

Merge "ABS volume support is not informed to Audio sometimes" into main

parents 8076aa18 3ff256c5
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -148,6 +148,22 @@ bool ConnectionHandler::ConnectDevice(const RawAddress& bdaddr) {
    }

    instance_->feature_map_[bdaddr] = features;

    if (com::android::bluetooth::flags::abs_volume_sdp_conflict()) {
      // Peer may connect avrcp during SDP. Check the connection state when
      // SDP completed to resolve the conflict.
      for (const auto& pair : instance_->device_map_) {
        if (bdaddr == pair.second->GetAddress()) {
          log::warn("Connected by peer device with address {}", bdaddr);
          if (features & BTA_AV_FEAT_ADV_CTRL) {
            pair.second->RegisterVolumeChanged();
          } else if (instance_->vol_ != nullptr) {
            instance_->vol_->DeviceConnected(pair.second->GetAddress());
          }
          return;
        }
      }
    }
    instance_->AvrcpConnect(true, bdaddr);
    return;
  };