AI-generated Key Takeaways
-
The
SessionManagerListenerinterface is used to monitor events of aSessioninstance, with all callbacks on the main thread. -
UIMediaControlleris a known indirect subclass that usesSessionManagerListenerto bind UI component states to a remoteCastSession. -
The interface includes methods to handle the lifecycle of a session, such as starting, starting, ending, and resuming, along with corresponding failure callbacks.
| Known Indirect Subclasses |
A listener interface for monitoring events of a particular type of Session
instance. All callbacks are called on the main thread.
Public Method Summary
| abstract void |
onSessionEnded(T session, int error)
Called when a
session has ended.
|
| abstract void |
onSessionEnding(T session)
Called when a
session is ending.
|
| abstract void |
onSessionResumeFailed(T session, int error)
Called when a previous saved
session failed to resume.
|
| abstract void |
onSessionResumed(T session, boolean wasSuspended)
Called when
session has been successfully resumed.
|
| abstract void | |
| abstract void |
onSessionStartFailed(T session, int error)
Called when a
session failed to start.
|
| abstract void | |
| abstract void |
onSessionStarting(T session)
Called when a
session is attempting to start.
|
| abstract void |
onSessionSuspended(T session, int reason)
Called when a
session has been suspended.
|
Public Methods
public abstract void onSessionEnded (T session, int error)
Called when a session has ended.
Parameters
| session | The Session. |
|---|---|
| error | The error code, one of CastStatusCodes. |
public abstract void onSessionEnding (T session)
Called when a session is ending.
Parameters
| session | The Session. |
|---|
public abstract void onSessionResumeFailed (T session, int error)
Called when a previous saved session failed to resume.
Parameters
| session | The Session. |
|---|---|
| error | The error code, one of CastStatusCodes. |
public abstract void onSessionResumed (T session, boolean wasSuspended)
Called when session has been successfully resumed. If
wasSuspended is true, then session is resumed
from the previous suspension. Otherwise it is resumed from the previous saved
session.
Parameters
| session | The Session. |
|---|---|
| wasSuspended | Is the session resumed from suspension. |
public abstract void onSessionResuming (T session, String sessionId)
Called when a session is attempting to resume.
Parameters
| session | The Session. |
|---|---|
| sessionId | ID of the started session. |
public abstract void onSessionStartFailed (T session, int error)
Called when a session failed to start.
Parameters
| session | The Session. |
|---|---|
| error | The error code of CastStatusCodes. |
public abstract void onSessionStarted (T session, String sessionId)
Called when a session has been successfully started.
Parameters
| session | The Session. |
|---|---|
| sessionId | ID of the started session. |
public abstract void onSessionStarting (T session)
Called when a session is attempting to start.
Parameters
| session | The Session. |
|---|
public abstract void onSessionSuspended (T session, int reason)
Called when a session has been suspended.
Parameters
| session | The Session. |
|---|---|
| reason | The reason for suspension. Defined in CastStatusCodes
or GoogleApiClient.ConnectionCallbacks. |