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

Commit 042fb7de authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

leaudio: Fix possible assert on stress BT ON/OFF

Bug: 286175322
Test: atest BluetoothInstrumentationTests
Tag: #feature
Change-Id: I62ccaf1fca6667db239f5c3523c3e2b7bda50859
parent a5795b52
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1019,8 +1019,11 @@ void LeAudioDeviceGroup::CigGenerateCisIds(
  uint8_t cis_count_bidir = 0;
  uint8_t cis_count_unidir_sink = 0;
  uint8_t cis_count_unidir_source = 0;
  int csis_group_size =
      bluetooth::csis::CsisClient::Get()->GetDesiredSize(group_id_);
  int csis_group_size = 0;

  if (bluetooth::csis::CsisClient::IsCsisClientRunning()) {
      csis_group_size = bluetooth::csis::CsisClient::Get()->GetDesiredSize(group_id_);
  }
  /* If this is CSIS group, the csis_group_size will be > 0, otherwise -1.
   * If the last happen it means, group size is 1 */
  int group_size = csis_group_size > 0 ? csis_group_size : 1;