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

Commit 2cdedb2d authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "leaudio: Fix handling disconnection of single device" am: a6d7de9b

parents b4f5e074 a6d7de9b
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -688,12 +688,14 @@ class LeAudioGroupStateMachineImpl : public LeAudioGroupStateMachine {
     */
    group->UpdateAudioContextTypeAvailability();

    /* ACL of one of the device has been dropped.
     * If there is active CIS, do nothing here. Just update the available
     * contexts table.
    if (group->IsAnyDeviceConnected()) {
      /*
       * ACL of one of the device has been dropped. If number of CISes has
       * changed notify upper layer so the offloader can be updated with CIS
       * information.
       */
    if (group->IsAnyDeviceConnected() && !group->HaveAllCisesDisconnected()) {
      if ((group->GetState() == AseState::BTA_LE_AUDIO_ASE_STATE_STREAMING) &&
      if (!group->HaveAllCisesDisconnected() &&
          (group->GetState() == AseState::BTA_LE_AUDIO_ASE_STATE_STREAMING) &&
          (group->GetTargetState() ==
           AseState::BTA_LE_AUDIO_ASE_STATE_STREAMING)) {
        /* We keep streaming but want others to let know user that it might be
+2 −0
Original line number Diff line number Diff line
@@ -2988,6 +2988,8 @@ TEST_F(StateMachineTest, testStateTransitionTimeoutOnIdleState) {
       .source = types::AudioContexts(context_type)}));

  // Disconnect device
  // in client.cc before this function is called, state of device is changed.
  leAudioDevice->SetConnectionState(DeviceConnectState::DISCONNECTED);
  LeAudioGroupStateMachine::Get()->ProcessHciNotifAclDisconnected(
      group, leAudioDevice);