Prevent RootServer.create cancelling the entire scope

This commit is contained in:
Mygod
2020-11-08 01:48:43 -05:00
parent fe07e2678a
commit 795caee54d
2 changed files with 2 additions and 3 deletions

View File

@@ -270,7 +270,7 @@ class RootServer {
@Throws(RemoteException::class)
fun <T : Parcelable?> create(command: RootCommandChannel<T>, scope: CoroutineScope,
classLoader: ClassLoader?) = scope.produce<T>(
capacity = command.capacity.also {
SupervisorJob(), command.capacity.also {
when (it) {
Channel.UNLIMITED, Channel.CONFLATED -> { }
else -> throw IllegalArgumentException("Unsupported channel capacity $it")