Added in API level 21

TvInputManager


class TvInputManager
kotlin.Any
   ↳ android.media.tv.TvInputManager

Central system API to the overall TV input framework (TIF) architecture, which arbitrates interaction between applications and the selected TV inputs.

There are three primary parties involved in the TV input framework (TIF) architecture:

  • The TV input manager as expressed by this class is the central point of the system that manages interaction between all other parts. It is expressed as the client-side API here which exists in each application context and communicates with a global system service that manages the interaction across all processes.
  • A TV input implemented by TvInputService represents an input source of TV, which can be a pass-through input such as HDMI, or a tuner input which provides broadcast TV programs. The system binds to the TV input per application’s request. on implementing TV inputs.
  • Applications talk to the TV input manager to list TV inputs and check their status. Once an application find the input to use, it uses TvView or TvRecordingClient for further interaction such as watching and recording broadcast TV programs.

Summary

Nested classes
abstract

Callback used to monitor status of the TV inputs.

Constants
static String

Broadcast intent action when the user blocked content ratings change.

static String

Broadcast intent action when the parental controls enabled state changes.

static String

Broadcast intent action used to query available content rating systems.

static String

Activity action to set up channel sources i.

static String

Activity action to display the recording schedules.

static Int

static Int

static Int

static Int

static Int

static Int

static Int

static Int

static Int

State for getInputState(String) and TvInputCallback.onInputStateChanged(String,int): The input source is connected.

static Int

State for getInputState(String) and TvInputCallback.onInputStateChanged(String,int): The input source is connected but in standby mode.

static Int

State for getInputState(String) and TvInputCallback.onInputStateChanged(String,int): The input source is disconnected.

static String

Content rating systems metadata associated with ACTION_QUERY_CONTENT_RATING_SYSTEMS.

static Int

Error for TvInputService.RecordingSession.notifyError(int) and TvRecordingClient.RecordingCallback.onError(int): Recording cannot proceed due to insufficient storage space.

static Int

Error for TvInputService.RecordingSession.notifyError(int) and TvRecordingClient.RecordingCallback.onError(int): Recording cannot proceed because a required recording resource was not able to be allocated.

static Int

Error for TvInputService.RecordingSession.notifyError(int) and TvRecordingClient.RecordingCallback.onError(int): The requested operation cannot be completed due to a problem that does not fit under any other error codes, or the error code for the problem is defined on the higher version than application's android:targetSdkVersion.

static String

An object of AdBuffer.

static String

An object of AdResponse.

static String

An object of BroadcastInfoResponse.

static String

The URI of a channel.

static String

A list which includes track information.

static String

The ID of the track.

static String

The type of the track.

static String

The type of TV message.

static String

The reason why the video became unavailable.

static String

Notifies the advertisement buffer is consumed.

static String

Notifies response for advertisement.

static String

Notifies response for broadcast info.

static String

Sends the list of all audio/video/subtitle tracks.

static String

Sends the type and ID of a selected track.

static String

Informs the application that the session has been tuned to the given channel.

static String

Sends the TV message.

static String

Informs the application that the video is now available for watching.

static String

Informs the application that the video became unavailable for some reason.

static Int

Signal lost.

static Int

Strong signal.

static Int

Weak signal.

static Long

Value returned by TvInputService.Session.onTimeShiftGetCurrentPosition() and TvInputService.Session.onTimeShiftGetStartPosition() when time shifting has not yet started.

static Int

Time shift mode: auto.

static Int

Time shift mode: local.

static Int

Time shift mode: network.

static Int

Time shift mode: off.

static Int

Status for TvInputService.Session.notifyTimeShiftStatusChanged(int) and TvView.TvInputCallback.onTimeShiftStatusChanged(String,int): Time shifting is currently available.

static Int

Status for TvInputService.Session.notifyTimeShiftStatusChanged(int) and TvView.TvInputCallback.onTimeShiftStatusChanged(String,int): Time shifting is currently unavailable but might work again later.

static Int

Status for TvInputService.Session.notifyTimeShiftStatusChanged(int) and TvView.TvInputCallback.onTimeShiftStatusChanged(String,int): Unknown status.

static Int

Status for TvInputService.Session.notifyTimeShiftStatusChanged(int) and TvView.TvInputCallback.onTimeShiftStatusChanged(String,int): The current TV input does not support time shifting.

static Long

This value for TV_MESSAGE_KEY_GROUP_ID denotes that the message doesn't belong to any group.

static String

This constant is used as a Bundle key for TV messages.

static String

This constant is used as a Bundle key for TV messages.

static String

This constant is used as a Bundle key for TV messages.

static String

This constant is used as a Bundle key for TV messages.

static String

This is a subtype for TV messages that can be potentially found as a value at TV_MESSAGE_KEY_SUBTYPE.

static String

This is a subtype for TV messages that can be potentially found as a value at TV_MESSAGE_KEY_SUBTYPE.

static Int

Indicates that this TV message contains Closed Captioning data

static Int

Indicates that this TV message contains other data

static Int

Indicates that this TV message contains watermarking data

static Int

Reason for TvInputService.Session.notifyVideoUnavailable(int) and TvView.TvInputCallback.onVideoUnavailable(String,int): Video is unavailable because the current TV program is audio-only.

static Int

Reason for TvInputService.Session.notifyVideoUnavailable(int) and TvView.TvInputCallback.onVideoUnavailable(String,int): Video is unavailable because the corresponding TV input has stopped playback temporarily to buffer more data.

static Int

Reason for TvInputService.Session.notifyVideoUnavailable(int) and TvView.TvInputCallback.onVideoUnavailable(String,int): Video is unavailable because of a geographical blackout.

static Int

Reason for TvInputService.Session.notifyVideoUnavailable(int) and TvView.TvInputCallback.onVideoUnavailable(String,int): Video is unavailable because smart card is invalid.

static Int

Reason for TvInputService.Session.notifyVideoUnavailable(int) and TvView.TvInputCallback.onVideoUnavailable(String,int): Video is unavailable because smart card is muted.

static Int

Reason for TvInputService.Session.notifyVideoUnavailable(int) and TvView.TvInputCallback.onVideoUnavailable(String,int): Video is unavailable because the output protection level enabled on the device is not sufficient to meet the requirements in the license policy.

static Int

Reason for TvInputService.Session.notifyVideoUnavailable(int) and TvView.TvInputCallback.onVideoUnavailable(String,int): Video is unavailable because Using a license in whhich the keys have expired.

static Int

Reason for TvInputService.Session.notifyVideoUnavailable(int) and TvView.TvInputCallback.onVideoUnavailable(String,int): Video is unavailable because the device need be activated.

static Int

Reason for TvInputService.Session.notifyVideoUnavailable(int) and TvView.TvInputCallback.onVideoUnavailable(String,int): Video is unavailable because the device need be paired.

static Int

Reason for TvInputService.Session.notifyVideoUnavailable(int) and TvView.TvInputCallback.onVideoUnavailable(String,int): Video is unavailable because smart card is missed.

static Int

Reason for TvInputService.Session.notifyVideoUnavailable(int) and TvView.TvInputCallback.onVideoUnavailable(String,int): Video is unavailable because the PVR record is not allowed by the license policy.

static Int

Reason for TvInputService.Session.notifyVideoUnavailable(int) and TvView.TvInputCallback.onVideoUnavailable(String,int): Video is unavailable because CAS system is rebooting.

static Int

Reason for TvInputService.Session.notifyVideoUnavailable(int) and TvView.TvInputCallback.onVideoUnavailable(String,int): Video is unavailable because of unknown CAS error.

static Int

Reason for TvInputService.Session.notifyVideoUnavailable(int) and TvView.TvInputCallback.onVideoUnavailable(String,int): Video is unavailable because the resource is not enough to meet requirement.

static Int

Reason for TvInputService.Session.notifyVideoUnavailable(int) and TvView.TvInputCallback.onVideoUnavailable(String,int): Video is unavailable because the source is not physically connected, for example the HDMI cable is not connected.

static Int

Reason for TvInputService.Session.notifyVideoUnavailable(int) and TvView.TvInputCallback.onVideoUnavailable(String,int): Video is unavailable because it has been stopped by TvView.stopPlayback(int).

static Int

Reason for TvInputService.Session.notifyVideoUnavailable(int) and TvView.TvInputCallback.onVideoUnavailable(String,int): Video is unavailable because the corresponding TV input is in the middle of tuning to a new channel.

static Int

Reason for TvInputService.Session.notifyVideoUnavailable(int) and TvView.TvInputCallback.onVideoUnavailable(String,int): Video is unavailable due to an unspecified error.

static Int

Reason for TvInputService.Session.notifyVideoUnavailable(int) and TvView.TvInputCallback.onVideoUnavailable(String,int): Video is unavailable due to weak TV signal.

Public methods
MutableList<TvContentRating!>!

Returns the list of blocked content ratings.

Int

Returns the state of a given TV input.

TvInputInfo?

Returns the TvInputInfo for a given TV input.

MutableList<TvInputInfo!>!

Returns the complete list of TV inputs on the system.

Boolean

Returns the user's parental controls enabled state.

Boolean

Checks whether a given TV content rating is blocked by the user.

Unit

Registers a TvInputCallback.

Unit

Unregisters the existing TvInputCallback.

Unit

Updates the TvInputInfo for an existing TV input.

Constants

ACTION_BLOCKED_RATINGS_CHANGED

Added in API level 21
static val ACTION_BLOCKED_RATINGS_CHANGED: String

Broadcast intent action when the user blocked content ratings change. For use with the isRatingBlocked.

Value: "android.media.tv.action.BLOCKED_RATINGS_CHANGED"

ACTION_PARENTAL_CONTROLS_ENABLED_CHANGED

Added in API level 21
static val ACTION_PARENTAL_CONTROLS_ENABLED_CHANGED: String

Broadcast intent action when the parental controls enabled state changes. For use with the isParentalControlsEnabled.

Value: "android.media.tv.action.PARENTAL_CONTROLS_ENABLED_CHANGED"

ACTION_QUERY_CONTENT_RATING_SYSTEMS

Added in API level 21
static val ACTION_QUERY_CONTENT_RATING_SYSTEMS: String

Broadcast intent action used to query available content rating systems.

The TV input manager service locates available content rating systems by querying broadcast receivers that are registered for this action. An application can offer additional content rating systems to the user by declaring a suitable broadcast receiver in its manifest.

Here is an example broadcast receiver declaration that an application might include in its AndroidManifest.xml to advertise custom content rating systems. The meta-data specifies a resource that contains a description of each content rating system that is provided by the application.

<receiver android:name=".TvInputReceiver">
      <intent-filter>
          <action android:name=
                  "android.media.tv.action.QUERY_CONTENT_RATING_SYSTEMS" />
      </intent-filter>
      <meta-data
              android:name="android.media.tv.metadata.CONTENT_RATING_SYSTEMS"
              android:resource="@xml/tv_content_rating_systems" />
  </receiver>

In the above example, the @xml/tv_content_rating_systems resource refers to an XML resource whose root element is <rating-system-definitions> that contains zero or more <rating-system-definition> elements. Each <rating-system-definition> element specifies the ratings, sub-ratings and rating orders of a particular content rating system.

Value: "android.media.tv.action.QUERY_CONTENT_RATING_SYSTEMS"

ACTION_SETUP_INPUTS

Added in API level 24
static val ACTION_SETUP_INPUTS: String

Activity action to set up channel sources i.e. TV inputs of type TvInputInfo.TYPE_TUNER. When invoked, the system will display an appropriate UI for the user to initiate the individual setup flow provided by android.R.attr#setupActivity of each TV input service.

Value: "android.media.tv.action.SETUP_INPUTS"

ACTION_VIEW_RECORDING_SCHEDULES

Added in API level 26
static val ACTION_VIEW_RECORDING_SCHEDULES: String

Activity action to display the recording schedules. When invoked, the system will display an appropriate UI to browse the schedules.

Value: "android.media.tv.action.VIEW_RECORDING_SCHEDULES"

BROADCAST_INFO_STREAM_EVENT

Added in API level 33