Package com.google.android.exoplayer2.analytics

## Interface PlaybackSessionManager.Listener

- All Known Implementing Classes:
    `PlaybackStatsListener`
  Enclosing interface:
    PlaybackSessionManager

      public static interface PlaybackSessionManager.Listener

  A listener for session updates.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `onAdPlaybackStarted​(AnalyticsListener.EventTime eventTime, String contentSessionId, String adSessionId)` | Called when a session is interrupted by ad playback.
    `void` | `onSessionActive​(AnalyticsListener.EventTime eventTime, String sessionId)` | Called when a session becomes active, i.e.
    `void` | `onSessionCreated​(AnalyticsListener.EventTime eventTime, String sessionId)` | Called when a new session is created as a result of `PlaybackSessionManager.updateSessions(EventTime)`.
    `void` | `onSessionFinished​(AnalyticsListener.EventTime eventTime, String sessionId, boolean automaticTransitionToNextPlayback)` | Called when a session is permanently finished.

- - ### Method Detail

    - #### onSessionCreated

          void onSessionCreated​(AnalyticsListener.EventTime eventTime,
                                String sessionId)

      Called when a new session is created as a result of `PlaybackSessionManager.updateSessions(EventTime)`.
      Parameters:
        `eventTime` - The `AnalyticsListener.EventTime` at which the session is created.
        `sessionId` - The identifier of the new session.

    - #### onSessionActive

          void onSessionActive​(AnalyticsListener.EventTime eventTime,
                               String sessionId)

      Called when a session becomes active, i.e. playing in the foreground.
      Parameters:
        `eventTime` - The `AnalyticsListener.EventTime` at which the session becomes active.
        `sessionId` - The identifier of the session.

    - #### onAdPlaybackStarted

          void onAdPlaybackStarted​(AnalyticsListener.EventTime eventTime,
                                   String contentSessionId,
                                   String adSessionId)

      Called when a session is interrupted by ad playback.
      Parameters:
        `eventTime` - The `AnalyticsListener.EventTime` at which the ad playback starts.
        `contentSessionId` - The session identifier of the content session.
        `adSessionId` - The identifier of the ad session.

    - #### onSessionFinished

          void onSessionFinished​(AnalyticsListener.EventTime eventTime,
                                 String sessionId,
                                 boolean automaticTransitionToNextPlayback)

      Called when a session is permanently finished.
      Parameters:
        `eventTime` - The `AnalyticsListener.EventTime` at which the session finished.
        `sessionId` - The identifier of the finished session.
        `automaticTransitionToNextPlayback` - Whether the session finished because of an automatic transition to the next playback item.