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

Commit 31dbc0a5 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "leaudio: Fix late CIS disconnect scenario."

parents 8a6d8dda f3bd6d54
Loading
Loading
Loading
Loading
+5 −11
Original line number Diff line number Diff line
@@ -985,11 +985,6 @@ class LeAudioGroupStateMachineImpl : public LeAudioGroupStateMachine {
              "state, reconfig=%d.",
              group->group_id_, reconfig);

          if (reconfig) {
            group->ClearPendingConfiguration();
            state_machine_callbacks_->StatusReportCb(
                group->group_id_, GroupStreamStatus::CONFIGURED_BY_USER);
          } else {
          /* This is Autonomous change if both, target and current state
           * is CODEC_CONFIGURED
           */
@@ -998,7 +993,6 @@ class LeAudioGroupStateMachineImpl : public LeAudioGroupStateMachine {
                group->group_id_, GroupStreamStatus::CONFIGURED_AUTONOMOUS);
          }
        }
        }
        RemoveCigForGroup(group);
      } break;
      default:
+11 −9
Original line number Diff line number Diff line
@@ -3884,7 +3884,7 @@ TEST_F(StateMachineTest, BoundedHeadphonesConversationalToMediaChannelCount_1) {
  ASSERT_EQ(1, get_func_call_count("alarm_cancel"));
}

TEST_F(StateMachineTest, lateCisDisconnectedEvent_ConfiguredByUser) {
TEST_F(StateMachineTest, lateCisDisconnectedEvent_DuringReconfiguration) {
  const auto context_type = kContextTypeMedia;
  const auto leaudio_group_id = 6;
  const auto num_devices = 1;
@@ -3950,10 +3950,11 @@ TEST_F(StateMachineTest, lateCisDisconnectedEvent_ConfiguredByUser) {
      StatusReportCb(leaudio_group_id,
                     bluetooth::le_audio::GroupStreamStatus::RELEASING));

  EXPECT_CALL(mock_callbacks_,
  EXPECT_CALL(
      mock_callbacks_,
      StatusReportCb(
          leaudio_group_id,
                  bluetooth::le_audio::GroupStreamStatus::CONFIGURED_BY_USER))
          bluetooth::le_audio::GroupStreamStatus::CONFIGURED_AUTONOMOUS))
      .Times(0);
  LeAudioGroupStateMachine::Get()->StopStream(group);

@@ -3961,10 +3962,11 @@ TEST_F(StateMachineTest, lateCisDisconnectedEvent_ConfiguredByUser) {

  ASSERT_EQ(0, get_func_call_count("alarm_cancel"));

  EXPECT_CALL(mock_callbacks_,
  EXPECT_CALL(
      mock_callbacks_,
      StatusReportCb(
          leaudio_group_id,
                  bluetooth::le_audio::GroupStreamStatus::CONFIGURED_BY_USER));
          bluetooth::le_audio::GroupStreamStatus::CONFIGURED_AUTONOMOUS));

  // Inject CIS and ACL disconnection of first device
  InjectCisDisconnected(group, leAudioDevice, HCI_ERR_CONN_CAUSE_LOCAL_HOST);