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

Commit d3624a28 authored by Yiyi Shen's avatar Yiyi Shen Committed by Android (Google) Code Review
Browse files

Merge "[Audiosharing] Set onStart value correctly for primary group id flow" into main

parents 88433857 5c4a2f67
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()