TvView.TvInputCallback


public static abstract class TvView.TvInputCallback
extends Object

java.lang.Object
   ↳ android.media.tv.TvView.TvInputCallback


Callback used to receive various status updates on the TvView.

Summary

Public constructors

TvInputCallback()

Public methods

void onAitInfoUpdated(String inputId, AitInfo aitInfo)

This is called when the AIT (Application Information Table) info has been updated.

void onAudioPresentationSelected(String inputId, int presentationId, int programId)

This is called when audio presentation selection has changed.

void onAudioPresentationsChanged(String inputId, List<AudioPresentation> audioPresentations)

This is called when the audio presentation information has been changed.

void onAvailableSpeeds(String inputId, float[] speeds)

This is called when time-shifting is enabled to inform the available speeds.

void onChannelRetuned(String inputId, Uri channelUri)

This is invoked when the channel of this TvView is changed by the underlying TV input without any TvView#tune request.

void onConnectionFailed(String inputId)

This is invoked when an error occurred while establishing a connection to the underlying TV input.

void onContentAllowed(String inputId)

This is called when the current program content turns out to be allowed to watch since its content rating is not blocked by parental controls.

void onContentBlocked(String inputId, TvContentRating rating)

This is called when the current program content turns out to be not allowed to watch since its content rating is blocked by parental controls.

void onCueingMessageAvailability(String inputId, boolean available)

This is called when cueing message becomes available or unavailable.

void onDisconnected(String inputId)

This is invoked when the existing connection to the underlying TV input is lost.

void onSignalStrengthUpdated(String inputId, int strength)

This is called when signal strength is updated.

void onTimeShiftMode(String inputId, int mode)

This is called when time shift mode is set or updated.

void onTimeShiftStatusChanged(String inputId, int status)

This is called when the time shift status is changed.

void onTrackSelected(String inputId, int type, String trackId)

This is called when there is a change on the selected tracks.

void onTracksChanged(String inputId, List<TvTrackInfo> tracks)

This is called when the track information has been changed.

void onTuned(String inputId, Uri channelUri)

This is called when the session has been tuned to the given channel.

void onTvMessage(String inputId, int type, Bundle data)

This is called when a new TV Message has been received.

void onVideoAvailable(String inputId)

This is called when the video is available, so the TV input starts the playback.

void onVideoSizeChanged(String inputId, int width, int height)

This is invoked when the video size has been changed.

void onVideoUnavailable(String inputId, int reason)

This is called when the video is not available, so the TV input stops the playback.

Inherited methods

Public constructors

TvInputCallback

public TvInputCallback ()

Public methods

onAitInfoUpdated

Added in API level 33
public void onAitInfoUpdated (String inputId, 
                AitInfo aitInfo)

This is called when the AIT (Application Information Table) info has been updated.

Parameters
inputId String: This value cannot be null.

aitInfo AitInfo: The current AIT info. This value cannot be null.

onAudioPresentationSelected

Added in API level 34
public void onAudioPresentationSelected (String inputId, 
                int presentationId, 
                int programId)

This is called when audio presentation selection has changed.

Parameters
inputId String: The ID of the TV input bound to this view. This value cannot be null.

presentationId int: The ID of the audio presentation selected.

programId int: The ID of the program providing the selected audio presentation.

onAudioPresentationsChanged

Added in API level 34
public void onAudioPresentationsChanged (String inputId, 
                List<AudioPresentation> audioPresentations)

This is called when the audio presentation information has been changed.

Parameters
inputId String: The ID of the TV input bound to this view. This value cannot be null.

audioPresentations List: A list of updated audio presentation information. This value cannot be null.

onAvailableSpeeds

Added in API level 34
public void onAvailableSpeeds (String inputId, 
                float[] speeds)

This is called when time-shifting is enabled to inform the available speeds.

Parameters
inputId String: The ID of the TV input bound to this view. This value cannot be null.

speeds float: An ordered array of playback speeds, expressed as values relative to the normal playback speed (1.0), at which the current content can be played as a time-shifted broadcast. This is an empty array if the supported playback speeds are unknown or the video/broadcast is not in time shift mode. If currently in time shift mode, this array will normally include at least the values 1.0 (normal speed) and 0.0 (paused). This value cannot be null.

onChannelRetuned

Added in API level 21
public void onChannelRetuned (String inputId, 
                Uri channelUri)

This is invoked when the channel of this TvView is changed by the underlying TV input without any TvView#tune request.

Parameters
inputId String: The ID of the TV input bound to this view.

channelUri Uri: The URI of a channel.

onConnectionFailed

Added in API level 21
public void onConnectionFailed (String inputId)

This is invoked when an error occurred while establishing a connection to the underlying TV input.

Parameters
inputId String: The ID of the TV input bound to this view.

onContentAllowed

Added in API level 21
public void onContentAllowed (String inputId)

This is called when the current program content turns out to be allowed to watch since its content rating is not blocked by parental controls.

Parameters
inputId String: The ID of the TV input bound to this view.

onContentBlocked

Added in API level 21
public void onContentBlocked (String inputId, 
                TvContentRating rating)

This is called when the current program content turns out to be not allowed to watch since its content rating is blocked by parental controls.

Parameters
inputId String: The ID of the TV input bound to this view.

rating TvContentRating: The content rating of the blocked program.

onCueingMessageAvailability

Added in API level 34
public void onCueingMessageAvailability (String inputId, 
                boolean available)

This is called when cueing message becomes available or unavailable.

Parameters
inputId String: The ID of the TV input bound to this view. This value cannot be null.

available boolean: The current availability of cueing message. true if cueing message is available; false if it becomes unavailable.

onDisconnected

Added in API level 21
public void onDisconnected (String inputId)

This is invoked when the existing connection to the underlying TV input is lost.

Parameters
inputId String: The ID of the TV input bound to this view.

onSignalStrengthUpdated

Added in API level 33
public void onSignalStrengthUpdated (String inputId, 
                int strength)

This is called when signal strength is updated.

Parameters
inputId String: The ID of the TV input bound to this view. This value cannot be null.

strength int: The current signal strength. Value is TvInputManager.SIGNAL_STRENGTH_LOST, TvInputManager.SIGNAL_STRENGTH_WEAK, or TvInputManager.SIGNAL_STRENGTH_STRONG

onTimeShiftMode

Added in API level 34
public void onTimeShiftMode (String inputId, 
                int mode)

This is called when time shift mode is set or updated.

Parameters
inputId String: The ID of the TV input bound to this view. This value cannot be null.

mode int: The current time shift mode. The value is one of the following: TvInputManager#TIME_SHIFT_MODE_OFF, TvInputManager#TIME_SHIFT_MODE_LOCAL, TvInputManager#TIME_SHIFT_MODE_NETWORK, TvInputManager#TIME_SHIFT_MODE_AUTO. Value is TvInputManager.TIME_SHIFT_MODE_OFF, TvInputManager.TIME_SHIFT_MODE_LOCAL, TvInputManager.TIME_SHIFT_MODE_NETWORK, or TvInputManager.TIME_SHIFT_MODE_AUTO

onTimeShiftStatusChanged

Added in API level 23
public void onTimeShiftStatusChanged (String inputId, 
                int status)

This is called when the time shift status is changed.

Parameters
inputId String: The ID of the TV input bound to this view.

status int: The current time shift status. Should be one of the followings. Value is TvInputManager.TIME_SHIFT_STATUS_UNKNOWN, TvInputManager.TIME_SHIFT_STATUS_UNSUPPORTED, TvInputManager.TIME_SHIFT_STATUS_UNAVAILABLE, or TvInputManager.TIME_SHIFT_STATUS_AVAILABLE

onTrackSelected

Added in API level 21
public void onTrackSelected (String inputId, 
                int type, 
                String trackId)

This is called when there is a change on the selected tracks.

Parameters
inputId String: The ID of the TV input bound to this view.

type int: The type of the track selected. The type can be TvTrackInfo#TYPE_AUDIO, TvTrackInfo#TYPE_VIDEO or TvTrackInfo#TYPE_SUBTITLE.

trackId String: The ID of the track selected.

onTracksChanged

Added in API level 21
public void onTracksChanged (String inputId, 
                List<TvTrackInfo> tracks)

This is called when the track information has been changed.

Parameters
inputId String: The ID of the TV input bound to this view.

tracks List: A list which includes track information.

onTuned

Added in API level 33
public void onTuned (String inputId, 
                Uri channelUri)

This is called when the session has been tuned to the given channel.

Parameters
inputId String: This value cannot be null.

channelUri Uri: The URI of a channel. This value cannot be null.

onTvMessage

Added in API level 34
public void onTvMessage (String inputId, 
                int type, 
                Bundle data)

This is called when a new TV Message has been received.

Parameters
inputId String: The ID of the TV input bound to this view. This value cannot be null.

type int: The type of message received, such as TvInputManager#TV_MESSAGE_TYPE_WATERMARK Value is TvInputManager.TV_MESSAGE_TYPE_WATERMARK, TvInputManager.TV_MESSAGE_TYPE_CLOSED_CAPTION, or TvInputManager.TV_MESSAGE_TYPE_OTHER

data Bundle: The raw data of the message. The bundle keys are: TvInputManager#TV_MESSAGE_KEY_STREAM_ID, TvInputManager#TV_MESSAGE_KEY_GROUP_ID, TvInputManager#TV_MESSAGE_KEY_SUBTYPE, TvInputManager#TV_MESSAGE_KEY_RAW_DATA. See TvInputManager#TV_MESSAGE_KEY_SUBTYPE for more information on how to parse this data. This value cannot be null.

onVideoAvailable

Added in API level 21
public void onVideoAvailable (String inputId)

This is called when the video is available, so the TV input starts the playback.

Parameters
inputId String: The ID of the TV input bound to this view.

onVideoSizeChanged

Added in API level 21
public void onVideoSizeChanged (String inputId, 
                int width, 
                int height)

This is invoked when the video size has been changed. It is also called when the first time video size information becomes available after this view is tuned to a specific channel.

Parameters
inputId String: The ID of the TV input bound to this view.

width int: The width of the video.

height int: The height of the video.

onVideoUnavailable

Added in API level 21
public void onVideoUnavailable (String inputId, 
                int reason)

This is called when the video is not available, so the TV input stops the playback.

Parameters
inputId String: The ID of the TV input bound to this view.

reason int: The reason why the TV input stopped the playback: Value is TvInputManager.VIDEO_UNAVAILABLE_REASON_UNKNOWN, TvInputManager.VIDEO_UNAVAILABLE_REASON_TUNING, TvInputManager.VIDEO_UNAVAILABLE_REASON_WEAK_SIGNAL, TvInputManager.VIDEO_UNAVAILABLE_REASON_BUFFERING, TvInputManager.VIDEO_UNAVAILABLE_REASON_AUDIO_ONLY, TvInputManager.VIDEO_UNAVAILABLE_REASON_NOT_CONNECTED, TvInputManager.VIDEO_UNAVAILABLE_REASON_INSUFFICIENT_RESOURCE, TvInputManager.VIDEO_UNAVAILABLE_REASON_CAS_INSUFFICIENT_OUTPUT_PROTECTION, TvInputManager.VIDEO_UNAVAILABLE_REASON_CAS_PVR_RECORDING_NOT_ALLOWED, android.media.tv.TvInputManager.VIDEO_UNAVAILABLE_REASON_CAS_NO_LICENSE, TvInputManager.VIDEO_UNAVAILABLE_REASON_CAS_LICENSE_EXPIRED, TvInputManager.VIDEO_UNAVAILABLE_REASON_CAS_NEED_ACTIVATION, TvInputManager.VIDEO_UNAVAILABLE_REASON_CAS_NEED_PAIRING, TvInputManager.VIDEO_UNAVAILABLE_REASON_CAS_NO_CARD, TvInputManager.VIDEO_UNAVAILABLE_REASON_CAS_CARD_MUTE, TvInputManager.VIDEO_UNAVAILABLE_REASON_CAS_CARD_INVALID, TvInputManager.VIDEO_UNAVAILABLE_REASON_CAS_BLACKOUT, TvInputManager.VIDEO_UNAVAILABLE_REASON_CAS_REBOOTING, TvInputManager.VIDEO_UNAVAILABLE_REASON_CAS_UNKNOWN, or android.media.tv.TvInputManager.VIDEO_UNAVAILABLE_REASON_STOPPED