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
Public methods
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\n[Kotlin](/reference/kotlin/com/google/ambient/crossdevice/sessions/TransferrableSession \"View this page in Kotlin\") \\|Java\n\n\n```\n@RequiresApi(value = 26) interface TransferrableSession\n```\n\n\u003cbr /\u003e\n\nKnown direct subclasses \n[OriginatingSession](/reference/com/google/ambient/crossdevice/sessions/OriginatingSession), [ReceivingSession](/reference/com/google/ambient/crossdevice/sessions/ReceivingSession) \n\n|---------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|\n| [OriginatingSession](/reference/com/google/ambient/crossdevice/sessions/OriginatingSession) | Describes a Session that is in the process of being transferred to another device. |\n| [ReceivingSession](/reference/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 fields ||\n|-------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `abstract @`[NonNull](/reference/androidx/annotation/NonNull)` `[SessionId](/reference/com/google/ambient/crossdevice/sessions/SessionId) | [sessionId](/reference/com/google/ambient/crossdevice/sessions/TransferrableSession#sessionId()) [SessionId](/reference/com/google/ambient/crossdevice/sessions/SessionId) this [TransferrableSession](/reference/com/google/ambient/crossdevice/sessions/TransferrableSession) belongs to. |\n\n| ### Public methods ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `abstract void` | [cancelTransfer](/reference/com/google/ambient/crossdevice/sessions/TransferrableSession#cancelTransfer())`()` Cancels the transfer. |\n| `abstract @`[NonNull](/reference/androidx/annotation/NonNull)` `[ListenableFuture](/reference/com/google/common/util/concurrent/ListenableFuture)`\u003c`[Unit](/reference/kotlin/Unit)`\u003e` | [cancelTransferFuture](/reference/com/google/ambient/crossdevice/sessions/TransferrableSession#cancelTransferFuture())`()` Java-compatible version of [cancelTransfer](/reference/com/google/ambient/crossdevice/sessions/TransferrableSession#cancelTransfer()). |\n| `abstract @`[NonNull](/reference/androidx/annotation/NonNull)` `[SessionRemoteConnection](/reference/com/google/ambient/crossdevice/sessions/SessionRemoteConnection) | [getStartupRemoteConnection](/reference/com/google/ambient/crossdevice/sessions/TransferrableSession#getStartupRemoteConnection())`()` Gets communication channel to send initialization messages back and forth between the originating and receiving device. |\n\nPublic fields\n-------------\n\n### sessionId\n\n```\nabstract @NonNull SessionId sessionId\n```\n\n[SessionId](/reference/com/google/ambient/crossdevice/sessions/SessionId) this [TransferrableSession](/reference/com/google/ambient/crossdevice/sessions/TransferrableSession) belongs to.\n\nPublic methods\n--------------\n\n### cancelTransfer\n\n```\nabstract void cancelTransfer()\n```\n\nCancels the transfer. After this call, all methods will throw [SessionException](/reference/com/google/ambient/crossdevice/sessions/SessionException) with [HANDLE_INVALIDATED](/reference/com/google/ambient/crossdevice/sessions/SessionException.Companion#HANDLE_INVALIDATED()). \n\n| Throws ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|\n| [com.google.ambient.crossdevice.sessions.SessionException](/reference/com/google/ambient/crossdevice/sessions/SessionException)` com.google.ambient.crossdevice.sessions.SessionException` | if the transfer cannot be cancelled for any reason. |\n\n### cancelTransferFuture\n\n```\nabstract @NonNull ListenableFuture\u003cUnit\u003e cancelTransferFuture()\n```\n\nJava-compatible version of [cancelTransfer](/reference/com/google/ambient/crossdevice/sessions/TransferrableSession#cancelTransfer()). \n\n### getStartupRemoteConnection\n\n```\nabstract @NonNull SessionRemoteConnection getStartupRemoteConnection()\n```\n\nGets communication channel to send initialization messages back and forth between the originating and receiving device. \n\n| Returns ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|\n| `@`[NonNull](/reference/androidx/annotation/NonNull)` `[SessionRemoteConnection](/reference/com/google/ambient/crossdevice/sessions/SessionRemoteConnection) | The [SessionRemoteConnection](/reference/com/google/ambient/crossdevice/sessions/SessionRemoteConnection) relevant to the transfer. |\n\n| Throws ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------|\n| [com.google.ambient.crossdevice.sessions.SessionException](/reference/com/google/ambient/crossdevice/sessions/SessionException)` com.google.ambient.crossdevice.sessions.SessionException` | if this session has already completed. |"]]