CoDoingClient

@PublicApi
interface CoDoingClient


Represents a co-doing session.

Summary

Constants

const Int

Maximum allowed blob size in bytes.

const Int

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

Public functions

Unit
setGlobalState(newGlobalState: CoDoingState!)

Updates the shared global state.

Constants

MAX_CODOING_BLOB_BYTES

const val MAX_CODOING_BLOB_BYTES = 16384: Int

Maximum allowed blob size in bytes.

PREFERRED_MAX_CODOING_BLOB_BYTES

const val PREFERRED_MAX_CODOING_BLOB_BYTES = 1024: Int

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

Public functions

setGlobalState

fun setGlobalState(newGlobalState: CoDoingState!): Unit

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
newGlobalState: CoDoingState!

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