CastRemoteDisplayLocalService.Callbacks

public static interface CastRemoteDisplayLocalService.Callbacks

Callbacks for the Cast Remote Display session initiated using CastRemoteDisplayLocalService.

Public Method Summary

abstract void
onRemoteDisplayMuteStateChanged(boolean isMuted)
Called when the Cast Remote Display session's audio mute state is changed.
abstract void
onRemoteDisplaySessionEnded(CastRemoteDisplayLocalService service)
Called when the Cast Remote Display session has been ended.
abstract void
onRemoteDisplaySessionError(Status status)
Called when the Cast Remote Display session could not be successfully created.
abstract void
onRemoteDisplaySessionStarted(CastRemoteDisplayLocalService service)
Called when the Cast Remote Display session has been successfully created.
abstract void
onServiceCreated(CastRemoteDisplayLocalService service)
Called when the local service has been created.

Public Methods

public abstract void onRemoteDisplayMuteStateChanged (boolean isMuted)

Called when the Cast Remote Display session's audio mute state is changed. The Remote Display session might be muted when the app is backgrounded.

Parameters
isMuted the value true indicating that the Cast Remote Display is muted

public abstract void onRemoteDisplaySessionEnded (CastRemoteDisplayLocalService service)

Called when the Cast Remote Display session has been ended. It will be called to provide session information and trigger detections when the session stops.

Parameters
service This instance of the service.

public abstract void onRemoteDisplaySessionError (Status status)

Called when the Cast Remote Display session could not be successfully created.

Parameters
status The reason why an error occurred establishing the Cast Remote Display session. The possible set of error codes are CastStatusCodes.ERROR_SERVICE_CREATION_FAILED and CastStatusCodes.ERROR_SERVICE_DISCONNECTED.

public abstract void onRemoteDisplaySessionStarted (CastRemoteDisplayLocalService service)

Called when the Cast Remote Display session has been successfully created. It will be called before the invoking CastRemoteDisplayLocalService.onCreatePresentation(Display). In this way, the service could be configured (if needed) before the CastPresentation is started.

Parameters
service This instance of the service.

public abstract void onServiceCreated (CastRemoteDisplayLocalService service)

Called when the local service has been created. In most scenarios applications can simply ignore this callback. However, for optimization reasons, some applications may want to start some initialization in the context of the local service as soon as it is created, while the Cast Remote Display session is still starting. Another possible use case is updating the custom notification with a notification that uses the service context.

Parameters
service This instance of the service.