File tree Expand file tree Collapse file tree
app/src/main/kotlin/io/homeassistant/companion/android/websocket Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,16 +3,16 @@ package io.homeassistant.companion.android.websocket
33import android.content.BroadcastReceiver
44import android.content.Context
55import android.content.Intent
6+ import io.homeassistant.companion.android.common.util.launchAsync
67import kotlinx.coroutines.CoroutineScope
78import kotlinx.coroutines.Dispatchers
8- import kotlinx.coroutines.Job
9- import kotlinx.coroutines.launch
9+ import kotlinx.coroutines.SupervisorJob
1010
1111class WebsocketBroadcastReceiver : BroadcastReceiver () {
12- private val ioScope : CoroutineScope = CoroutineScope (Dispatchers .IO + Job ())
12+ private val receiverScope : CoroutineScope = CoroutineScope (Dispatchers .Default + SupervisorJob ())
1313
1414 override fun onReceive (context : Context , intent : Intent ) {
15- ioScope.launch {
15+ launchAsync(receiverScope) {
1616 WebsocketManager .start(context)
1717 }
1818 }
You can’t perform that action at this time.
0 commit comments