Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ package io.homeassistant.companion.android.websocket
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import io.homeassistant.companion.android.common.util.launchAsync
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
import kotlinx.coroutines.SupervisorJob

class WebsocketBroadcastReceiver : BroadcastReceiver() {
private val ioScope: CoroutineScope = CoroutineScope(Dispatchers.IO + Job())
private val receiverScope: CoroutineScope = CoroutineScope(Dispatchers.Default + SupervisorJob())

override fun onReceive(context: Context, intent: Intent) {
ioScope.launch {
launchAsync(receiverScope) {
WebsocketManager.start(context)
Comment thread
TimoPtr marked this conversation as resolved.
Comment thread
TimoPtr marked this conversation as resolved.
}
}
Expand Down
Loading