AddonSessionHandler

@PublicApi
public interface AddonSessionHandler



Callbacks provided by the add-on app for a session.

Summary

Nested types

Describes the reason the onSessionEnded callback was triggered.

Describes a privilege that is allocated or revoked from a participant in an add-on session.

Public methods

default void

Receives the latest state of collaboration starting state of the add-on session.

default void

Receives the latest state of privileges that defines how the user is allowed to participate in an add-on session.

abstract void

Responds to the end of the add-on session.

Public methods

onCollaborationStartingStateUpdate

default void onCollaborationStartingStateUpdate(
    CollaborationStartingState collaborationStartingState
)

Receives the latest state of collaboration starting state of the add-on session.

Concrete implementation is required for the add-on to support collaboration starting state.

onParticipantPrivilegeChanged

default void onParticipantPrivilegeChanged(
    List<AddonSessionHandler.Privilege> privileges,
    List<AddonSessionHandler.Privilege> disabledPrivileges
)

Receives the latest state of privileges that defines how the user is allowed to participate in an add-on session.

Concrete implementation is required for the add-on to support host controls.

onSessionEnded

abstract void onSessionEnded(AddonSessionHandler.EndReason endReason)

Responds to the end of the add-on session.

  1. This handler will receive no additional calls, unless a new AddonSession is constructed with this same handler instance.
  2. The SDK will clean itself up. No additional call to endSession is necessary.

Implementation example:

if (EndReason.SESSION_ENDED_UNEXPECTEDLY.equals(endReason)) {
  log("Something happened unexpectedly");
  // Display UI to user in case they want to reconnect.
  return;
}

if (EndReason.MEETING_ENDED_BY_USER.equals(endReason)) {
  // The meeting is disconnected because the user left the meeting. Perform some
  // cleanup, then exit.
  this.onMeetingDisconnected();
  return;
}

if (EndReason.SESSION_ENDED_BY_USER.equals(endReason)) {
  // Disconnected because the user left the session from the Meet application. However, the
  // conference is still active in Meet. Perform some cleanup, then listen for a possible
  // rejoin event.
  this.onSessionDisconnected();
  return;
}
Parameters
AddonSessionHandler.EndReason endReason

the reason the session ended