From 6ad11c69d3162a433236502dd4b8b4e38e442bd1 Mon Sep 17 00:00:00 2001 From: Ɓukasz Rymanowski Date: Mon, 17 Mar 2025 13:36:47 +0000 Subject: flag: Remove leaudio_speed_up_reconfiguration_between_call flag Flag has been delivered Bug: 352686917 Test: atest bluetooth_le_audio_client_test Flag: EXEMPT, flag cleanup Change-Id: I8256e68a65d543f32516094717cda14d00adad18 --- system/bta/le_audio/client.cc | 10 - system/bta/le_audio/le_audio_client_test.cc | 464 ---------------------------- 2 files changed, 474 deletions(-) (limited to 'system') diff --git a/system/bta/le_audio/client.cc b/system/bta/le_audio/client.cc index 43c5100b02..e03c456b84 100644 --- a/system/bta/le_audio/client.cc +++ b/system/bta/le_audio/client.cc @@ -1332,11 +1332,6 @@ public: in_call_ = in_call; - if (!com::android::bluetooth::flags::leaudio_speed_up_reconfiguration_between_call()) { - log::debug("leaudio_speed_up_reconfiguration_between_call flag is not enabled"); - return; - } - if (active_group_id_ == bluetooth::groups::kGroupUnknown) { log::debug("There is no active group"); return; @@ -5451,11 +5446,6 @@ public: remote_metadata.source.set(LeAudioContextType::CONVERSATIONAL); } - if (!com::android::bluetooth::flags::leaudio_speed_up_reconfiguration_between_call()) { - UpdateSinkLocalMetadataContextTypes(remote_metadata.source); - UpdateSourceLocalMetadataContextTypes(remote_metadata.sink); - } - if (IsInVoipCall()) { log::debug("Unsetting RINGTONE from remote sink"); remote_metadata.sink.unset(LeAudioContextType::RINGTONE); diff --git a/system/bta/le_audio/le_audio_client_test.cc b/system/bta/le_audio/le_audio_client_test.cc index 02104518d2..10e2f2b561 100644 --- a/system/bta/le_audio/le_audio_client_test.cc +++ b/system/bta/le_audio/le_audio_client_test.cc @@ -8837,111 +8837,7 @@ TEST_F(UnicastTest, TwoEarbudsStopConversational_StartStreamSonification) { Mock::VerifyAndClearExpectations(&mock_state_machine_); } -TEST_F(UnicastTest, TwoEarbudsStreamingContextSwitchReconfigure) { - // TODO(b/352686917). Remove the test when flag will be removing - com::android::bluetooth::flags::provider_->leaudio_speed_up_reconfiguration_between_call(false); - - uint8_t group_size = 2; - int group_id = 2; - - // Report working CSIS - ON_CALL(mock_csis_client_module_, IsCsisClientRunning()).WillByDefault(Return(true)); - - ON_CALL(mock_csis_client_module_, GetDesiredSize(group_id)) - .WillByDefault(Invoke([&](int /*group_id*/) { return group_size; })); - - // First earbud - const RawAddress test_address0 = GetTestAddress(0); - EXPECT_CALL(mock_btif_storage_, AddLeaudioAutoconnect(test_address0, true)).Times(1); - ConnectCsisDevice(test_address0, 1 /*conn_id*/, codec_spec_conf::kLeAudioLocationFrontLeft, - codec_spec_conf::kLeAudioLocationFrontLeft, group_size, group_id, 1 /* rank*/); - - // Second earbud - const RawAddress test_address1 = GetTestAddress(1); - EXPECT_CALL(mock_btif_storage_, AddLeaudioAutoconnect(test_address1, true)).Times(1); - ConnectCsisDevice(test_address1, 2 /*conn_id*/, codec_spec_conf::kLeAudioLocationFrontRight, - codec_spec_conf::kLeAudioLocationFrontRight, group_size, group_id, 2 /* rank*/, - true /*connect_through_csis*/); - - constexpr int gmcs_ccid = 1; - constexpr int gtbs_ccid = 2; - - // Start streaming MEDIA - EXPECT_CALL(*mock_le_audio_source_hal_client_, Start(_, _, _)).Times(1); - EXPECT_CALL(*mock_le_audio_sink_hal_client_, Start(_, _, _)).Times(1); - LeAudioClient::Get()->SetCcidInformation(gmcs_ccid, 4 /* Media */); - LeAudioClient::Get()->SetCcidInformation(gtbs_ccid, 2 /* Phone */); - LeAudioClient::Get()->GroupSetActive(group_id); - SyncOnMainLoop(); - - types::BidirectionalPair> ccids = {.sink = {gmcs_ccid}, .source = {}}; - EXPECT_CALL(mock_state_machine_, StartStream(_, _, _, ccids)).Times(1); - StartStreaming(AUDIO_USAGE_MEDIA, AUDIO_CONTENT_TYPE_MUSIC, group_id); - - SyncOnMainLoop(); - Mock::VerifyAndClearExpectations(&mock_state_machine_); - Mock::VerifyAndClearExpectations(&mock_audio_hal_client_callbacks_); - Mock::VerifyAndClearExpectations(mock_le_audio_source_hal_client_); - - // Verify Data transfer on two peer sinks - uint8_t cis_count_out = 2; - uint8_t cis_count_in = 0; - TestAudioDataTransfer(group_id, cis_count_out, cis_count_in, 1920); - - // Stop - StopStreaming(group_id); - // simulate suspend timeout passed, alarm executing - fake_osi_alarm_set_on_mloop_.cb(fake_osi_alarm_set_on_mloop_.data); - Mock::VerifyAndClearExpectations(&mock_audio_hal_client_callbacks_); - - log::info("SetInCall is used by GTBS - and only then we can expect CCID to be set."); - LeAudioClient::Get()->SetInCall(true); - - // Conversational is a bidirectional scenario so expect GTBS CCID - // in the metadata for both directions. Can be called twice when one - // direction resume after the other and metadata is updated. - ccids = {.sink = {gtbs_ccid}, .source = {gtbs_ccid}}; - EXPECT_CALL(mock_state_machine_, - StartStream(_, types::LeAudioContextType::CONVERSATIONAL, _, ccids)) - .Times(AtLeast(1)); - StartStreaming(AUDIO_USAGE_VOICE_COMMUNICATION, AUDIO_CONTENT_TYPE_SPEECH, group_id); - - SyncOnMainLoop(); - Mock::VerifyAndClearExpectations(&mock_audio_hal_client_callbacks_); - Mock::VerifyAndClearExpectations(mock_le_audio_source_hal_client_); - - // Verify Data transfer on two peer sinks and one source - cis_count_out = 2; - cis_count_in = 2; - TestAudioDataTransfer(group_id, cis_count_out, cis_count_in, 1920, 40); - - log::info("End call"); - LeAudioClient::Get()->SetInCall(false); - UpdateLocalSourceMetadata(AUDIO_USAGE_UNKNOWN, AUDIO_CONTENT_TYPE_UNKNOWN, false); - UpdateLocalSinkMetadata(std::nullopt); - // Stop - StopStreaming(group_id, true); - - log::info("Switch back to MEDIA"); - ccids = {.sink = {gmcs_ccid}, .source = {}}; - types::BidirectionalPair contexts = { - .sink = types::AudioContexts(types::LeAudioContextType::MEDIA), - .source = types::AudioContexts()}; - EXPECT_CALL(mock_state_machine_, - ConfigureStream(_, bluetooth::le_audio::types::LeAudioContextType::MEDIA, contexts, - ccids, _)) - .Times(1); - StartStreaming(AUDIO_USAGE_MEDIA, AUDIO_CONTENT_TYPE_MUSIC, group_id, AUDIO_SOURCE_INVALID, true); - - SyncOnMainLoop(); - Mock::VerifyAndClearExpectations(&mock_state_machine_); - Mock::VerifyAndClearExpectations(&mock_audio_hal_client_callbacks_); - Mock::VerifyAndClearExpectations(mock_le_audio_source_hal_client_); -} - TEST_F(UnicastTest, TwoEarbudsStreamingContextSwitchReconfigure_SpeedUpReconfigFlagEnabled) { - com::android::bluetooth::flags::provider_->leaudio_speed_up_reconfiguration_between_call(true); - uint8_t group_size = 2; int group_id = 2; @@ -10937,79 +10833,7 @@ TEST_F(UnicastTest, SwitchBetweenSoundEffectAndMicrophoneScenario) { * What we can do now is to keep streaming (and reconfigure if needed for the * use case). */ -TEST_F(UnicastTest, UpdateNotSupportedContextTypeUnspecifiedAvailable) { - // TODO(b/352686917). Remove the test when flag will be removing - com::android::bluetooth::flags::provider_->leaudio_speed_up_reconfiguration_between_call(false); - - const RawAddress test_address0 = GetTestAddress(0); - int group_id = bluetooth::groups::kGroupUnknown; - - available_snk_context_types_ = - (types::LeAudioContextType::RINGTONE | types::LeAudioContextType::CONVERSATIONAL | - types::LeAudioContextType::UNSPECIFIED | types::LeAudioContextType::MEDIA) - .value(); - supported_snk_context_types_ = available_snk_context_types_; - available_src_context_types_ = available_snk_context_types_; - supported_src_context_types_ = available_src_context_types_; - - SetSampleDatabaseEarbudsValid(1, test_address0, codec_spec_conf::kLeAudioLocationStereo, - codec_spec_conf::kLeAudioLocationStereo, default_channel_cnt, - default_channel_cnt, 0x0004, false /*add_csis*/, true /*add_cas*/, - true /*add_pacs*/, default_ase_cnt /*add_ascs_cnt*/, 1 /*set_size*/, - 0 /*rank*/); - EXPECT_CALL(mock_audio_hal_client_callbacks_, - OnConnectionState(ConnectionState::CONNECTED, test_address0)) - .Times(1); - EXPECT_CALL(mock_audio_hal_client_callbacks_, - OnGroupNodeStatus(test_address0, _, GroupNodeStatus::ADDED)) - .WillOnce(DoAll(SaveArg<1>(&group_id))); - - ConnectLeAudio(test_address0); - ASSERT_NE(group_id, bluetooth::groups::kGroupUnknown); - - // Start streaming - uint8_t cis_count_out = 1; - uint8_t cis_count_in = 0; - - LeAudioClient::Get()->SetInCall(true); - - // Audio sessions are started only when device gets active - EXPECT_CALL(*mock_le_audio_source_hal_client_, Start(_, _, _)).Times(1); - EXPECT_CALL(*mock_le_audio_sink_hal_client_, Start(_, _, _)).Times(1); - LeAudioClient::Get()->GroupSetActive(group_id); - SyncOnMainLoop(); - - StartStreaming(AUDIO_USAGE_NOTIFICATION_TELEPHONY_RINGTONE, AUDIO_CONTENT_TYPE_UNKNOWN, group_id); - LocalAudioSourceResume(); - LocalAudioSinkResume(); - - Mock::VerifyAndClearExpectations(&mock_audio_hal_client_callbacks_); - Mock::VerifyAndClearExpectations(mock_le_audio_source_hal_client_); - SyncOnMainLoop(); - - // Verify Data transfer on one audio source cis - TestAudioDataTransfer(group_id, cis_count_out, cis_count_in, 1920); - - LeAudioClient::Get()->SetInCall(false); - LocalAudioSinkSuspend(); - UpdateLocalSinkMetadata(std::nullopt); - - /* We should use GAME configuration, but do not send the GAME context type, as - * it is not available on the remote device. - */ - EXPECT_CALL(mock_state_machine_, StopStream(_)).Times(0); - types::BidirectionalPair contexts = { - .sink = types::AudioContexts(types::LeAudioContextType::UNSPECIFIED), - .source = types::AudioContexts()}; - EXPECT_CALL(mock_state_machine_, StartStream(_, types::LeAudioContextType::GAME, contexts, _)) - .Times(1); - UpdateLocalSourceMetadata(AUDIO_USAGE_GAME, AUDIO_CONTENT_TYPE_UNKNOWN, false); - SyncOnMainLoop(); -} - TEST_F(UnicastTest, UpdateNotSupportedContextTypeUnspecifiedAvailable_SpeedUpReconfigFlagEnabled) { - com::android::bluetooth::flags::provider_->leaudio_speed_up_reconfiguration_between_call(true); - const RawAddress test_address0 = GetTestAddress(0); int group_id = bluetooth::groups::kGroupUnknown; @@ -11081,146 +10905,7 @@ TEST_F(UnicastTest, UpdateNotSupportedContextTypeUnspecifiedAvailable_SpeedUpRec * always results with one bidirectional context, so that the remote device * is not confused about our intentions. */ -TEST_F(UnicastTest, UpdateMultipleBidirContextTypes) { - // TODO(b/352686917). Remove the test when flag will be removing - com::android::bluetooth::flags::provider_->leaudio_speed_up_reconfiguration_between_call(false); - - const RawAddress test_address0 = GetTestAddress(0); - int group_id = bluetooth::groups::kGroupUnknown; - - available_snk_context_types_ = (types::LeAudioContextType::CONVERSATIONAL | - types::LeAudioContextType::GAME | types::LeAudioContextType::LIVE) - .value(); - supported_snk_context_types_ = - available_snk_context_types_ | - types::AudioContexts(types::LeAudioContextType::UNSPECIFIED).value(); - available_src_context_types_ = available_snk_context_types_; - supported_src_context_types_ = - available_src_context_types_ | - types::AudioContexts(types::LeAudioContextType::UNSPECIFIED).value(); - - SetSampleDatabaseEarbudsValid(1, test_address0, codec_spec_conf::kLeAudioLocationAnyLeft, - codec_spec_conf::kLeAudioLocationStereo, default_channel_cnt, - default_channel_cnt, 0x0024, false /*add_csis*/, true /*add_cas*/, - true /*add_pacs*/, default_ase_cnt /*add_ascs_cnt*/, 1 /*set_size*/, - 0 /*rank*/); - EXPECT_CALL(mock_audio_hal_client_callbacks_, - OnConnectionState(ConnectionState::CONNECTED, test_address0)) - .Times(1); - EXPECT_CALL(mock_audio_hal_client_callbacks_, - OnGroupNodeStatus(test_address0, _, GroupNodeStatus::ADDED)) - .WillOnce(DoAll(SaveArg<1>(&group_id))); - - ConnectLeAudio(test_address0); - ASSERT_NE(group_id, bluetooth::groups::kGroupUnknown); - - // Audio sessions are started only when device gets active - EXPECT_CALL(*mock_le_audio_source_hal_client_, Start(_, _, _)).Times(1); - EXPECT_CALL(*mock_le_audio_sink_hal_client_, Start(_, _, _)).Times(1); - LeAudioClient::Get()->GroupSetActive(group_id); - SyncOnMainLoop(); - - // When the local audio sink resumes expect only LIVE context - types::BidirectionalPair contexts = { - .sink = types::AudioContexts(types::LeAudioContextType::LIVE), - .source = types::AudioContexts(types::LeAudioContextType::LIVE)}; - EXPECT_CALL(mock_state_machine_, - StartStream(_, bluetooth::le_audio::types::LeAudioContextType::LIVE, contexts, _)) - .Times(1); - - // 1) Start the recording. Sink resume will trigger the reconfiguration - // --------------------------------------------------------------------- - ASSERT_NE(nullptr, unicast_sink_hal_cb_); - UpdateLocalSinkMetadata(AUDIO_SOURCE_MIC); - LocalAudioSinkResume(); - - Mock::VerifyAndClearExpectations(mock_le_audio_source_hal_client_); - Mock::VerifyAndClearExpectations(mock_le_audio_sink_hal_client_); - Mock::VerifyAndClearExpectations(&mock_state_machine_); - - /* After the reconfiguration the local Audio Sink HAL has to resume again */ - LocalAudioSourceResume(); - LocalAudioSinkResume(); - - Mock::VerifyAndClearExpectations(mock_le_audio_source_hal_client_); - Mock::VerifyAndClearExpectations(mock_le_audio_sink_hal_client_); - Mock::VerifyAndClearExpectations(&mock_state_machine_); - - // Verify Data transfer on one audio source and sink cis - uint8_t cis_count_out = 1; - uint8_t cis_count_in = 1; - TestAudioDataTransfer(group_id, cis_count_out, cis_count_in, 1920, 40); - - // Stop - StopStreaming(group_id); - Mock::VerifyAndClearExpectations(&mock_audio_hal_client_callbacks_); - - // 2) Now set in call preference to get CONVERSATIONAL into the mix - // ----------------------------------------------------------------- - LeAudioClient::Get()->SetInCall(true); - - // Verify that we only got CONVERSATIONAL context and no LIVE - contexts = {.sink = types::AudioContexts(types::LeAudioContextType::CONVERSATIONAL), - .source = types::AudioContexts(types::LeAudioContextType::CONVERSATIONAL)}; - EXPECT_CALL(mock_state_machine_, - StartStream(_, bluetooth::le_audio::types::LeAudioContextType::CONVERSATIONAL, - contexts, _)) - .Times(1); - - // Start with ringtone on local source - ASSERT_NE(nullptr, unicast_sink_hal_cb_); - StartStreaming(AUDIO_USAGE_NOTIFICATION_TELEPHONY_RINGTONE, AUDIO_CONTENT_TYPE_UNKNOWN, group_id); - - // Resume both directions - LocalAudioSourceResume(); - LocalAudioSinkResume(); - - Mock::VerifyAndClearExpectations(&mock_audio_hal_client_callbacks_); - Mock::VerifyAndClearExpectations(mock_le_audio_source_hal_client_); - Mock::VerifyAndClearExpectations(&mock_state_machine_); - - // Verify Data transfer on one audio source cis - cis_count_out = 1; - cis_count_in = 1; - TestAudioDataTransfer(group_id, cis_count_out, cis_count_in, 1920, 40); - - // 3) Disable call so we could go to GAME - // --------------------------------------- - LeAudioClient::Get()->SetInCall(false); - - /* Start the game on local source - expect no previous sink (LIVE) metadata */ - EXPECT_CALL(mock_state_machine_, StopStream(_)).Times(0); - contexts = {.sink = types::AudioContexts(types::LeAudioContextType::GAME), - .source = types::AudioContexts(types::LeAudioContextType::GAME)}; - EXPECT_CALL(mock_state_machine_, StartStream(_, types::LeAudioContextType::GAME, contexts, _)) - .Times(1); - UpdateLocalSourceMetadata(AUDIO_USAGE_GAME, AUDIO_CONTENT_TYPE_UNKNOWN, false); - - /* If the above triggers reconfiguration, Audio Hal action is needed to - * restart the stream. - */ - LocalAudioSourceResume(); - LocalAudioSinkResume(); - Mock::VerifyAndClearExpectations(&mock_state_machine_); - - // 4) Stop streaming - // ------------------ - StopStreaming(group_id); - Mock::VerifyAndClearExpectations(&mock_audio_hal_client_callbacks_); - - // Release - EXPECT_CALL(*mock_le_audio_source_hal_client_, Stop()).Times(1); - EXPECT_CALL(*mock_le_audio_source_hal_client_, OnDestroyed()).Times(1); - EXPECT_CALL(*mock_le_audio_sink_hal_client_, OnDestroyed()).Times(1); - do_in_main_thread(base::BindOnce( - [](LeAudioClient* client) { client->GroupSetActive(bluetooth::groups::kGroupUnknown); }, - LeAudioClient::Get())); - SyncOnMainLoop(); -} - TEST_F(UnicastTest, UpdateMultipleBidirContextTypes_SpeedUpReconfigFlagEnabled) { - com::android::bluetooth::flags::provider_->leaudio_speed_up_reconfiguration_between_call(true); - const RawAddress test_address0 = GetTestAddress(0); int group_id = bluetooth::groups::kGroupUnknown; @@ -11444,154 +11129,7 @@ TEST_F(UnicastTest, UpdateDisableLocalAudioSinkOnGame) { } /* Start music when in a call, end the call, continue with music only */ -TEST_F(UnicastTest, MusicDuringCallContextTypes) { - // TODO(b/352686917). Remove the test when flag will be removing - com::android::bluetooth::flags::provider_->leaudio_speed_up_reconfiguration_between_call(false); - - const RawAddress test_address0 = GetTestAddress(0); - int group_id = bluetooth::groups::kGroupUnknown; - - available_snk_context_types_ = - (types::LeAudioContextType::CONVERSATIONAL | types::LeAudioContextType::RINGTONE | - types::LeAudioContextType::GAME | types::LeAudioContextType::MEDIA | - types::LeAudioContextType::LIVE | types::LeAudioContextType::NOTIFICATIONS) - .value(); - supported_snk_context_types_ = - available_snk_context_types_ | - types::AudioContexts(types::LeAudioContextType::UNSPECIFIED).value(); - available_src_context_types_ = available_snk_context_types_; - available_src_context_types_ &= - ~((types::LeAudioContextType::NOTIFICATIONS | types::LeAudioContextType::MEDIA).value()); - supported_src_context_types_ = - available_src_context_types_ | - types::AudioContexts(types::LeAudioContextType::UNSPECIFIED).value(); - - SetSampleDatabaseEarbudsValid(1, test_address0, codec_spec_conf::kLeAudioLocationAnyLeft, - codec_spec_conf::kLeAudioLocationStereo, default_channel_cnt, - default_channel_cnt, 0x0024, false /*add_csis*/, true /*add_cas*/, - true /*add_pacs*/, default_ase_cnt /*add_ascs_cnt*/, 1 /*set_size*/, - 0 /*rank*/); - EXPECT_CALL(mock_audio_hal_client_callbacks_, - OnConnectionState(ConnectionState::CONNECTED, test_address0)) - .Times(1); - EXPECT_CALL(mock_audio_hal_client_callbacks_, - OnGroupNodeStatus(test_address0, _, GroupNodeStatus::ADDED)) - .WillOnce(DoAll(SaveArg<1>(&group_id))); - - ConnectLeAudio(test_address0); - ASSERT_NE(group_id, bluetooth::groups::kGroupUnknown); - - // Audio sessions are started only when device gets active - EXPECT_CALL(*mock_le_audio_source_hal_client_, Start(_, _, _)).Times(1); - EXPECT_CALL(*mock_le_audio_sink_hal_client_, Start(_, _, _)).Times(1); - LeAudioClient::Get()->GroupSetActive(group_id); - SyncOnMainLoop(); - - log::info("TESTPOINT 1: Start with the call first"); - // ----------------------------- - // CONVERSATIONAL is from In Call preference, and RINGTONE is from metadata - LeAudioClient::Get()->SetInCall(true); - types::BidirectionalPair contexts = { - .sink = types::AudioContexts(types::LeAudioContextType::RINGTONE | - types::LeAudioContextType::CONVERSATIONAL), - .source = types::AudioContexts(types::LeAudioContextType::CONVERSATIONAL)}; - EXPECT_CALL(mock_state_machine_, - StartStream(_, bluetooth::le_audio::types::LeAudioContextType::CONVERSATIONAL, - contexts, _)) - .Times(1); - StartStreaming(AUDIO_USAGE_NOTIFICATION_TELEPHONY_RINGTONE, AUDIO_CONTENT_TYPE_UNKNOWN, group_id); - LocalAudioSinkResume(); - - // Verify - Mock::VerifyAndClearExpectations(&mock_audio_hal_client_callbacks_); - Mock::VerifyAndClearExpectations(mock_le_audio_source_hal_client_); - Mock::VerifyAndClearExpectations(&mock_state_machine_); - - // Verify Data transfer - uint8_t cis_count_out = 1; - uint8_t cis_count_in = 1; - TestAudioDataTransfer(group_id, cis_count_out, cis_count_in, 1920, 40); - - log::info("TESTPOINT 2: Start MEDIA during the call, expect MEDIA only on the remote sink"); - contexts = {.sink = types::AudioContexts(types::LeAudioContextType::CONVERSATIONAL | - types::LeAudioContextType::MEDIA), - .source = types::AudioContexts(types::LeAudioContextType::CONVERSATIONAL)}; - EXPECT_CALL(mock_state_machine_, - StartStream(_, bluetooth::le_audio::types::LeAudioContextType::CONVERSATIONAL, - contexts, _)) - .Times(1); - UpdateLocalSourceMetadata(AUDIO_USAGE_MEDIA, AUDIO_CONTENT_TYPE_MUSIC, false); - SyncOnMainLoop(); - - Mock::VerifyAndClearExpectations(&mock_state_machine_); - Mock::VerifyAndClearExpectations(mock_le_audio_source_hal_client_); - Mock::VerifyAndClearExpectations(mock_le_audio_sink_hal_client_); - - log::info( - "TESTPOINT 3: Disable In Call preference but do not suspend the local sink. Play " - "notification on the same stream."); - // Verify both context are sent as the metadata. - // --------------------------------------- - LeAudioClient::Get()->SetInCall(false); - - EXPECT_CALL(mock_state_machine_, StopStream(_)).Times(0); - contexts = {.sink = types::AudioContexts(types::LeAudioContextType::NOTIFICATIONS | - types::LeAudioContextType::CONVERSATIONAL), - .source = types::AudioContexts(types::LeAudioContextType::CONVERSATIONAL)}; - EXPECT_CALL(mock_state_machine_, - StartStream(_, types::LeAudioContextType::CONVERSATIONAL, contexts, _)) - .Times(1); - UpdateLocalSourceMetadata(AUDIO_USAGE_NOTIFICATION, AUDIO_CONTENT_TYPE_UNKNOWN, - /*reconfigure=*/false); - Mock::VerifyAndClearExpectations(&mock_state_machine_); - Mock::VerifyAndClearExpectations(mock_le_audio_source_hal_client_); - Mock::VerifyAndClearExpectations(mock_le_audio_sink_hal_client_); - - log::info("TESTPOINT 4: Disable call so we could go back to MEDIA"); - // --------------------------------------- - // Suspend should stop the stream - EXPECT_CALL(mock_state_machine_, StopStream(_)).Times(1); - UpdateLocalSinkMetadata(std::nullopt); - LocalAudioSourceSuspend(); - LocalAudioSinkSuspend(); - // simulate suspend timeout passed, alarm executing - fake_osi_alarm_set_on_mloop_.cb(fake_osi_alarm_set_on_mloop_.data); - Mock::VerifyAndClearExpectations(&mock_state_machine_); - - // Restart the stream with MEDIA - contexts = {.sink = types::AudioContexts(types::LeAudioContextType::MEDIA), - .source = types::AudioContexts()}; - EXPECT_CALL(mock_state_machine_, StartStream(_, types::LeAudioContextType::MEDIA, contexts, _)) - .Times(1); - UpdateLocalSourceMetadata(AUDIO_USAGE_MEDIA, AUDIO_CONTENT_TYPE_MUSIC, - /*reconfigure=*/false); - Mock::VerifyAndClearExpectations(mock_le_audio_source_hal_client_); - Mock::VerifyAndClearExpectations(mock_le_audio_sink_hal_client_); - - /* The source needs to resume to reconfigure to MEDIA */ - LocalAudioSourceResume(/*expect_confirm=*/false); - LocalAudioSourceResume(/*expect_confirm=*/true); - Mock::VerifyAndClearExpectations(&mock_state_machine_); - Mock::VerifyAndClearExpectations(mock_le_audio_source_hal_client_); - Mock::VerifyAndClearExpectations(mock_le_audio_sink_hal_client_); - - log::info("TESTPOINT 5: Stop streaming"); - // ------------------ - StopStreaming(group_id); - Mock::VerifyAndClearExpectations(&mock_audio_hal_client_callbacks_); - - // Release - EXPECT_CALL(*mock_le_audio_source_hal_client_, Stop()).Times(1); - EXPECT_CALL(*mock_le_audio_source_hal_client_, OnDestroyed()).Times(1); - EXPECT_CALL(*mock_le_audio_sink_hal_client_, OnDestroyed()).Times(1); - do_in_main_thread(base::BindOnce( - [](LeAudioClient* client) { client->GroupSetActive(bluetooth::groups::kGroupUnknown); }, - LeAudioClient::Get())); - SyncOnMainLoop(); -} - TEST_F(UnicastTest, MetadataUpdateDuringReconfiguration) { - com::android::bluetooth::flags::provider_->leaudio_speed_up_reconfiguration_between_call(true); const RawAddress test_address0 = GetTestAddress(0); int group_id = bluetooth::groups::kGroupUnknown; @@ -11664,8 +11202,6 @@ TEST_F(UnicastTest, MetadataUpdateDuringReconfiguration) { } TEST_F(UnicastTest, MusicDuringCallContextTypes_SpeedUpReconfigFlagEnabled) { - com::android::bluetooth::flags::provider_->leaudio_speed_up_reconfiguration_between_call(true); - const RawAddress test_address0 = GetTestAddress(0); int group_id = bluetooth::groups::kGroupUnknown; -- cgit v1.2.3-59-g8ed1b