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

SecondarySession

@RequiresApi(value = 26) interface SecondarySession


When a Session becomes shared with one or more devices, this interface represents a secondary device (a device that has joined an existing Session).

Summary

Public functions

suspend Unit

Destroys the SecondarySession.

ListenableFuture<Void?>

Java-compatible version of destroySecondarySession.

SessionRemoteConnection

Gets communication channel to send messages to the primary of the Sessions.

Public properties

SessionId

SessionId this SecondarySession belongs to.

Public functions

destroySecondarySession

suspend fun destroySecondarySession(): Unit

Destroys the SecondarySession.

When a SecondarySession is destroyed, the connection with the Primary is terminated and this participant will leave the underlying Session.

Throws
com.google.ambient.crossdevice.sessions.SessionException: com.google.ambient.crossdevice.sessions.SessionException

if the SecondarySession object is no long valid.

destroySecondarySessionFuture

fun destroySecondarySessionFuture(): ListenableFuture<Void?>

Java-compatible version of destroySecondarySession.

getDefaultRemoteConnection

fun getDefaultRemoteConnection(): SessionRemoteConnection

Gets communication channel to send messages to the primary of the Sessions.

Throws
com.google.ambient.crossdevice.sessions.SessionException: com.google.ambient.crossdevice.sessions.SessionException

if the SecondarySession object is no long valid.

Public properties

sessionId

val sessionIdSessionId

SessionId this SecondarySession belongs to.