AddonSessionHandler

@PublicApi
public interface AddonSessionHandler



外掛程式應用程式針對工作階段提供的回呼。

摘要

巢狀類型

說明觸發 onSessionEnded 回呼的原因。

說明在外掛程式工作階段中,參與者分配或撤銷的權限。

公用方法

default void

接收外掛程式工作階段的協作開始狀態。

default void

接收最新的權限狀態,以便定義使用者如何參與外掛程式工作階段。

abstract void

回應外掛程式工作階段的結束時間。

公用方法

onCollaborationStartingStateUpdate

default void onCollaborationStartingStateUpdate(
    CollaborationStartingState collaborationStartingState
)

接收外掛程式工作階段的協作開始狀態。

外掛程式需要具體實作,才能支援協作啟動狀態。

onParticipantPrivilegeChanged

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

接收最新的權限狀態,以便定義使用者如何參與外掛程式工作階段。

外掛程式需要具體實作,才能支援主機控制項。

onSessionEnded

abstract void onSessionEnded(AddonSessionHandler.EndReason endReason)

回應外掛程式工作階段的結束時間。

  1. 除非使用這個處理常式例項建構新的 AddonSession,否則這個處理常式不會收到其他呼叫。
  2. SDK 會自行清除。不需要額外呼叫 endSession

導入範例:

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;
}
參數
AddonSessionHandler.EndReason endReason

工作階段結束的原因