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

Commit 8a984a02 authored by Łukasz Rymanowski's avatar Łukasz Rymanowski Committed by Gerrit Code Review
Browse files

Merge "leaudio: Update confiuration, when device connected"

parents b0c80d64 d01159bb
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -485,6 +485,12 @@ class LeAudioClientImpl : public LeAudioClient {

  void UpdateContextAndLocations(LeAudioDeviceGroup* group,
                                 LeAudioDevice* leAudioDevice) {
    if (leAudioDevice->GetConnectionState() != DeviceConnectState::CONNECTED) {
      LOG_DEBUG("%s not yet connected ",
                ADDRESS_TO_LOGGABLE_CSTR(leAudioDevice->address_));
      return;
    }

    /* Make sure location and direction are updated for the group. */
    auto location_update = group->ReloadAudioLocations();
    group->ReloadAudioDirections();
+6 −2
Original line number Diff line number Diff line
@@ -826,7 +826,9 @@ bool LeAudioDeviceGroup::ReloadAudioLocations(void) {
      codec_spec_conf::kLeAudioLocationNotAllowed;

  for (const auto& device : leAudioDevices_) {
    if (device.expired()) continue;
    if (device.expired() || (device.lock().get()->GetConnectionState() !=
                             DeviceConnectState::CONNECTED))
      continue;
    updated_snk_audio_locations_ |= device.lock().get()->snk_audio_locations_;
    updated_src_audio_locations_ |= device.lock().get()->src_audio_locations_;
  }
@@ -846,7 +848,9 @@ bool LeAudioDeviceGroup::ReloadAudioDirections(void) {
  uint8_t updated_audio_directions = 0x00;

  for (const auto& device : leAudioDevices_) {
    if (device.expired()) continue;
    if (device.expired() || (device.lock().get()->GetConnectionState() !=
                             DeviceConnectState::CONNECTED))
      continue;
    updated_audio_directions |= device.lock().get()->audio_directions_;
  }