SessionRemoteConnection
@RequiresApi(value = 26) interface SessionRemoteConnection
A connection to a remote device that is participating in a Session. This is a wrapper around RemoteConnection updated to be specific to SessionParticipant.
Summary
Public fields |
|
|---|---|
abstract @NonNull SessionParticipant |
The participant this this is a connection to. |
Public methods |
|
|---|---|
abstract void |
registerReceiver(@NonNull SessionConnectionReceiver receiver)Registers the given |
abstract @NonNull Result<Unit> |
|
abstract @NonNull ListenableFuture<Void> |
sendFuture(@NonNull byte[] bytes)Java-compatible version of |
abstract void |
unregisterReceiver(@NonNull SessionConnectionReceiver receiver)Unregisters a given receiver from the remote device. |
Public fields
participant
abstract @NonNull SessionParticipant participant
The participant this this is a connection to.
Public methods
registerReceiver
abstract void registerReceiver(@NonNull SessionConnectionReceiver receiver)
Registers the given SessionConnectionReceiver with this channel.
| Throws | |
|---|---|
com.google.ambient.crossdevice.connections.ConnectionsException com.google.ambient.crossdevice.connections.ConnectionsException |
if the connection is closed. |
sendFuture
abstract @NonNull ListenableFuture<Void> sendFuture(@NonNull byte[] bytes)
Java-compatible version of send.
unregisterReceiver
abstract void unregisterReceiver(@NonNull SessionConnectionReceiver receiver)
Unregisters a given receiver from the remote device.