launchAndReply
abstract fun launchAndReply(requestId: AsyncRequestId, interfaceDescriptor: String, transactionName: String, asyncReplyProvider: AsyncReplyProvider)
Invokes a suspendable asyncReplyProvider and sends the reply asynchronously.
The asyncReplyProvider returns a AsyncReplyWriter. This callback is invoked to write a reply to a Parcel.
Example usages:
launchAndReply(requestId, DESCRIPTOR, "doSomethingWithReturnValue") {
val result = doSomethingWithReturnValue()
val replyWriter: AsyncReplyWriter = { asyncReply ->
asyncReply.writeInt(result)
}
replyWriter
}
Content copied to clipboard
Parameters
requestId
The request ID of the request to reply to.
interfaceDescriptor
The binder interface descriptor.
transactionName
The name of the binder transaction that calls this method.
asyncReplyProvider
The async reply provider to invoke.