java.lang.Object | |
↳ | 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.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
TvInputManager.TvInputCallback | Callback used to monitor status of the TV inputs. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | ACTION_BLOCKED_RATINGS_CHANGED | Broadcast intent action when the user blocked content ratings change. | |||||||||
String | ACTION_PARENTAL_CONTROLS_ENABLED_CHANGED | Broadcast intent action when the parental controls enabled state changes. | |||||||||
String | ACTION_QUERY_CONTENT_RATING_SYSTEMS | Broadcast intent action used to query available content rating systems. | |||||||||
int | INPUT_STATE_CONNECTED | The TV input is connected. | |||||||||
int | INPUT_STATE_CONNECTED_STANDBY | The TV input is connected but in standby mode. | |||||||||
int | INPUT_STATE_DISCONNECTED | The TV input is disconnected. | |||||||||
String | META_DATA_CONTENT_RATING_SYSTEMS |
Content rating systems metadata associated with ACTION_QUERY_CONTENT_RATING_SYSTEMS .
|
|||||||||
long | TIME_SHIFT_INVALID_TIME | ||||||||||
int | TIME_SHIFT_STATUS_AVAILABLE | Time shifting is currently available. | |||||||||
int | TIME_SHIFT_STATUS_UNAVAILABLE | Time shifting is currently not available but might work again later. | |||||||||
int | TIME_SHIFT_STATUS_UNKNOWN |
Status prior to calling notifyTimeShiftStatusChanged(int) .
|
|||||||||
int | TIME_SHIFT_STATUS_UNSUPPORTED | The TV input does not support time shifting. | |||||||||
int | VIDEO_UNAVAILABLE_REASON_AUDIO_ONLY | Video is not available because the current program is audio-only. | |||||||||
int | VIDEO_UNAVAILABLE_REASON_BUFFERING | Video is not available because the TV input stopped the playback temporarily to buffer more data. | |||||||||
int | VIDEO_UNAVAILABLE_REASON_TUNING | Video is not available because the TV input is in the middle of tuning to a new channel. | |||||||||
int | VIDEO_UNAVAILABLE_REASON_UNKNOWN | A generic reason. | |||||||||
int | VIDEO_UNAVAILABLE_REASON_WEAK_SIGNAL | Video is not available due to the weak TV signal. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the state of a given TV input.
| |||||||||||
Returns the
TvInputInfo for a given TV input.
| |||||||||||
Returns the complete list of TV inputs on the system.
| |||||||||||
Returns the user's parental controls enabled state.
| |||||||||||
Checks whether a given TV content rating is blocked by the user.
| |||||||||||
Registers a
TvInputManager.TvInputCallback .
| |||||||||||
Unregisters the existing
TvInputManager.TvInputCallback .
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Broadcast intent action when the user blocked content ratings change. For use with the
isRatingBlocked(TvContentRating)
.
Broadcast intent action when the parental controls enabled state changes. For use with the
isParentalControlsEnabled()
.
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.
The TV input is connected.
This state indicates that a source device is connected to the input port and is in the normal operation mode. It is mostly relevant to hardware inputs such as HDMI input. This is the default state for any hardware inputs where their states are unknown. Non-hardware inputs are considered connected all the time.
The TV input is connected but in standby mode.
This state indicates that a source device is connected to the input port but is in standby mode. It is mostly relevant to hardware inputs such as HDMI input.
The TV input is disconnected.
This state indicates that a source device is disconnected from the input port. It is mostly relevant to hardware inputs such as HDMI input.
Content rating systems metadata associated with ACTION_QUERY_CONTENT_RATING_SYSTEMS
.
Specifies the resource ID of an XML resource that describes the content rating systems that are provided by the application.
Time shifting is currently available. In this status, the application assumes it can pause/resume playback, seek to a specified time position and set playback rate and audio mode.
Time shifting is currently not available but might work again later.
Status prior to calling notifyTimeShiftStatusChanged(int)
.
The TV input does not support time shifting.
Video is not available because the current program is audio-only.
Video is not available because the TV input stopped the playback temporarily to buffer more data.
Video is not available because the TV input is in the middle of tuning to a new channel.
A generic reason. Video is not available due to an unspecified error.
Video is not available due to the weak TV signal.
Returns the state of a given TV input.
The state is one of the following:
inputId | The id of the TV input. |
---|
IllegalArgumentException | if the argument is null .
|
---|
Returns the TvInputInfo
for a given TV input.
inputId | The ID of the TV input. |
---|
TvInputInfo
for a given TV input. null
if not found.
Returns the complete list of TV inputs on the system.
TvInputInfo
for each TV input that describes its meta information.
Returns the user's parental controls enabled state.
true
if the user enabled the parental controls, false
otherwise.
Checks whether a given TV content rating is blocked by the user.
rating | The TV content rating to check. Can be UNRATED . |
---|
true
if the given TV content rating is blocked, false
otherwise.
Registers a TvInputManager.TvInputCallback
.
callback | A callback used to monitor status of the TV inputs. |
---|---|
handler | A Handler that the status change will be delivered to.
|
Unregisters the existing TvInputManager.TvInputCallback
.
callback | The existing callback to remove. |
---|