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 functions
Public properties
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# TransferrableSession\n====================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/com/google/ambient/crossdevice/sessions/TransferrableSession \"View this page in Java\")\n\n\n```\n@RequiresApi(value = 26) interface TransferrableSession\n```\n\n\u003cbr /\u003e\n\nKnown direct subclasses \n[OriginatingSession](/reference/kotlin/com/google/ambient/crossdevice/sessions/OriginatingSession), [ReceivingSession](/reference/kotlin/com/google/ambient/crossdevice/sessions/ReceivingSession) \n\n|----------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|\n| [OriginatingSession](/reference/kotlin/com/google/ambient/crossdevice/sessions/OriginatingSession) | Describes a Session that is in the process of being transferred to another device. |\n| [ReceivingSession](/reference/kotlin/com/google/ambient/crossdevice/sessions/ReceivingSession) | Describes a Session that is in the process of being transferred to another device. |\n\n*** ** * ** ***\n\nDescribes methods that are common to both originating and receiving sides of a Session transfer.\n\nSummary\n-------\n\n| ### Public functions ||\n|-------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `suspend `[Unit](/reference/kotlin/kotlin/Unit) | [cancelTransfer](/reference/kotlin/com/google/ambient/crossdevice/sessions/TransferrableSession#cancelTransfer())`()` Cancels the transfer. |\n| [ListenableFuture](/reference/kotlin/com/google/common/util/concurrent/ListenableFuture)`\u003c`[Unit](/reference/kotlin/kotlin/Unit)`\u003e` | [cancelTransferFuture](/reference/kotlin/com/google/ambient/crossdevice/sessions/TransferrableSession#cancelTransferFuture())`()` Java-compatible version of [cancelTransfer](/reference/kotlin/com/google/ambient/crossdevice/sessions/TransferrableSession#cancelTransfer()). |\n| [SessionRemoteConnection](/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionRemoteConnection) | [getStartupRemoteConnection](/reference/kotlin/com/google/ambient/crossdevice/sessions/TransferrableSession#getStartupRemoteConnection())`()` Gets communication channel to send initialization messages back and forth between the originating and receiving device. |\n\n| ### Public properties ||\n|----------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [SessionId](/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionId) | [sessionId](/reference/kotlin/com/google/ambient/crossdevice/sessions/TransferrableSession#sessionId()) [SessionId](/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionId) this [TransferrableSession](/reference/kotlin/com/google/ambient/crossdevice/sessions/TransferrableSession) belongs to. |\n\nPublic functions\n----------------\n\n### cancelTransfer\n\n```\nsuspend fun cancelTransfer(): Unit\n```\n\nCancels the transfer. After this call, all methods will throw [SessionException](/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionException) with [HANDLE_INVALIDATED](/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionException.Companion#HANDLE_INVALIDATED()). \n\n| Throws ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|\n| `com.google.ambient.crossdevice.sessions.SessionException: `[com.google.ambient.crossdevice.sessions.SessionException](/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionException) | if the transfer cannot be cancelled for any reason. |\n\n### cancelTransferFuture\n\n```\nfun cancelTransferFuture(): ListenableFuture\u003cUnit\u003e\n```\n\nJava-compatible version of [cancelTransfer](/reference/kotlin/com/google/ambient/crossdevice/sessions/TransferrableSession#cancelTransfer()). \n\n### getStartupRemoteConnection\n\n```\nfun getStartupRemoteConnection(): SessionRemoteConnection\n```\n\nGets communication channel to send initialization messages back and forth between the originating and receiving device. \n\n| Returns ||\n|--------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|\n| [SessionRemoteConnection](/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionRemoteConnection) | The [SessionRemoteConnection](/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionRemoteConnection) relevant to the transfer. |\n\n| Throws ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------|\n| `com.google.ambient.crossdevice.sessions.SessionException: `[com.google.ambient.crossdevice.sessions.SessionException](/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionException) | if this session has already completed. |\n\nPublic properties\n-----------------\n\n### sessionId\n\n```\nval sessionId: SessionId\n```\n\n[SessionId](/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionId) this [TransferrableSession](/reference/kotlin/com/google/ambient/crossdevice/sessions/TransferrableSession) belongs to."]]