Stay organized with collections Save and categorize content based on your preferences.

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 fields

abstract @NonNull SessionId

SessionId this TransferrableSession belongs to.

Public methods

abstract void

Cancels the transfer.

abstract @NonNull ListenableFuture<Unit>

Java-compatible version of cancelTransfer.

abstract @NonNull SessionRemoteConnection

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

Public fields

sessionId

abstract @NonNull SessionId sessionId

SessionId this TransferrableSession belongs to.

Public methods

cancelTransfer

abstract void cancelTransfer()

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

abstract @NonNull ListenableFuture<UnitcancelTransferFuture()

Java-compatible version of cancelTransfer.

getStartupRemoteConnection

abstract @NonNull SessionRemoteConnection getStartupRemoteConnection()

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

Returns
@NonNull 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.