# Sessions

# Sessions

*** ** * ** ***

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

<br />

```
@RequiresApi(value = 26) interface Sessions
```

<br />

*** ** * ** ***

Entry-point for creating and interacting with Sessions. Create a client by calling[Sessions.create](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/Sessions.Companion#create(android.content.Context)).

## Summary

|                                                          ### Nested types                                                          ||
|---------------------------------------------------------------------------------------------------------------------------------|---|
| [Sessions.Companion](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/Sessions.Companion) |   |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               ### Public functions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [SessionId](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionId)                                                                                                                                              | [createSession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/Sessions#createSession(com.google.ambient.crossdevice.sessions.ApplicationSessionTag))`(applicationSessionTag: `[ApplicationSessionTag](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/ApplicationSessionTag)`?)` Creates a Session which can be be transferred to or shared with another device.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `suspend `[ReceivingSession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/ReceivingSession)                                                                                                                      | [getReceivingSession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/Sessions#getReceivingSession(android.content.Intent,com.google.ambient.crossdevice.sessions.ReceivingSessionStateCallback))`(` ` intent: `[Intent](https://developer.android.com/reference/kotlin/android/content/Intent)`,` ` callback: `[ReceivingSessionStateCallback](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/ReceivingSessionStateCallback) `)` Receives a[ReceivingSession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/ReceivingSession)to transfer a Session to this device.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| [ListenableFuture](https://developer.android.com/reference/kotlin/com/google/common/util/concurrent/ListenableFuture)`<`[ReceivingSession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/ReceivingSession)`>`     | [getReceivingSessionFuture](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/Sessions#getReceivingSessionFuture(android.content.Intent,com.google.ambient.crossdevice.sessions.ReceivingSessionStateCallback))`(` ` intent: `[Intent](https://developer.android.com/reference/kotlin/android/content/Intent)`,` ` callback: `[ReceivingSessionStateCallback](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/ReceivingSessionStateCallback) `)` Java-compatible version of[getReceivingSession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/Sessions#getReceivingSession(android.content.Intent,com.google.ambient.crossdevice.sessions.ReceivingSessionStateCallback)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `suspend `[SecondarySession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SecondarySession)                                                                                                                      | [getSecondarySession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/Sessions#getSecondarySession(android.content.Intent,com.google.ambient.crossdevice.sessions.SecondarySessionStateCallback))`(` ` intent: `[Intent](https://developer.android.com/reference/kotlin/android/content/Intent)`,` ` callback: `[SecondarySessionStateCallback](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SecondarySessionStateCallback) `)` Receives a[SecondarySession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SecondarySession)to join a Session from this device.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [ListenableFuture](https://developer.android.com/reference/kotlin/com/google/common/util/concurrent/ListenableFuture)`<`[SecondarySession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SecondarySession)`>`     | [getSecondarySessionFuture](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/Sessions#getSecondarySessionFuture(android.content.Intent,com.google.ambient.crossdevice.sessions.SecondarySessionStateCallback))`(` ` intent: `[Intent](https://developer.android.com/reference/kotlin/android/content/Intent)`,` ` callback: `[SecondarySessionStateCallback](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SecondarySessionStateCallback) `)` Java-compatible version of[getSecondarySession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/Sessions#getSecondarySession(android.content.Intent,com.google.ambient.crossdevice.sessions.SecondarySessionStateCallback)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [Unit](https://developer.android.com/reference/kotlin/kotlin/Unit)                                                                                                                                                                                         | [registerActivityResultCaller](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/Sessions#registerActivityResultCaller(androidx.activity.result.ActivityResultCaller))`(` ` activityResultCaller: `[ActivityResultCaller](https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultCaller) `)` Registers an[ActivityResultCaller](https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultCaller)to enable Sessions to show available devices via Discovery's device launcher.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `suspend `[Unit](https://developer.android.com/reference/kotlin/kotlin/Unit)                                                                                                                                                                               | [removeSession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/Sessions#removeSession(com.google.ambient.crossdevice.sessions.SessionId))`(sessionId: `[SessionId](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionId)`)` Removes a Session so that it can no longer be discovered by other devices requesting transfer or share.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| [ListenableFuture](https://developer.android.com/reference/kotlin/com/google/common/util/concurrent/ListenableFuture)`<`[Void](https://developer.android.com/reference/kotlin/java/lang/Void)`?>`                                                          | [removeSessionFuture](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/Sessions#removeSessionFuture(com.google.ambient.crossdevice.sessions.SessionId))`(sessionId: `[SessionId](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionId)`)` Java-compatible version of[removeSession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/Sessions#removeSession(com.google.ambient.crossdevice.sessions.SessionId)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `suspend `[PrimarySession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/PrimarySession)                                                                                                                          | [shareSession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/Sessions#shareSession(com.google.ambient.crossdevice.sessions.SessionId,com.google.ambient.crossdevice.wakeup.StartComponentRequest,kotlin.collections.List,com.google.ambient.crossdevice.sessions.PrimarySessionStateCallback))`(` ` sessionId: `[SessionId](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionId)`,` ` startComponentRequest: `[StartComponentRequest](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/wakeup/StartComponentRequest)`,` ` deviceFilters: `[List](https://developer.android.com/reference/kotlin/kotlin/collections/List)`<`[DeviceFilter](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/discovery/DeviceFilter)`>,` ` callback: `[PrimarySessionStateCallback](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/PrimarySessionStateCallback) `)` Invites another device to join a Session currently running on the device this function is called on.                                                                                                                                                                                                                                                                                                       |
| [ListenableFuture](https://developer.android.com/reference/kotlin/com/google/common/util/concurrent/ListenableFuture)`<`[PrimarySession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/PrimarySession)`>`         | [shareSessionFuture](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/Sessions#shareSessionFuture(com.google.ambient.crossdevice.sessions.SessionId,com.google.ambient.crossdevice.wakeup.StartComponentRequest,kotlin.collections.List,com.google.ambient.crossdevice.sessions.PrimarySessionStateCallback))`(` ` sessionId: `[SessionId](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionId)`,` ` startComponentRequest: `[StartComponentRequest](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/wakeup/StartComponentRequest)`,` ` deviceFilters: `[List](https://developer.android.com/reference/kotlin/kotlin/collections/List)`<`[DeviceFilter](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/discovery/DeviceFilter)`>,` ` callback: `[PrimarySessionStateCallback](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/PrimarySessionStateCallback) `)` Java-compatible version of[shareSession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/Sessions#shareSession(com.google.ambient.crossdevice.sessions.SessionId,com.google.ambient.crossdevice.wakeup.StartComponentRequest,kotlin.collections.List,com.google.ambient.crossdevice.sessions.PrimarySessionStateCallback)).                             |
| `suspend `[OriginatingSession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/OriginatingSession)                                                                                                                  | [transferSession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/Sessions#transferSession(com.google.ambient.crossdevice.sessions.SessionId,com.google.ambient.crossdevice.wakeup.StartComponentRequest,kotlin.collections.List,com.google.ambient.crossdevice.sessions.OriginatingSessionStateCallback))`(` ` sessionId: `[SessionId](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionId)`,` ` startComponentRequest: `[StartComponentRequest](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/wakeup/StartComponentRequest)`,` ` deviceFilters: `[List](https://developer.android.com/reference/kotlin/kotlin/collections/List)`<`[DeviceFilter](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/discovery/DeviceFilter)`>,` ` callback: `[OriginatingSessionStateCallback](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/OriginatingSessionStateCallback) `)` Transfers a Session from the device this function is called on to another.                                                                                                                                                                                                                                                                                                               |
| [ListenableFuture](https://developer.android.com/reference/kotlin/com/google/common/util/concurrent/ListenableFuture)`<`[OriginatingSession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/OriginatingSession)`>` | [transferSessionFuture](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/Sessions#transferSessionFuture(com.google.ambient.crossdevice.sessions.SessionId,com.google.ambient.crossdevice.wakeup.StartComponentRequest,kotlin.collections.List,com.google.ambient.crossdevice.sessions.OriginatingSessionStateCallback))`(` ` sessionId: `[SessionId](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionId)`,` ` startComponentRequest: `[StartComponentRequest](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/wakeup/StartComponentRequest)`,` ` deviceFilters: `[List](https://developer.android.com/reference/kotlin/kotlin/collections/List)`<`[DeviceFilter](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/discovery/DeviceFilter)`>,` ` callback: `[OriginatingSessionStateCallback](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/OriginatingSessionStateCallback) `)` Java-compatible version of[transferSession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/Sessions#transferSession(com.google.ambient.crossdevice.sessions.SessionId,com.google.ambient.crossdevice.wakeup.StartComponentRequest,kotlin.collections.List,com.google.ambient.crossdevice.sessions.OriginatingSessionStateCallback)). |

## Public functions

### createSession

```
fun createSession(applicationSessionTag: ApplicationSessionTag? = null): SessionId
```

Creates a Session which can be be transferred to or shared with another device. Returns the[SessionId](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionId)associated with that Session.  

|                                                                                                                                         Parameters                                                                                                                                          ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------|
| `applicationSessionTag: `[ApplicationSessionTag](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/ApplicationSessionTag)`? = null` | A client-defined concept that optionally describes the high level type of experience for a Session within an app. |

### getReceivingSession

```
suspend fun getReceivingSession(
    intent: Intent,
    callback: ReceivingSessionStateCallback
): ReceivingSession
```

Receives a[ReceivingSession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/ReceivingSession)to transfer a Session to this device. Should be called from receiving device after app is launched by D2DI with an intent specified by the originating device.

App should pass the[intent](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/Sessions#getReceivingSession(android.content.Intent,com.google.ambient.crossdevice.sessions.ReceivingSessionStateCallback))it was launched with as a parameter.  

|                                                                                                                                  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 unable to return a`ReceivingSession`. |

### getReceivingSessionFuture

```
fun getReceivingSessionFuture(
    intent: Intent,
    callback: ReceivingSessionStateCallback
): ListenableFuture<ReceivingSession>
```

Java-compatible version of[getReceivingSession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/Sessions#getReceivingSession(android.content.Intent,com.google.ambient.crossdevice.sessions.ReceivingSessionStateCallback)).  

### getSecondarySession

```
suspend fun getSecondarySession(
    intent: Intent,
    callback: SecondarySessionStateCallback
): SecondarySession
```

Receives a[SecondarySession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SecondarySession)to join a Session from this device. Should be called from receiving device after app is launched by D2DI with an intent specified by the originating device.

App should pass the[intent](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/Sessions#getSecondarySession(android.content.Intent,com.google.ambient.crossdevice.sessions.SecondarySessionStateCallback))it was launched with as a parameter.  

|                                                                                                                                  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 unable to return a`SecondarySession`. |

### getSecondarySessionFuture

```
fun getSecondarySessionFuture(
    intent: Intent,
    callback: SecondarySessionStateCallback
): ListenableFuture<SecondarySession>
```

Java-compatible version of[getSecondarySession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/Sessions#getSecondarySession(android.content.Intent,com.google.ambient.crossdevice.sessions.SecondarySessionStateCallback)).  

### registerActivityResultCaller

```
fun registerActivityResultCaller(
    activityResultCaller: ActivityResultCaller
): Unit
```

Registers an[ActivityResultCaller](https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultCaller)to enable Sessions to show available devices via Discovery's device launcher.  

### removeSession

```
suspend fun removeSession(sessionId: SessionId): Unit
```

Removes a Session so that it can no longer be discovered by other devices requesting transfer or share. If remove fails, a[SessionException](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionException)will be thrown.

This will cancel any ongoing requests for transfer/share ( SessionStateCallback.onTransferFailure, SessionStateCallback.onShareFailure). This will terminate any active shared sessions (Primary and Secondaries will be cleaned up -[PrimarySessionStateCallback.onPrimarySessionCleanup](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/PrimarySessionStateCallback#onPrimarySessionCleanup(com.google.ambient.crossdevice.sessions.SessionId)),[SecondarySessionStateCallback.onSecondarySessionCleanup](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SecondarySessionStateCallback#onSecondarySessionCleanup(com.google.ambient.crossdevice.sessions.SessionId))).  

### removeSessionFuture

```
fun removeSessionFuture(sessionId: SessionId): ListenableFuture<Void?>
```

Java-compatible version of[removeSession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/Sessions#removeSession(com.google.ambient.crossdevice.sessions.SessionId)).  

### shareSession

```
suspend fun shareSession(
    sessionId: SessionId,
    startComponentRequest: StartComponentRequest,
    deviceFilters: List<DeviceFilter>,
    callback: PrimarySessionStateCallback
): PrimarySession
```

Invites another device to join a Session currently running on the device this function is called on.

Opens a dialog that searches for compatible, trusted devices. When the user selects a specific device, the receiving app on that device will receive the request to join the session via[StartComponentRequest](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/wakeup/StartComponentRequest)and can begin initialization (see[SecondarySession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SecondarySession)).[StartComponentRequest](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/wakeup/StartComponentRequest)must contain an action and a user-visible reason for the request, and can optionally contain extras.

If the share cannot be initiated, a[SessionException](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionException)will be thrown.

If the receiving app is ready to accept the share request,[PrimarySessionStateCallback.onParticipantJoined](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/PrimarySessionStateCallback#onParticipantJoined(com.google.ambient.crossdevice.sessions.SessionId,com.google.ambient.crossdevice.sessions.SessionParticipant))is triggered. Otherwise,[PrimarySessionStateCallback.onShareFailureWithParticipant](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/PrimarySessionStateCallback#onShareFailureWithParticipant(com.google.ambient.crossdevice.sessions.SessionId,com.google.ambient.crossdevice.sessions.SessionException,com.google.ambient.crossdevice.sessions.SessionParticipant))is triggered.

Once devices are selected,[PrimarySessionStateCallback.onShareInitiated](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/PrimarySessionStateCallback#onShareInitiated(com.google.ambient.crossdevice.sessions.SessionId,kotlin.Int))will be called to inform the application of the number of potential participants.  

### shareSessionFuture

```
fun shareSessionFuture(
    sessionId: SessionId,
    startComponentRequest: StartComponentRequest,
    deviceFilters: List<DeviceFilter>,
    callback: PrimarySessionStateCallback
): ListenableFuture<PrimarySession>
```

Java-compatible version of[shareSession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/Sessions#shareSession(com.google.ambient.crossdevice.sessions.SessionId,com.google.ambient.crossdevice.wakeup.StartComponentRequest,kotlin.collections.List,com.google.ambient.crossdevice.sessions.PrimarySessionStateCallback)).  

### transferSession

```
suspend fun transferSession(
    sessionId: SessionId,
    startComponentRequest: StartComponentRequest,
    deviceFilters: List<DeviceFilter>,
    callback: OriginatingSessionStateCallback
): OriginatingSession
```

Transfers a Session from the device this function is called on to another.

Opens a window that searches for compatible, trusted devices. When the user selects a specific device, the receiving app on that device will receive the request to transfer via[StartComponentRequest](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/wakeup/StartComponentRequest)and can begin initialization (see[ReceivingSession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/ReceivingSession)).[StartComponentRequest](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/wakeup/StartComponentRequest)must contain an action and a user-visible reason for the request, and can optionally contain extras.

If transfer cannot be initiated, a[SessionException](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionException)will be thrown.

If receiving app is ready to accept the transfer,[OriginatingSessionStateCallback.onConnected](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/OriginatingSessionStateCallback#onConnected(com.google.ambient.crossdevice.sessions.SessionId))is triggered. Otherwise,[OriginatingSessionStateCallback.onTransferFailure](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/OriginatingSessionStateCallback#onTransferFailure(com.google.ambient.crossdevice.sessions.SessionId,com.google.ambient.crossdevice.sessions.SessionException))is triggered.  

### transferSessionFuture

```
fun transferSessionFuture(
    sessionId: SessionId,
    startComponentRequest: StartComponentRequest,
    deviceFilters: List<DeviceFilter>,
    callback: OriginatingSessionStateCallback
): ListenableFuture<OriginatingSession>
```

Java-compatible version of[transferSession](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/Sessions#transferSession(com.google.ambient.crossdevice.sessions.SessionId,com.google.ambient.crossdevice.wakeup.StartComponentRequest,kotlin.collections.List,com.google.ambient.crossdevice.sessions.OriginatingSessionStateCallback)).