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

Commit 0e3e24e3 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "PandoraServer: submit intents in the subscriber scope" into main

parents 5ac76e81 9ca5c0b9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -59,12 +59,12 @@ class A2dp(val context: Context) : A2DPImplBase(), Closeable {
    private var audioTrack: AudioTrack? = null

    init {
        scope = CoroutineScope(Dispatchers.Default)
        scope = CoroutineScope(Dispatchers.Default.limitedParallelism(1))
        val intentFilter = IntentFilter()
        intentFilter.addAction(BluetoothA2dp.ACTION_PLAYING_STATE_CHANGED)
        intentFilter.addAction(BluetoothA2dp.ACTION_CONNECTION_STATE_CHANGED)

        flow = intentFlow(context, intentFilter).shareIn(scope, SharingStarted.Eagerly)
        flow = intentFlow(context, intentFilter, scope).shareIn(scope, SharingStarted.Eagerly)
    }

    override fun close() {
+2 −2
Original line number Diff line number Diff line
@@ -52,11 +52,11 @@ class A2dpSink(val context: Context) : A2DPImplBase(), Closeable {
        getProfileProxy<BluetoothA2dpSink>(context, BluetoothProfile.A2DP_SINK)

    init {
        scope = CoroutineScope(Dispatchers.Default)
        scope = CoroutineScope(Dispatchers.Default.limitedParallelism(1))
        val intentFilter = IntentFilter()
        intentFilter.addAction(BluetoothA2dpSink.ACTION_CONNECTION_STATE_CHANGED)

        flow = intentFlow(context, intentFilter).shareIn(scope, SharingStarted.Eagerly)
        flow = intentFlow(context, intentFilter, scope).shareIn(scope, SharingStarted.Eagerly)
    }

    override fun close() {
+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ private const val TAG = "PandoraAndroidInternal"
@kotlinx.coroutines.ExperimentalCoroutinesApi
class AndroidInternal(val context: Context) : AndroidImplBase(), Closeable {

    private val scope: CoroutineScope = CoroutineScope(Dispatchers.Default)
    private val scope: CoroutineScope = CoroutineScope(Dispatchers.Default.limitedParallelism(1))
    private val INCOMING_FILE_ACCEPT_BTN = "ACCEPT"
    private val INCOMING_FILE_TITLE = "Incoming file"
    private val INCOMING_FILE_WAIT_TIMEOUT = 2000L
+2 −2
Original line number Diff line number Diff line
@@ -66,10 +66,10 @@ class Asha(val context: Context) : AshaImplBase(), Closeable {

    init {
        // Init the CoroutineScope
        scope = CoroutineScope(Dispatchers.Default)
        scope = CoroutineScope(Dispatchers.Default.limitedParallelism(1))
        val intentFilter = IntentFilter()
        intentFilter.addAction(BluetoothHearingAid.ACTION_CONNECTION_STATE_CHANGED)
        flow = intentFlow(context, intentFilter).shareIn(scope, SharingStarted.Eagerly)
        flow = intentFlow(context, intentFilter, scope).shareIn(scope, SharingStarted.Eagerly)
    }

    override fun close() {
+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ class Avrcp(val context: Context) : AVRCPImplBase(), Closeable {

    init {
        // Init the CoroutineScope
        scope = CoroutineScope(Dispatchers.Default)
        scope = CoroutineScope(Dispatchers.Default.limitedParallelism(1))
    }

    override fun close() {
Loading