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

Commit 06f86588 authored by Steve Elliott's avatar Steve Elliott Committed by Charlie Boutier
Browse files

Replace usage of deprecated coroutines methods

This change is necessary to unblock the upgrade of the
kotlinx.coroutines library.

Bug: 245578454
Test: manual -- all existing tests and builds should pass
Ignore-AOSP-First: Cherry-pick from AOSP
Merged-In: Ide673105eab416d5a0747189d652ca89ed241bba
Change-Id: Ide673105eab416d5a0747189d652ca89ed241bba
parent e0be500c
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -49,7 +49,6 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.awaitCancellation
import kotlinx.coroutines.cancel
import kotlinx.coroutines.channels.awaitClose
import kotlinx.coroutines.channels.sendBlocking
import kotlinx.coroutines.channels.trySendBlocking
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.Flow
@@ -567,7 +566,7 @@ class Host(private val context: Context, private val server: Server) : HostImplB
        val callback =
          object : ScanCallback() {
            override fun onScanResult(callbackType: Int, result: ScanResult) {
              sendBlocking(
              trySendBlocking(
                RunDiscoveryResponse.newBuilder()
                  .setDevice(
                    Device.newBuilder()
+1 −1
Original line number Diff line number Diff line
@@ -179,7 +179,7 @@ fun <T, U> grpcBidirectionalStream(
    override fun onNext(req: T) {
      // Note: this should be made a blocking call, and the handler should run in a separate thread
      // so we get flow control - but for now we can live with this
      if (!inputChannel.offer(req)) {
      if (inputChannel.trySend(req).isFailure) {
        job.cancel(CancellationException("too many incoming requests, buffer exceeded"))
        responseObserver.onError(
          CancellationException("too many incoming requests, buffer exceeded")