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 fields

abstract @NonNull SessionId

SessionId this SecondarySession belongs to.

Public methods

abstract void

Destroys the SecondarySession.

abstract @NonNull ListenableFuture<Void>

Java-compatible version of destroySecondarySession.

abstract @NonNull SessionRemoteConnection

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

Public fields

sessionId

abstract @NonNull SessionId sessionId

SessionId this SecondarySession belongs to.

Public methods

destroySecondarySession

abstract void destroySecondarySession()

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

abstract @NonNull ListenableFuture<VoiddestroySecondarySessionFuture()

Java-compatible version of destroySecondarySession.

getDefaultRemoteConnection

abstract @NonNull SessionRemoteConnection getDefaultRemoteConnection()

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.