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

Commit ab9e19ad authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

leaudio: Fix update pending contexts

We should use group_id and not active_group_id_ as it might differs e.g.
in case of active group change.
Also fix initialization of the pending_update_available_contexts_

Bug: 150670922
Test: atest --host bluetooth_le_audio_client_test
sponsor: @jpawlowski
Change-Id: If8e8040ae85dad4807883bf39a7b6bb167d3ff60
parent bc28d6b7
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -3106,7 +3106,7 @@ class LeAudioClientImpl : public LeAudioClient {
        } else {
        } else {
          CancelStreamingRequest();
          CancelStreamingRequest();
        }
        }
        LeAudioDeviceGroup* group = aseGroups_.FindById(active_group_id_);
        LeAudioDeviceGroup* group = aseGroups_.FindById(group_id);
        if (!group) {
        if (!group) {
          LOG(ERROR) << __func__ << ", Failed to update pending available "
          LOG(ERROR) << __func__ << ", Failed to update pending available "
                     << "contexts for group: " << group_id;
                     << "contexts for group: " << group_id;
+2 −2
Original line number Original line Diff line number Diff line
@@ -197,10 +197,10 @@ class LeAudioDeviceGroup {
        transport_latency_mtos_us_(0),
        transport_latency_mtos_us_(0),
        transport_latency_stom_us_(0),
        transport_latency_stom_us_(0),
        active_context_type_(types::LeAudioContextType::UNINITIALIZED),
        active_context_type_(types::LeAudioContextType::UNINITIALIZED),
        pending_update_available_contexts_(std::nullopt),
        target_state_(types::AseState::BTA_LE_AUDIO_ASE_STATE_IDLE),
        target_state_(types::AseState::BTA_LE_AUDIO_ASE_STATE_IDLE),
        current_state_(types::AseState::BTA_LE_AUDIO_ASE_STATE_IDLE),
        current_state_(types::AseState::BTA_LE_AUDIO_ASE_STATE_IDLE),
        context_type_(types::LeAudioContextType::UNINITIALIZED) {
        context_type_(types::LeAudioContextType::UNINITIALIZED) {}
  }
  ~LeAudioDeviceGroup(void);
  ~LeAudioDeviceGroup(void);


  void AddNode(const std::shared_ptr<LeAudioDevice>& leAudioDevice);
  void AddNode(const std::shared_ptr<LeAudioDevice>& leAudioDevice);