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

Commit 762061d2 authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

leaudio: Minor test clean up

Use already implemented stub handler instead of reimplementing things.
It also matches real code better.

Bug: 331775328
Flag: TEST_ONLY
Test: atest bluetooth_le_audio_client_test
Change-Id: I71188b63fb29de4d02558e12c742c2918d000146
parent b0acd0f4
Loading
Loading
Loading
Loading
+2 −45
Original line number Diff line number Diff line
@@ -1202,54 +1202,11 @@ protected:
              if (!group) {
                return;
              }
              auto* stream_conf = &group->stream_conf;
              if (!stream_conf->stream_params.sink.stream_locations.empty() ||
                  !stream_conf->stream_params.source.stream_locations.empty()) {
                stream_conf->stream_params.sink.stream_locations.erase(
                        std::remove_if(
                                stream_conf->stream_params.sink.stream_locations.begin(),
                                stream_conf->stream_params.sink.stream_locations.end(),
                                [leAudioDevice, &stream_conf](auto& pair) {
                                  auto ases = leAudioDevice->GetAsesByCisConnHdl(pair.first);
                                  if (ases.sink) {
                                    stream_conf->stream_params.sink.num_of_devices--;
                                    stream_conf->stream_params.sink.num_of_channels -=
                                            ases.sink->channel_count;

                                    log::info(
                                            ", Source Number Of Devices: {}"
                                            ", Source Number Of Channels: {}",
                                            stream_conf->stream_params.source.num_of_devices,
                                            stream_conf->stream_params.source.num_of_channels);
                                  }
                                  return ases.sink;
                                }),
                        stream_conf->stream_params.sink.stream_locations.end());

                stream_conf->stream_params.source.stream_locations.erase(
                        std::remove_if(
                                stream_conf->stream_params.source.stream_locations.begin(),
                                stream_conf->stream_params.source.stream_locations.end(),
                                [leAudioDevice, &stream_conf](auto& pair) {
                                  auto ases = leAudioDevice->GetAsesByCisConnHdl(pair.first);
                                  if (ases.source) {
                                    stream_conf->stream_params.source.num_of_devices--;
                                    stream_conf->stream_params.source.num_of_channels -=
                                            ases.source->channel_count;

                                    log::info(
                                            ", Source Number Of Devices: {}, Source Number Of "
                                            "Channels: {}",
                                            stream_conf->stream_params.source.num_of_devices,
                                            stream_conf->stream_params.source.num_of_channels);
                                  }
                                  return ases.source;
                                }),
                        stream_conf->stream_params.source.stream_locations.end());
              for (auto& ase : leAudioDevice->ases_) {
                group->RemoveCisFromStreamIfNeeded(leAudioDevice, ase.cis_conn_hdl);
              }

              group->cig.UnassignCis(leAudioDevice);

              if (group->IsEmpty()) {
                group->cig.SetState(bluetooth::le_audio::types::CigState::NONE);
                InjectCigRemoved(group->group_id_);