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

Commit 7ae60440 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:...

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

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3036033



Change-Id: I9738028d1dffb491f124b65905886500212c83ea
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents fbcce499 a874609a
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;
  };