Loading packages/SettingsLib/src/com/android/settingslib/volume/data/repository/AudioSharingRepository.kt +4 −3 Original line number Diff line number Diff line Loading @@ -63,7 +63,7 @@ typealias GroupIdToVolumes = Map<Int, Int> /** Provides audio sharing functionality. */ interface AudioSharingRepository { /** Whether the device is in audio sharing. */ val inAudioSharing: Flow<Boolean> val inAudioSharing: StateFlow<Boolean> /** The primary headset groupId in audio sharing. */ val primaryGroupId: StateFlow<Int> Loading Loading @@ -101,7 +101,7 @@ class AudioSharingRepositoryImpl( .flowOn(backgroundCoroutineContext) .stateIn(coroutineScope, SharingStarted.WhileSubscribed(), false) override val inAudioSharing: Flow<Boolean> = override val inAudioSharing: StateFlow<Boolean> = isAudioSharingProfilesReady.flatMapLatest { ready -> if (ready) { btManager.profileManager.leAudioBroadcastProfile.onBroadcastStartedOrStopped Loading @@ -113,6 +113,7 @@ class AudioSharingRepositoryImpl( flowOf(false) } } .stateIn(coroutineScope, SharingStarted.WhileSubscribed(), false) private val primaryChange: Flow<Unit> = callbackFlow { val callback = Loading Loading @@ -254,7 +255,7 @@ class AudioSharingRepositoryImpl( } class AudioSharingRepositoryEmptyImpl : AudioSharingRepository { override val inAudioSharing: Flow<Boolean> = flowOf(false) override val inAudioSharing: StateFlow<Boolean> = MutableStateFlow(false) override val primaryGroupId: StateFlow<Int> = MutableStateFlow(BluetoothCsipSetCoordinator.GROUP_ID_INVALID) override val secondaryGroupId: StateFlow<Int> = Loading packages/SystemUI/tests/utils/src/com/android/systemui/volume/data/repository/FakeAudioSharingRepository.kt +1 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ package com.android.systemui.volume.data.repository import com.android.settingslib.volume.data.repository.AudioSharingRepository import com.android.settingslib.volume.data.repository.GroupIdToVolumes import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow Loading @@ -30,7 +29,7 @@ class FakeAudioSharingRepository : AudioSharingRepository { MutableStateFlow(TEST_GROUP_ID_INVALID) private val mutableVolumeMap: MutableStateFlow<GroupIdToVolumes> = MutableStateFlow(emptyMap()) override val inAudioSharing: Flow<Boolean> = mutableInAudioSharing override val inAudioSharing: StateFlow<Boolean> = mutableInAudioSharing override val primaryGroupId: StateFlow<Int> = mutablePrimaryGroupId override val secondaryGroupId: StateFlow<Int> = mutableSecondaryGroupId override val volumeMap: StateFlow<GroupIdToVolumes> = mutableVolumeMap Loading Loading
packages/SettingsLib/src/com/android/settingslib/volume/data/repository/AudioSharingRepository.kt +4 −3 Original line number Diff line number Diff line Loading @@ -63,7 +63,7 @@ typealias GroupIdToVolumes = Map<Int, Int> /** Provides audio sharing functionality. */ interface AudioSharingRepository { /** Whether the device is in audio sharing. */ val inAudioSharing: Flow<Boolean> val inAudioSharing: StateFlow<Boolean> /** The primary headset groupId in audio sharing. */ val primaryGroupId: StateFlow<Int> Loading Loading @@ -101,7 +101,7 @@ class AudioSharingRepositoryImpl( .flowOn(backgroundCoroutineContext) .stateIn(coroutineScope, SharingStarted.WhileSubscribed(), false) override val inAudioSharing: Flow<Boolean> = override val inAudioSharing: StateFlow<Boolean> = isAudioSharingProfilesReady.flatMapLatest { ready -> if (ready) { btManager.profileManager.leAudioBroadcastProfile.onBroadcastStartedOrStopped Loading @@ -113,6 +113,7 @@ class AudioSharingRepositoryImpl( flowOf(false) } } .stateIn(coroutineScope, SharingStarted.WhileSubscribed(), false) private val primaryChange: Flow<Unit> = callbackFlow { val callback = Loading Loading @@ -254,7 +255,7 @@ class AudioSharingRepositoryImpl( } class AudioSharingRepositoryEmptyImpl : AudioSharingRepository { override val inAudioSharing: Flow<Boolean> = flowOf(false) override val inAudioSharing: StateFlow<Boolean> = MutableStateFlow(false) override val primaryGroupId: StateFlow<Int> = MutableStateFlow(BluetoothCsipSetCoordinator.GROUP_ID_INVALID) override val secondaryGroupId: StateFlow<Int> = Loading
packages/SystemUI/tests/utils/src/com/android/systemui/volume/data/repository/FakeAudioSharingRepository.kt +1 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ package com.android.systemui.volume.data.repository import com.android.settingslib.volume.data.repository.AudioSharingRepository import com.android.settingslib.volume.data.repository.GroupIdToVolumes import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow Loading @@ -30,7 +29,7 @@ class FakeAudioSharingRepository : AudioSharingRepository { MutableStateFlow(TEST_GROUP_ID_INVALID) private val mutableVolumeMap: MutableStateFlow<GroupIdToVolumes> = MutableStateFlow(emptyMap()) override val inAudioSharing: Flow<Boolean> = mutableInAudioSharing override val inAudioSharing: StateFlow<Boolean> = mutableInAudioSharing override val primaryGroupId: StateFlow<Int> = mutablePrimaryGroupId override val secondaryGroupId: StateFlow<Int> = mutableSecondaryGroupId override val volumeMap: StateFlow<GroupIdToVolumes> = mutableVolumeMap Loading