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

Commit 8682cff1 authored by Himanshu Rawat's avatar Himanshu Rawat Committed by Automerger Merge Worker
Browse files

Merge "Latency mode "FREE" should always be allowed" into main am: 75058742

parents fd6ab4b5 75058742
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -351,11 +351,16 @@ bool BluetoothAudioClientInterface::SetAllowedLatencyModes(
    return false;
  }

  if (latency_modes.empty()) {
    latency_modes_.clear();
    latency_modes_.push_back(LatencyMode::FREE);
  } else {
    /* Ensure that FREE is always included and remove duplicates if any */
    std::set<LatencyMode> temp_set(latency_modes.begin(), latency_modes.end());
    temp_set.insert(LatencyMode::FREE);
    latency_modes_.clear();
    latency_modes_.assign(temp_set.begin(), temp_set.end());
  }

  for (auto latency_mode : latency_modes) {
    LOG(INFO) << "Latency mode allowed: "
@@ -364,7 +369,7 @@ bool BluetoothAudioClientInterface::SetAllowedLatencyModes(
  }

  /* Low latency mode is used if modes other than FREE are present */
  bool allowed = (latency_modes_.size() > 1);
  bool allowed = !(latency_modes_.empty());
  auto aidl_retval = provider_->setLowLatencyModeAllowed(allowed);
  if (!aidl_retval.isOk()) {
    LOG(WARNING) << __func__ << ": BluetoothAudioHal is not ready: "
+2 −2
Original line number Diff line number Diff line
@@ -870,11 +870,11 @@ bool LeAudioClientInterface::ReleaseSource(
void LeAudioClientInterface::SetAllowedDsaModes(DsaModes dsa_modes) {
  if (HalVersionManager::GetHalTransport() ==
      BluetoothAudioHalTransport::AIDL) {
    std::vector<LatencyMode> latency_modes;
    std::vector<LatencyMode> latency_modes = {LatencyMode::FREE};
    for (auto dsa_mode : dsa_modes) {
      switch (dsa_mode) {
        case DsaMode::DISABLED:
          latency_modes.push_back(LatencyMode::FREE);
        // Already added
          break;
        case DsaMode::ACL:
          latency_modes.push_back(LatencyMode::LOW_LATENCY);