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

Commit a874609a authored by William Escande's avatar William Escande Committed by Automerger Merge Worker
Browse files

Merge "ABS volume support is not informed to Audio sometimes" into main am: 3754e4c3

parents 46b3fb43 3754e4c3
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;
  };