Skip to content

Commit

Permalink
Merge bbc5285 into 859cb0c
Browse files Browse the repository at this point in the history
  • Loading branch information
jrothfeder authored Oct 19, 2023
2 parents 859cb0c + bbc5285 commit dc2cdab
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import android.content.Context
import android.content.Intent
import android.content.ServiceConnection
import android.os.Handler
import android.os.HandlerThread
import android.os.IBinder
import android.os.Looper
import android.os.Message
Expand Down Expand Up @@ -54,13 +55,18 @@ internal object SessionLifecycleClient {
private var serviceBound: Boolean = false
private val queuedMessages = LinkedBlockingDeque<Message>(MAX_QUEUED_MESSAGES)
private var curSessionId: String = ""
private var handlerThread: HandlerThread = HandlerThread("FirebaseSessionsClient_HandlerThread")

init {
handlerThread.start()
}

/**
* The callback class that will be used to receive updated session events from the
* [SessionLifecycleService].
*/
// TODO(rothbutter) should we use the main looper or is there one available in this SDK?
internal class ClientUpdateHandler : Handler(Looper.getMainLooper()) {
internal class ClientUpdateHandler : Handler(handlerThread.looper) {
override fun handleMessage(msg: Message) {
when (msg.what) {
SessionLifecycleService.SESSION_UPDATED ->
Expand Down

0 comments on commit dc2cdab

Please sign in to comment.