public static abstract class

ChannelClient.ChannelCallback

extends Object
java.lang.Object
   ↳ com.google.android.gms.wearable.ChannelClient.ChannelCallback

Class Overview

A callback which will be notified on changes to channels.

Summary

Constants
int CLOSE_REASON_DISCONNECTED Value passed to onChannelClosed(ChannelClient.Channel, int, int), onInputClosed(ChannelClient.Channel, int, int) and onOutputClosed(ChannelClient.Channel, int, int) when the closing is due to a remote node being disconnected.
int CLOSE_REASON_LOCAL_CLOSE Value passed to onChannelClosed(ChannelClient.Channel, int, int), onInputClosed(ChannelClient.Channel, int, int) and onOutputClosed(ChannelClient.Channel, int, int) when the stream is closed due to the local node calling close(Channel) or close(Channel, int).
int CLOSE_REASON_NORMAL Value passed to onInputClosed(ChannelClient.Channel, int, int) or onOutputClosed(ChannelClient.Channel, int, int) (but not onChannelClosed(ChannelClient.Channel, int, int)), when the stream was closed under normal conditions, e.g the whole file was read, or the OutputStream on the remote node was closed normally.
int CLOSE_REASON_REMOTE_CLOSE Value passed to onChannelClosed(ChannelClient.Channel, int, int), onInputClosed(ChannelClient.Channel, int, int) and onOutputClosed(ChannelClient.Channel, int, int) when the stream is closed due to the remote node calling close(Channel) or close(Channel, int).
Public Constructors
ChannelClient.ChannelCallback()
Public Methods
void onChannelClosed(ChannelClient.Channel channel, int closeReason, int appSpecificErrorCode)
Called when a channel is closed.
void onChannelOpened(ChannelClient.Channel channel)
Called when a new channel is opened by a remote node.
void onInputClosed(ChannelClient.Channel channel, int closeReason, int appSpecificErrorCode)
Called when the input side of a channel is closed.
void onOutputClosed(ChannelClient.Channel channel, int closeReason, int appSpecificErrorCode)
Called when the output side of a channel is closed.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int CLOSE_REASON_DISCONNECTED

Value passed to onChannelClosed(ChannelClient.Channel, int, int), onInputClosed(ChannelClient.Channel, int, int) and onOutputClosed(ChannelClient.Channel, int, int) when the closing is due to a remote node being disconnected.

Constant Value: 1 (0x00000001)

public static final int CLOSE_REASON_LOCAL_CLOSE

Value passed to onChannelClosed(ChannelClient.Channel, int, int), onInputClosed(ChannelClient.Channel, int, int) and onOutputClosed(ChannelClient.Channel, int, int) when the stream is closed due to the local node calling close(Channel) or close(Channel, int).

Constant Value: 3 (0x00000003)

public static final int CLOSE_REASON_NORMAL

Value passed to onInputClosed(ChannelClient.Channel, int, int) or onOutputClosed(ChannelClient.Channel, int, int) (but not onChannelClosed(ChannelClient.Channel, int, int)), when the stream was closed under normal conditions, e.g the whole file was read, or the OutputStream on the remote node was closed normally.

Constant Value: 0 (0x00000000)

public static final int CLOSE_REASON_REMOTE_CLOSE

Value passed to onChannelClosed(ChannelClient.Channel, int, int), onInputClosed(ChannelClient.Channel, int, int) and onOutputClosed(ChannelClient.Channel, int, int) when the stream is closed due to the remote node calling close(Channel) or close(Channel, int).

Constant Value: 2 (0x00000002)

Public Constructors

public ChannelClient.ChannelCallback ()

Public Methods

public void onChannelClosed (ChannelClient.Channel channel, int closeReason, int appSpecificErrorCode)

Called when a channel is closed. This can happen through an explicit call to close(Channel) or close(Channel, int) on either side of the connection, or due to disconnecting from the remote node.

Parameters
channel ChannelClient.Channel
closeReason int: the reason for the channel closing. One of CLOSE_REASON_DISCONNECTED, CLOSE_REASON_REMOTE_CLOSE, or CLOSE_REASON_LOCAL_CLOSE.
appSpecificErrorCode int: the error code specified on close(GoogleApiClient), or 0 if closeReason is CLOSE_REASON_DISCONNECTED.

public void onChannelOpened (ChannelClient.Channel channel)

Called when a new channel is opened by a remote node.

Parameters
channel ChannelClient.Channel

public void onInputClosed (ChannelClient.Channel channel, int closeReason, int appSpecificErrorCode)

Called when the input side of a channel is closed.

Parameters
channel ChannelClient.Channel
closeReason int: the reason for the input closing. One of CLOSE_REASON_DISCONNECTED, CLOSE_REASON_REMOTE_CLOSE, CLOSE_REASON_LOCAL_CLOSE, or CLOSE_REASON_NORMAL
appSpecificErrorCode int: the error code specified on close(GoogleApiClient), or 0 if closeReason is CLOSE_REASON_DISCONNECTED or CLOSE_REASON_NORMAL.

public void onOutputClosed (ChannelClient.Channel channel, int closeReason, int appSpecificErrorCode)

Called when the output side of a channel is closed.

Parameters
channel ChannelClient.Channel
closeReason int: the reason for the output closing. One of CLOSE_REASON_DISCONNECTED, CLOSE_REASON_REMOTE_CLOSE, CLOSE_REASON_LOCAL_CLOSE, or CLOSE_REASON_NORMAL
appSpecificErrorCode int: the error code specified on close(GoogleApiClient), or 0 if closeReason is CLOSE_REASON_DISCONNECTED or CLOSE_REASON_NORMAL.