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.
Nested classes | |
---|---|
class |
TvInputInfo.Builder
A convenience builder for creating |
Constants | |
---|---|
String |
EXTRA_INPUT_ID
Used as a String extra field in setup intents created by |
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. |
Inherited constants |
---|
From
interface
android.os.Parcelable
|
Fields | |
---|---|
public
static
final
Creator<TvInputInfo> |
CREATOR
|
Public methods | |
---|---|
boolean
|
canRecord()
Returns |
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 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 | |
---|---|
From
class
java.lang.Object
| |
From
interface
android.os.Parcelable
|
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"
int TYPE_COMPONENT
TV input type: the TV input service represents a component port.
Constant Value: 1004 (0x000003ec)
int TYPE_COMPOSITE
TV input type: the TV input service represents a composite port.
Constant Value: 1001 (0x000003e9)
int TYPE_DISPLAY_PORT
TV input type: the TV input service represents a display port.
Constant Value: 1008 (0x000003f0)
int TYPE_DVI
TV input type: the TV input service represents a DVI port.
Constant Value: 1006 (0x000003ee)
int TYPE_HDMI
TV input type: the TV input service is HDMI. (e.g. HDMI 1)
Constant Value: 1007 (0x000003ef)
int TYPE_OTHER
TV input type: a generic hardware TV input type.
Constant Value: 1000 (0x000003e8)
int TYPE_SCART
TV input type: the TV input service represents a SCART port.
Constant Value: 1003 (0x000003eb)
int TYPE_SVIDEO
TV input type: the TV input service represents a SVIDEO port.
Constant Value: 1002 (0x000003ea)
int TYPE_TUNER
TV input type: the TV input service is a tuner which provides channels.
Constant Value: 0 (0x00000000)
int TYPE_VGA
TV input type: the TV input service represents a VGA port.
Constant Value: 1005 (0x000003ed)
boolean canRecord ()
Returns true
if this TV input can record TV programs, false
otherwise.
Returns | |
---|---|
boolean |
Intent createSettingsIntent ()
Returns an intent to start the settings activity for this TV input.
Returns | |
---|---|
Intent |
Intent createSetupIntent ()
Returns an intent to start the setup activity for this TV input.
Returns | |
---|---|
Intent |
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(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. |
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:
x
, x.equals(x)
should return
true
.
x
and y
, x.equals(y)
should return true
if and only if
y.equals(x)
returns true
.
x
, y
, and z
, if
x.equals(y)
returns true
and
y.equals(z)
returns true
, then
x.equals(z)
should return true
.
x
and y
, multiple invocations of
x.equals(y)
consistently return true
or consistently return false
, provided no
information used in equals
comparisons on the
objects is modified.
x
,
x.equals(null)
should return false
.
The equals
method for class Object
implements
the most discriminating possible equivalence relation on objects;
that is, for any non-null reference values x
and
y
, this method returns true
if and only
if x
and y
refer to the same object
(x == y
has the value true
).
Note that it is generally necessary to override the hashCode
method whenever this method is overridden, so as to maintain the
general contract for the hashCode
method, which states
that equal objects must have equal hash codes.
Parameters | |
---|---|
o |
Object :
the reference object with which to compare. |
Returns | |
---|---|
boolean |
true if this object is the same as the obj
argument; false otherwise. |
Bundle getExtras ()
Returns domain-specific extras associated with this TV input.
Returns | |
---|---|
Bundle |
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 |
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 null if the parent input is
not specified.
|
ServiceInfo getServiceInfo ()
Returns the information of the service that implements this TV input.
Returns | |
---|---|
ServiceInfo |
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 |
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:
hashCode
method
must consistently return the same integer, provided no information
used in equals
comparisons on the object is modified.
This integer need not remain consistent from one execution of an
application to another execution of the same application.
equals(Object)
method, then calling the hashCode
method on each of
the two objects must produce the same integer result.
equals(java.lang.Object)
method, then calling the hashCode
method 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.
As much as is reasonably practical, the hashCode method defined by
class Object
does return distinct integers for distinct
objects. (This is typically implemented by converting the internal
address of the object into an integer, but this implementation
technique is not required by the
JavaTM programming language.)
Returns | |
---|---|
int |
a hash code value for this object. |
boolean isHidden (Context context)
Checks if this TV input is marked hidden by the user in the settings.
Parameters | |
---|---|
context |
Context :
Supplies a Context used to check if this TV input is hidden. |
Returns | |
---|---|
boolean |
true if the user marked this TV input hidden in settings. false
otherwise.
|
boolean isPassthroughInput ()
Returns true
if this TV input is pass-though which does not have any real channels in
TvProvider. false
otherwise.
Returns | |
---|---|
boolean |
CharSequence loadCustomLabel (Context context)
Loads the custom label set by user in settings.
Parameters | |
---|---|
context |
Context :
Supplies a Context used to load the custom label. |
Returns | |
---|---|
CharSequence |
a CharSequence containing the TV input's custom label. null if there is no
custom label.
|
Drawable loadIcon (Context context)
Loads the user-displayed icon for this TV input.
Parameters | |
---|---|
context |
Context :
Supplies a Context used to load the icon. |
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, null is returned.
|
CharSequence loadLabel (Context context)
Loads the user-displayed label for this TV input.
Parameters | |
---|---|
context |
Context :
Supplies a Context used to load the label. |
Returns | |
---|---|
CharSequence |
a CharSequence containing the TV input's label. If the TV input does not have a label, its name is returned. |
String toString ()
Returns a string representation of the object. In general, the
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
Returns | |
---|---|
String |
a string representation of the object. |
void writeToParcel (Parcel dest, int flags)
Used to package this object into a Parcel
.
Parameters | |
---|---|
dest |
Parcel :
The Parcel to be written. |
flags |
int :
The flags used for parceling.
|