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

Commit a864a396 authored by chelseahao's avatar chelseahao Committed by Chelsea Hao
Browse files

Move the registration of `BluetoothCallback` to bg thread for bt qs dialog.

Test: atest
Bug: 367224151
Flag: EXEMPT bugfix
Change-Id: I33a121b57afcb3420c036f259305b33dafcafae6
parent 832e8eda
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import kotlinx.coroutines.flow.SharedFlow
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.asSharedFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.flowOn
import kotlinx.coroutines.flow.shareIn
import kotlinx.coroutines.isActive
import kotlinx.coroutines.withContext
@@ -114,6 +115,7 @@ constructor(
                localBluetoothManager?.eventManager?.registerCallback(listener)
                awaitClose { localBluetoothManager?.eventManager?.unregisterCallback(listener) }
            }
            .flowOn(backgroundDispatcher)
            .shareIn(coroutineScope, SharingStarted.WhileSubscribed(replayExpirationMillis = 0))

    internal suspend fun updateDeviceItems(context: Context, trigger: DeviceFetchTrigger) {