TvInputInfo
  public
  
  final
  
  class
  TvInputInfo
  
    extends Object
  
  
  
  
  
      implements
      
        Parcelable
      
  
  
| java.lang.Object | |
| ↳ | android.media.tv.TvInputInfo | 
This class is used to specify meta information of a TV input.
Summary
| Nested classes | |
|---|---|
| 
        
        
        
        
        class | TvInputInfo.BuilderA convenience builder for creating  | 
| Constants | |
|---|---|
| String | EXTRA_INPUT_IDUsed as a String extra field in setup intents created by  | 
| int | TYPE_COMPONENTTV input type: the TV input service represents a component port. | 
| int | TYPE_COMPOSITETV input type: the TV input service represents a composite port. | 
| int | TYPE_DISPLAY_PORTTV input type: the TV input service represents a display port. | 
| int | TYPE_DVITV input type: the TV input service represents a DVI port. | 
| int | TYPE_HDMITV input type: the TV input service is HDMI. | 
| int | TYPE_OTHERTV input type: a generic hardware TV input type. | 
| int | TYPE_SCARTTV input type: the TV input service represents a SCART port. | 
| int | TYPE_SVIDEOTV input type: the TV input service represents a SVIDEO port. | 
| int | TYPE_TUNERTV input type: the TV input service is a tuner which provides channels. | 
| int | TYPE_VGATV input type: the TV input service represents a VGA port. | 
| Inherited constants | 
|---|
| Fields | |
|---|---|
| 
    public
    static
    final
    Creator<TvInputInfo> | CREATOR
 | 
| Public methods | |
|---|---|
| 
        
        
        
        
        
        boolean | 
      canPauseRecording()
      Returns  | 
| 
        
        
        
        
        
        boolean | 
      canRecord()
      Returns  | 
| 
        
        
        
        
        
        Intent | 
      createSettingsIntent()
      
      This method was deprecated
      in API level 26.
    Use  | 
| 
        
        
        
        
        
        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 instance's marshaled representation. | 
| 
        
        
        
        
        
        boolean | 
      equals(Object o)
      Indicates whether some other object is "equal to" this one. | 
| 
        
        
        
        
        
        Bundle | 
      getExtras()
      Returns domain-specific extras associated with this TV input. | 
| 
        
        
        
        
        
        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 | 
      getTunerCount()
      Returns the number of tuners this TV input has. | 
| 
        
        
        
        
        
        int | 
      getType()
      Returns the type of this TV input. | 
| 
        
        
        
        
        
        int | 
      hashCode()
      Returns a hash code value for the object. | 
| 
        
        
        
        
        
        boolean | 
      isHidden(Context context)
      Checks if this TV input is marked hidden by the user in the settings. | 
| 
        
        
        
        
        
        boolean | 
      isPassthroughInput()
      Returns  | 
| 
        
        
        
        
        
        CharSequence | 
      loadCustomLabel(Context context)
      Loads the custom label set by user in settings. | 
| 
        
        
        
        
        
        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 representation of the object. | 
| 
        
        
        
        
        
        void | 
      writeToParcel(Parcel dest, int flags)
      Used to package this object into a  | 
| Inherited methods | |
|---|---|
Constants
EXTRA_INPUT_ID
public static final String EXTRA_INPUT_ID
Used as a String extra field in setup intents created by createSetupIntent() to
 supply the ID of a specific TV input to set up.
Constant Value: "android.media.tv.extra.INPUT_ID"
TYPE_COMPONENT
public static final int TYPE_COMPONENT
TV input type: the TV input service represents a component port.
Constant Value: 1004 (0x000003ec)
TYPE_COMPOSITE
public static final int TYPE_COMPOSITE
TV input type: the TV input service represents a composite port.
Constant Value: 1001 (0x000003e9)
TYPE_DISPLAY_PORT
public static final int TYPE_DISPLAY_PORT
TV input type: the TV input service represents a display port.
Constant Value: 1008 (0x000003f0)
TYPE_DVI
public static final int TYPE_DVI
TV input type: the TV input service represents a DVI port.
Constant Value: 1006 (0x000003ee)
TYPE_HDMI
public static final int TYPE_HDMI
TV input type: the TV input service is HDMI. (e.g. HDMI 1)
Constant Value: 1007 (0x000003ef)
TYPE_OTHER
public static final int TYPE_OTHER
TV input type: a generic hardware TV input type.
Constant Value: 1000 (0x000003e8)
TYPE_SCART
public static final int TYPE_SCART
TV input type: the TV input service represents a SCART port.
Constant Value: 1003 (0x000003eb)
TYPE_SVIDEO
public static final int TYPE_SVIDEO
TV input type: the TV input service represents a SVIDEO port.
Constant Value: 1002 (0x000003ea)
TYPE_TUNER
public static final int TYPE_TUNER
TV input type: the TV input service is a tuner which provides channels.
Constant Value: 0 (0x00000000)
TYPE_VGA
public static final int TYPE_VGA
TV input type: the TV input service represents a VGA port.
Constant Value: 1005 (0x000003ed)
Fields
Public methods
canPauseRecording
public boolean canPauseRecording ()
Returns true if this TV input can pause recording TV programs,
 false otherwise.
| Returns | |
|---|---|
| boolean | |
canRecord
public boolean canRecord ()
Returns true if this TV input can record TV programs, false otherwise.
| Returns | |
|---|---|
| boolean | |
createSettingsIntent
public Intent createSettingsIntent ()
      This method was deprecated
      in API level 26.
    Use createSetupIntent() instead. Settings activity is deprecated.
             Use setup activity instead to provide settings.
  
Returns an intent to start the settings activity for this TV input.
| Returns | |
|---|---|
| Intent | |
createSetupIntent
public Intent createSetupIntent ()
Returns an intent to start the setup activity for this TV input.
| Returns | |
|---|---|
| Intent | |
describeContents
public int describeContents ()
Describe the kinds of special objects contained in this Parcelable
 instance's marshaled representation. For example, if the object will
 include a file descriptor in the output of writeToParcel(android.os.Parcel, int),
 the return value of this method must include the
 CONTENTS_FILE_DESCRIPTOR bit.
| Returns | |
|---|---|
| int | a bitmask indicating the set of special object types marshaled
 by this Parcelable object instance.
 Value is either 0orCONTENTS_FILE_DESCRIPTOR | 
equals
public boolean equals (Object o)
Indicates whether some other object is "equal to" this one.
 The equals method implements an equivalence relation
 on non-null object references:
 
- It is reflexive: for any non-null reference value
     x,x.equals(x)should returntrue.
- It is symmetric: for any non-null reference values
     xandy,x.equals(y)should returntrueif and only ify.equals(x)returnstrue.
- It is transitive: for any non-null reference values
     x,y, andz, ifx.equals(y)returnstrueandy.equals(z)returnstrue, thenx.equals(z)should returntrue.
- It is consistent: for any non-null reference values
     xandy, multiple invocations ofx.equals(y)consistently returntrueor consistently returnfalse, provided no information used inequalscomparisons on the objects is modified.
- For any non-null reference value x,x.equals(null)should returnfalse.
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| Parameters | |
|---|---|
| o | Object: the reference object with which to compare. | 
| Returns | |
|---|---|
| boolean | trueif this object is the same as the obj
          argument;falseotherwise. | 
getExtras
public Bundle getExtras ()
Returns domain-specific extras associated with this TV input.
| Returns | |
|---|---|
| Bundle | |
getId
public String getId ()
Returns a unique ID for this TV input. The ID is generated from the package and class name implementing the TV input service.
| Returns | |
|---|---|
| String | |
getParentId
public String getParentId ()
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 | |
|---|---|
| String | the ID of the parent input, if exists. Returns nullif the parent input is
         not specified. | 
getServiceInfo
public ServiceInfo getServiceInfo ()
Returns the information of the service that implements this TV input.
| Returns | |
|---|---|
| ServiceInfo | |
getTunerCount
public int getTunerCount ()
Returns the number of tuners this TV input has.
This method is valid only for inputs of type TYPE_TUNER. For inputs of other
 types, it returns 0.
 
Tuners correspond to physical/logical resources that allow reception of TV signal. Having N tuners means that the TV input is capable of receiving N different channels concurrently.
| Returns | |
|---|---|
| int | |
getType
public int getType ()
Returns the type of this TV input.
| Returns | |
|---|---|
| int | Value is TYPE_TUNER,TYPE_OTHER,TYPE_COMPOSITE,TYPE_SVIDEO,TYPE_SCART,TYPE_COMPONENT,TYPE_VGA,TYPE_DVI,TYPE_HDMI, orTYPE_DISPLAY_PORT | 
hashCode
public int hashCode ()
Returns a hash code value for the object. This method is
 supported for the benefit of hash tables such as those provided by
 HashMap.
 
 The general contract of hashCode is:
 
- Whenever it is invoked on the same object more than once during
     an execution of a Java application, the hashCodemethod must consistently return the same integer, provided no information used inequalscomparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
- If two objects are equal according to the equalsmethod, then calling thehashCodemethod on each of the two objects must produce the same integer result.
- It is not required that if two objects are unequal
     according to the equalsmethod, then calling thehashCodemethod on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
| Returns | |
|---|---|
| int | a hash code value for this object. | 
isHidden
public boolean isHidden (Context context)
Checks if this TV input is marked hidden by the user in the settings.
| Parameters | |
|---|---|
| context | Context: Supplies aContextused to check if this TV input is hidden. | 
| Returns | |
|---|---|
| boolean | trueif the user marked this TV input hidden in settings.falseotherwise. | 
isPassthroughInput
public boolean isPassthroughInput ()
Returns true if this TV input is pass-though which does not have any real channels in
 TvProvider. false otherwise.
| Returns | |
|---|---|
| boolean | |
loadCustomLabel
public CharSequence loadCustomLabel (Context context)
Loads the custom label set by user in settings.
| Parameters | |
|---|---|
| context | Context: Supplies aContextused to load the custom label. | 
| Returns | |
|---|---|
| CharSequence | a CharSequence containing the TV input's custom label. nullif there is no
         custom label. | 
loadIcon
public Drawable loadIcon (Context context)
Loads the user-displayed icon for this TV input.
| Parameters | |
|---|---|
| context | Context: Supplies aContextused to load the icon.
 This value cannot benull. | 
| Returns | |
|---|---|
| Drawable | 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, nullis returned. | 
loadLabel
public CharSequence loadLabel (Context context)
Loads the user-displayed label for this TV input.
| Parameters | |
|---|---|
| context | Context: Supplies aContextused to load the label.
 This value cannot benull. | 
| Returns | |
|---|---|
| CharSequence | a CharSequence containing the TV input's label. If the TV input does not have a label, its name is returned. | 
toString
public String toString ()
Returns a string representation of the object.
| Returns | |
|---|---|
| String | a string representation of the object. | 
writeToParcel
public void writeToParcel (Parcel dest, int flags)
Used to package this object into a Parcel.
| Parameters | |
|---|---|
| dest | Parcel: TheParcelto be written.
 This value cannot benull. | 
| flags | int: The flags used for parceling. | 
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
