Android APIs
public final class

TvInputInfo

extends Object
implements Parcelable
java.lang.Object
   ↳ android.media.tv.TvInputInfo

Class Overview

This class is used to specify meta information of a TV input.

Summary

Constants
String EXTRA_INPUT_ID The ID of the TV input to provide to the setup activity and settings activity.
int TYPE_COMPONENT TV input type: the TV input service represents a component port.
int TYPE_COMPOSITE TV input type: the TV input service represents a composite port.
int TYPE_DISPLAY_PORT TV input type: the TV input service represents a display port.
int TYPE_DVI TV input type: the TV input service represents a DVI port.
int TYPE_HDMI TV input type: the TV input service is HDMI.
int TYPE_OTHER TV input type: a generic hardware TV input type.
int TYPE_SCART TV input type: the TV input service represents a SCART port.
int TYPE_SVIDEO TV input type: the TV input service represents a SVIDEO port.
int TYPE_TUNER TV input type: the TV input service is a tuner which provides channels.
int TYPE_VGA TV input type: the TV input service represents a VGA port.
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<TvInputInfo> CREATOR
Public Methods
Intent createSettingsIntent()
Returns an intent to start the settings activity for this TV input.
Intent createSetupIntent()
Returns an intent to start the setup activity for this TV input.
int describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
boolean equals(Object o)
Compares this instance with the specified object and indicates if they are equal.
String getId()
Returns a unique ID for this TV input.
String getParentId()
Returns the parent input ID.
ServiceInfo getServiceInfo()
Returns the information of the service that implements this TV input.
int getType()
Returns the type of this TV input.
int hashCode()
Returns an integer hash code for this object.
boolean isPassthroughInput()
Returns true if this TV input is pass-though which does not have any real channels in TvProvider.
Drawable loadIcon(Context context)
Loads the user-displayed icon for this TV input.
CharSequence loadLabel(Context context)
Loads the user-displayed label for this TV input.
String toString()
Returns a string containing a concise, human-readable description of this object.
void writeToParcel(Parcel dest, int flags)
Used to package this object into a Parcel.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Constants

public static final String EXTRA_INPUT_ID

Added in API level 21

The ID of the TV input to provide to the setup activity and settings activity.

Constant Value: "android.media.tv.extra.INPUT_ID"

public static final int TYPE_COMPONENT

Added in API level 21

TV input type: the TV input service represents a component port.

Constant Value: 1004 (0x000003ec)

public static final int TYPE_COMPOSITE

Added in API level 21

TV input type: the TV input service represents a composite port.

Constant Value: 1001 (0x000003e9)

public static final int TYPE_DISPLAY_PORT

Added in API level 21

TV input type: the TV input service represents a display port.

Constant Value: 1008 (0x000003f0)

public static final int TYPE_DVI

Added in API level 21

TV input type: the TV input service represents a DVI port.

Constant Value: 1006 (0x000003ee)

public static final int TYPE_HDMI

Added in API level 21

TV input type: the TV input service is HDMI. (e.g. HDMI 1)

Constant Value: 1007 (0x000003ef)

public static final int TYPE_OTHER

Added in API level 21

TV input type: a generic hardware TV input type.

Constant Value: 1000 (0x000003e8)

public static final int TYPE_SCART

Added in API level 21

TV input type: the TV input service represents a SCART port.

Constant Value: 1003 (0x000003eb)

public static final int TYPE_SVIDEO

Added in API level 21

TV input type: the TV input service represents a SVIDEO port.

Constant Value: 1002 (0x000003ea)

public static final int TYPE_TUNER

Added in API level 21

TV input type: the TV input service is a tuner which provides channels.

Constant Value: 0 (0x00000000)

public static final int TYPE_VGA

Added in API level 21

TV input type: the TV input service represents a VGA port.

Constant Value: 1005 (0x000003ed)

Fields

public static final Creator<TvInputInfo> CREATOR

Added in API level 21

Public Methods

public Intent createSettingsIntent ()

Added in API level 21

Returns an intent to start the settings activity for this TV input.

public Intent createSetupIntent ()

Added in API level 21

Returns an intent to start the setup activity for this TV input.

public int describeContents ()

Added in API level 21

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Returns
  • a bitmask indicating the set of special object types marshalled by the Parcelable.

public boolean equals (Object o)

Added in API level 21

Compares this instance with the specified object and indicates if they are equal. In order to be equal, o must represent the same object as this instance using a class-specific comparison. The general contract is that this comparison should be reflexive, symmetric, and transitive. Also, no object reference other than null is equal to null.

The default implementation returns true only if this == o. See Writing a correct equals method if you intend implementing your own equals method.

The general contract for the equals and hashCode() methods is that if equals returns true for any two objects, then hashCode() must return the same value for these objects. This means that subclasses of Object usually override either both methods or neither of them.

Parameters
o the object to compare this instance with.
Returns
  • true if the specified object is equal to this Object; false otherwise.

public String getId ()

Added in API level 21

Returns a unique ID for this TV input. The ID is generated from the package and class name implementing the TV input service.

public String getParentId ()

Added in API level 21

Returns the parent input ID.

A TV input may have a parent input if the TV input is actually a logical representation of a device behind the hardware port represented by the parent input. For example, a HDMI CEC logical device, connected to a HDMI port, appears as another TV input. In this case, the parent input of this logical device is the HDMI port.

Applications may group inputs by parent input ID to provide an easier access to inputs sharing the same physical port. In the example of HDMI CEC, logical HDMI CEC devices behind the same HDMI port have the same parent ID, which is the ID representing the port. Thus applications can group the hardware HDMI port and the logical HDMI CEC devices behind it together using this method.

Returns
  • the ID of the parent input, if exists. Returns null if the parent input is not specified.

public ServiceInfo getServiceInfo ()

Added in API level 21

Returns the information of the service that implements this TV input.

public int getType ()

Added in API level 21

Returns the type of this TV input.

public int hashCode ()

Added in API level 21

Returns an integer hash code for this object. By contract, any two objects for which equals(Object) returns true must return the same hash code value. This means that subclasses of Object usually override both methods or neither method.

Note that hash values must not change over time unless information used in equals comparisons also changes.

See Writing a correct hashCode method if you intend implementing your own hashCode method.

Returns
  • this object's hash code.

public boolean isPassthroughInput ()

Added in API level 21

Returns true if this TV input is pass-though which does not have any real channels in TvProvider. false otherwise.

public Drawable loadIcon (Context context)

Added in API level 21

Loads the user-displayed icon for this TV input.

Parameters
context Supplies a Context used to load the icon.
Returns
  • a Drawable containing the TV input's icon. If the TV input does not have an icon, application's icon is returned. If it's unavailable too, null is returned.

public CharSequence loadLabel (Context context)

Added in API level 21

Loads the user-displayed label for this TV input.

Parameters
context Supplies a Context used to load the label.
Returns
  • a CharSequence containing the TV input's label. If the TV input does not have a label, its name is returned.

public String toString ()

Added in API level 21

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:

   getClass().getName() + '@' + Integer.toHexString(hashCode())

See Writing a useful toString method if you intend implementing your own toString method.

Returns
  • a printable representation of this object.

public void writeToParcel (Parcel dest, int flags)

Added in API level 21

Used to package this object into a Parcel.

Parameters
dest The Parcel to be written.
flags The flags used for parceling.