CoDoingClient

@PublicApi
public interface CoDoingClient



Represents a co-doing session.

Summary

Constants

default static final int

Maximum allowed blob size in bytes.

default static final int

Preferred maximum allowed blob size (1kb) in bytes.

Public methods

abstract void
setGlobalState(CoDoingState newGlobalState)

Updates the shared global state.

Constants

MAX_CODOING_BLOB_BYTES

default static final int MAX_CODOING_BLOB_BYTES = 16384

Maximum allowed blob size in bytes.

PREFERRED_MAX_CODOING_BLOB_BYTES

default static final int PREFERRED_MAX_CODOING_BLOB_BYTES = 1024

Preferred maximum allowed blob size (1kb) in bytes.

Public methods

setGlobalState

abstract void setGlobalState(CoDoingState newGlobalState)

Updates the shared global state. This state is broadcast to all other participants and becomes the default state for all participants, existing or new, until a new state is set.

Note: This shared state is eventually consistent across participants. For predictable behavior, this binary state should be complete state, not partial, as the Meet Add-on's SDK does not provide guarantees around the delivery of individual messages -- only eventual consistency.

Note: In a race condition where two participants call this method simultaneously, the Meet Add-on's SDK will select a canonical winning update. The losing update may or may not be applied to participants, but the winning update will always be applied later.

Parameters
CoDoingState newGlobalState

the updated activity state that will be broadcast to other participants. Preferred maximum blob size is PREFERRED_MAX_CODOING_BLOB_BYTES.

Throws
java.lang.NullPointerException

if newGlobalState is null

com.google.android.meet.addons.AddonException

if there was an unexpected error

java.lang.IllegalStateException

if called after the co-doing session has ended

java.lang.IllegalStateException

if blob size >MAX_CODOING_BLOB_BYTES