AddonSessionHandler

@PublicApi
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 functions

Unit
onCollaborationStartingStateUpdate(
    collaborationStartingState: CollaborationStartingState!
)

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

Unit

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

Unit

Responds to the end of the add-on session.

Public functions

onCollaborationStartingStateUpdate

fun onCollaborationStartingStateUpdate(
    collaborationStartingState: CollaborationStartingState!
): Unit

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

fun onParticipantPrivilegeChanged(
    privileges: (Mutable)List<AddonSessionHandler.Privilege!>!,
    disabledPrivileges: (Mutable)List<AddonSessionHandler.Privilege!>!
): Unit

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

fun onSessionEnded(endReason: AddonSessionHandler.EndReason!): Unit

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
endReason: AddonSessionHandler.EndReason!

the reason the session ended