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

Commit 5c4a2f67 authored by Yiyi Shen's avatar Yiyi Shen
Browse files

[Audiosharing] Set onStart value correctly for primary group id flow

Test: atest
Flag: com.android.settingslib.flags.adopt_primary_group_management_api_v2
Bug: 397568136
Change-Id: I6133706aee41492a83f63c9e6794e5e2b2f8e77c
parent 68da9a90
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -146,7 +146,12 @@ class AudioSharingRepositoryImpl(
            isAudioSharingProfilesReady.flatMapLatest { ready ->
                if (ready) {
                    btManager.profileManager.leAudioProfile.onBroadcastToUnicastFallbackGroupChanged
                        .onStart { emit(BluetoothCsipSetCoordinator.GROUP_ID_INVALID) }
                        .onStart {
                            emit(
                                btManager.profileManager
                                    .leAudioProfile.broadcastToUnicastFallbackGroup
                            )
                        }
                        .flowOn(backgroundCoroutineContext)
                } else {
                    flowOf(BluetoothCsipSetCoordinator.GROUP_ID_INVALID)
+1 −0
Original line number Diff line number Diff line
@@ -228,6 +228,7 @@ class AudioSharingRepositoryTest {
            `when`(assistant.isProfileReady).thenReturn(true)
            `when`(volumeControl.isProfileReady).thenReturn(true)
            `when`(leAudio.isProfileReady).thenReturn(true)
            `when`(leAudio.broadcastToUnicastFallbackGroup).thenReturn(TEST_GROUP_ID_INVALID)
            val groupIds = mutableListOf<Int?>()
            underTest.primaryGroupId.onEach { groupIds.add(it) }.launchIn(backgroundScope)
            runCurrent()