TransferrableSession


@RequiresApi(value = 26) interface TransferrableSession

Known direct subclasses
OriginatingSession

Describes a Session that is in the process of being transferred to another device.

ReceivingSession

Describes a Session that is in the process of being transferred to another device.


Describes methods that are common to both originating and receiving sides of a Session transfer.

Summary

Public functions

suspend Unit

Cancels the transfer.

ListenableFuture<Unit>

Java-compatible version of cancelTransfer.

SessionRemoteConnection

Gets communication channel to send initialization messages back and forth between the originating and receiving device.

Public properties

SessionId

SessionId this TransferrableSession belongs to.

Public functions

cancelTransfer

suspend fun cancelTransfer(): Unit

Cancels the transfer. After this call, all methods will throw SessionException with HANDLE_INVALIDATED.

Throws
com.google.ambient.crossdevice.sessions.SessionException: com.google.ambient.crossdevice.sessions.SessionException

if the transfer cannot be cancelled for any reason.

cancelTransferFuture

fun cancelTransferFuture(): ListenableFuture<Unit>

Java-compatible version of cancelTransfer.

getStartupRemoteConnection

fun getStartupRemoteConnection(): SessionRemoteConnection

Gets communication channel to send initialization messages back and forth between the originating and receiving device.

Returns
SessionRemoteConnection

The SessionRemoteConnection relevant to the transfer.

Throws
com.google.ambient.crossdevice.sessions.SessionException: com.google.ambient.crossdevice.sessions.SessionException

if this session has already completed.

Public properties

sessionId

val sessionIdSessionId

SessionId this TransferrableSession belongs to.