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 input. |
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 .
|
|||||||||
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.
State for getInputState(String)
and onInputStateChanged(String, int)
.
The TV input is connected but in standby mode. It would take a while until it becomes fully ready.
State for getInputState(String)
and onInputStateChanged(String, int)
.
The TV input is disconnected.
State for getInputState(String)
and onInputStateChanged(String, int)
.
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.
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. It returns one of the following:
inputId | The id of the TV input. |
---|
IllegalArgumentException | if the argument is null or if there is no
TvInputInfo corresponding to inputId .
|
---|
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. |
---|
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. |
IllegalArgumentException | if any of the arguments is null .
|
---|
Unregisters the existing TvInputManager.TvInputCallback
.
callback | The existing callback to remove. |
---|
IllegalArgumentException | if any of the arguments is null .
|
---|