Package com.tomtom.ivi.platform.framework.api.ipc.binder

This module contains internal utilities related to Android's binder IPC mechanism.

Types

Link copied to clipboard
interface AggregatableBinderInterface<T>

Interface for binder interfaces that can be aggregated as part of other binder interfaces.

Link copied to clipboard
interface AsyncCapableBinderInterface : IInterface

Base interface for IBinder interfaces that require async replies.

Link copied to clipboard
typealias AsyncReplyProvider = suspend () -> AsyncReplyWriter

Lambda prototype that can provide a reply through the returned AsyncReplyWriter.

Link copied to clipboard
interface AsyncReplyReceiver : OneWayBinderInterface

Receives replies asynchronously over an IBinder interface.

Link copied to clipboard
typealias AsyncReplyWriter = (Parcel) -> Unit

A lambda that writes a reply to a the given Parcel.

Link copied to clipboard
data class AsyncRequestId(val id: Int) : RegistrationToken

Identifies an async request.

Link copied to clipboard
class BinderContext(    lifecycleOwner: LifecycleOwner,     val messageDispatchFailureListener: BinderMessageDispatchFailureListener,     val syncBinderTransactionScope: CoroutineScope? = null)

Groups some properties that are needed in the binder interface implementations.

Link copied to clipboard
fun interface BinderMessageDispatchFailureListener

Called when dispatching a binder transaction resulted in an Exception.

Link copied to clipboard
class KillableLifecycleOwner(parentLifecycleOwner: LifecycleOwner, mainScopeProvider: MainScopeProvider) : LifecycleOwner

LifecycleOwner which is destroyed when it catches a DeadObjectException.

Link copied to clipboard
typealias MainScopeProvider = (() -> Unit) -> Unit
Link copied to clipboard
interface OneWayBinderInterface : IInterface

Interface for binder interfaces that can use one way transaction.

Link copied to clipboard
abstract class RegistrationToken(val id: Int) : Parcelable

Base class for registration token.

Link copied to clipboard
class RegistrationTokenMap<T : RegistrationToken, V>(tokenFactory: (Int) -> T)

Utility class to generate unique tokens of type T and associate a value of type V to this token. Tokens are created by using the tokenFactory.

Link copied to clipboard
class RemoteCancellationException : CancellationException

Thrown when remote's BinderContext.mainCoroutineScope is cancelled while an async reply is pending.

Link copied to clipboard
typealias SequencedAction = () -> Unit
Link copied to clipboard
class SequencerReceiverHelper

Helper class for the receiving side on one way binder transactions.

Link copied to clipboard
class SequencerSenderHelper

The counter part of the SequencerReceiverHelper on the sender side.

Functions

Link copied to clipboard
inline fun <R> BinderMessageDispatchFailureListener.withMessageDispatchFailureListener(    interfaceDescriptor: String,     transactionName: String,     block: () -> R): R

Calls BinderMessageDispatchFailureListener.onFailure when block throws an Exception. Any caught exception is rethrown.