# OriginatingSession

# OriginatingSession

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/OriginatingSession "View this page in Java")

<br />

```
@RequiresApi(value = 26) interface OriginatingSession : TransferrableSession
```

<br />

*** ** * ** ***

Describes a Session that is in the process of being transferred to another device. The originating side of the Session transfer will use this class to initialize the application.

## Summary

|                                                                                                                                                                                                            ### Public functions                                                                                                                                                                                                             ||
|-------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [SessionRemoteConnection](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionRemoteConnection) | [getStartupRemoteConnection](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/OriginatingSession#getStartupRemoteConnection())`()` Gets communication channel to send initialization messages back and forth between the originating and receiving device. |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     ### Inherited functions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| From class[com.google.ambient.crossdevice.sessions.TransferrableSession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/TransferrableSession) |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `suspend `[Unit](https://developer.android.com/reference/kotlin/kotlin/Unit)                                                                                                                  | [cancelTransfer](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/TransferrableSession#cancelTransfer())`()` Cancels the transfer.                                                                                                                                                                 | | [ListenableFuture](https://developer.android.com/reference/kotlin/com/google/common/util/concurrent/ListenableFuture)`<`[Unit](https://developer.android.com/reference/kotlin/kotlin/Unit)`>` | [cancelTransferFuture](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/TransferrableSession#cancelTransferFuture())`()` Java-compatible version of[cancelTransfer](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/TransferrableSession#cancelTransfer()). | |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ### Inherited properties                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| From class[com.google.ambient.crossdevice.sessions.TransferrableSession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/TransferrableSession) |---------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [SessionId](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionId) | [sessionId](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/TransferrableSession#sessionId()) [SessionId](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionId)this[TransferrableSession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/TransferrableSession)belongs to. | |

## Public functions

### getStartupRemoteConnection

```
fun getStartupRemoteConnection(): SessionRemoteConnection
```

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

|                                                                                                                                                     Returns                                                                                                                                                      ||
|-------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [SessionRemoteConnection](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionRemoteConnection) | The[SessionRemoteConnection](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionRemoteConnection)relevant to the transfer. |

|                                                                                                                                                                                                                                                                                                                                            Throws                                                                                                                                                                                                                                                                                                                                             ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `com.google.ambient.crossdevice.sessions.SessionException: `[com.google.ambient.crossdevice.sessions.SessionException](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionException) | if this session has already completed. This method will also throw an exception if it is called prior to the Session being ready for initialization. Applications will notify that they are ready for initialization in[OriginatingSessionStateCallback.onConnected](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/OriginatingSessionStateCallback#onConnected(com.google.ambient.crossdevice.sessions.SessionId)). |
| `com.google.ambient.crossdevice.sessions.SessionException: `[com.google.ambient.crossdevice.sessions.SessionException](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionException) | if this session has already completed.                                                                                                                                                                                                                                                                                                                                                                                                                       |