public final class TvInputInfo extends Object implements Parcelable
Modifier and Type | Class and Description |
---|---|
static class |
TvInputInfo.Builder
A convenience builder for creating
TvInputInfo objects. |
static class |
TvInputInfo.TvInputSettings
Utility class for putting and getting settings for TV input.
|
static interface |
TvInputInfo.Type |
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<TvInputInfo> |
CREATOR |
static 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. |
static int |
TYPE_COMPONENT
TV input type: the TV input service represents a component port.
|
static int |
TYPE_COMPOSITE
TV input type: the TV input service represents a composite port.
|
static int |
TYPE_DISPLAY_PORT
TV input type: the TV input service represents a display port.
|
static int |
TYPE_DVI
TV input type: the TV input service represents a DVI port.
|
static int |
TYPE_HDMI
TV input type: the TV input service is HDMI.
|
static int |
TYPE_OTHER
TV input type: a generic hardware TV input type.
|
static int |
TYPE_SCART
TV input type: the TV input service represents a SCART port.
|
static int |
TYPE_SVIDEO
TV input type: the TV input service represents a SVIDEO port.
|
static int |
TYPE_TUNER
TV input type: the TV input service is a tuner which provides channels.
|
static int |
TYPE_VGA
TV input type: the TV input service represents a VGA port.
|
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Modifier and Type | Method and Description |
---|---|
boolean |
canRecord()
Returns
true if this TV input can record TV programs, false otherwise. |
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.
|
static TvInputInfo |
createTvInputInfo(Context context,
ResolveInfo service,
HdmiDeviceInfo hdmiDeviceInfo,
String parentId,
int labelRes,
Icon icon)
Deprecated.
Use
TvInputInfo.Builder instead. |
static TvInputInfo |
createTvInputInfo(Context context,
ResolveInfo service,
HdmiDeviceInfo hdmiDeviceInfo,
String parentId,
String label,
Uri iconUri)
Deprecated.
Use
TvInputInfo.Builder instead. |
static TvInputInfo |
createTvInputInfo(Context context,
ResolveInfo service,
TvInputHardwareInfo hardwareInfo,
int labelRes,
Icon icon)
Deprecated.
Use
TvInputInfo.Builder instead. |
static TvInputInfo |
createTvInputInfo(Context context,
ResolveInfo service,
TvInputHardwareInfo hardwareInfo,
String label,
Uri iconUri)
Deprecated.
Use
TvInputInfo.Builder instead. |
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.
|
ComponentName |
getComponent()
Returns the component of the service that implements this TV input.
|
Bundle |
getExtras()
Returns domain-specific extras associated with this TV input.
|
HdmiDeviceInfo |
getHdmiDeviceInfo()
Returns the HDMI device information of 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 |
isConnectedToHdmiSwitch()
Returns
true , if a CEC device for this TV input is connected to an HDMI switch, i.e.,
the device isn't directly connected to a HDMI port. |
boolean |
isHardwareInput()
Returns
true if this TV input represents a hardware device. |
boolean |
isHidden(Context context)
Checks if this TV input is marked hidden by the user in the settings.
|
boolean |
isPassthroughInput()
Returns
true if this TV input is pass-though which does not have any real channels in
TvProvider. |
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.
|
Drawable |
loadIcon(Context context,
int state)
Loads the user-displayed icon for this TV input per input state.
|
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
Parcel . |
public static final int TYPE_TUNER
public static final int TYPE_OTHER
public static final int TYPE_COMPOSITE
public static final int TYPE_SVIDEO
public static final int TYPE_SCART
public static final int TYPE_COMPONENT
public static final int TYPE_VGA
public static final int TYPE_DVI
public static final int TYPE_HDMI
public static final int TYPE_DISPLAY_PORT
public static final String EXTRA_INPUT_ID
createSetupIntent()
to
supply the ID of a specific TV input to set up.public static final Parcelable.Creator<TvInputInfo> CREATOR
@Deprecated public static TvInputInfo createTvInputInfo(Context context, ResolveInfo service, HdmiDeviceInfo hdmiDeviceInfo, String parentId, String label, Uri iconUri) throws XmlPullParserException, IOException
TvInputInfo.Builder
instead.service
- The ResolveInfo returned from the package manager about this TV input service.hdmiDeviceInfo
- The HdmiDeviceInfo for a HDMI CEC logical device.parentId
- The ID of this TV input's parent input. null
if none exists.label
- The label of this TvInputInfo. If it is null
or empty, service
label will be loaded.iconUri
- The Uri
to load the icon image. See
ContentResolver.openInputStream(android.net.Uri)
. If it is null
,
the application icon of service
will be loaded.XmlPullParserException
IOException
@Deprecated public static TvInputInfo createTvInputInfo(Context context, ResolveInfo service, HdmiDeviceInfo hdmiDeviceInfo, String parentId, int labelRes, Icon icon) throws XmlPullParserException, IOException
TvInputInfo.Builder
instead.service
- The ResolveInfo returned from the package manager about this TV input service.hdmiDeviceInfo
- The HdmiDeviceInfo for a HDMI CEC logical device.parentId
- The ID of this TV input's parent input. null
if none exists.labelRes
- The label resource ID of this TvInputInfo. If it is 0
,
service
label will be loaded.icon
- The Icon
to load the icon image. If it is
null
, the application icon of service
will be loaded.XmlPullParserException
IOException
@Deprecated public static TvInputInfo createTvInputInfo(Context context, ResolveInfo service, TvInputHardwareInfo hardwareInfo, String label, Uri iconUri) throws XmlPullParserException, IOException
TvInputInfo.Builder
instead.service
- The ResolveInfo returned from the package manager about this TV input service.hardwareInfo
- The TvInputHardwareInfo for a TV input hardware device.label
- The label of this TvInputInfo. If it is null
or empty, service
label will be loaded.iconUri
- The Uri
to load the icon image. See
ContentResolver.openInputStream(android.net.Uri)
. If it is null
,
the application icon of service
will be loaded.XmlPullParserException
IOException
@Deprecated public static TvInputInfo createTvInputInfo(Context context, ResolveInfo service, TvInputHardwareInfo hardwareInfo, int labelRes, Icon icon) throws XmlPullParserException, IOException
TvInputInfo.Builder
instead.service
- The ResolveInfo returned from the package manager about this TV input service.hardwareInfo
- The TvInputHardwareInfo for a TV input hardware device.labelRes
- The label resource ID of this TvInputInfo. If it is 0
,
service
label will be loaded.icon
- The Icon
to load the icon image. If it is
null
, the application icon of service
will be loaded.XmlPullParserException
IOException
public String getId()
public String getParentId()
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.
null
if the parent input is
not specified.public ServiceInfo getServiceInfo()
public ComponentName getComponent()
public Intent createSetupIntent()
public Intent createSettingsIntent()
public int getType()
public int getTunerCount()
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.
public boolean canRecord()
true
if this TV input can record TV programs, false
otherwise.public Bundle getExtras()
public HdmiDeviceInfo getHdmiDeviceInfo()
public boolean isPassthroughInput()
true
if this TV input is pass-though which does not have any real channels in
TvProvider. false
otherwise.public boolean isHardwareInput()
true
if this TV input represents a hardware device. (e.g. built-in tuner,
HDMI1) false
otherwise.public boolean isConnectedToHdmiSwitch()
true
, if a CEC device for this TV input is connected to an HDMI switch, i.e.,
the device isn't directly connected to a HDMI port.public boolean isHidden(Context context)
context
- Supplies a Context
used to check if this TV input is hidden.true
if the user marked this TV input hidden in settings. false
otherwise.public CharSequence loadLabel(Context context)
context
- Supplies a Context
used to load the label.public CharSequence loadCustomLabel(Context context)
context
- Supplies a Context
used to load the custom label.null
if there is no
custom label.public Drawable loadIcon(Context context)
context
- Supplies a Context
used to load the icon.null
is returned.public Drawable loadIcon(Context context, int state)
context
- Supplies a Context
used to load the icon.state
- The input state. Should be one of the followings.
TvInputManager.INPUT_STATE_CONNECTED
,
TvInputManager.INPUT_STATE_CONNECTED_STANDBY
and
TvInputManager.INPUT_STATE_DISCONNECTED
.null
if such
an icon is not defined.public int describeContents()
Parcelable
Parcelable.writeToParcel(Parcel, int)
,
the return value of this method must include the
Parcelable.CONTENTS_FILE_DESCRIPTOR
bit.describeContents
in interface Parcelable
Parcelable.CONTENTS_FILE_DESCRIPTOR
public int hashCode()
Object
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.
Object.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.)
hashCode
in class Object
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
public boolean equals(Object o)
Object
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.
equals
in class Object
o
- the reference object with which to compare.true
if this object is the same as the obj
argument; false
otherwise.Object.hashCode()
,
HashMap
public String toString()
Object
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())
public void writeToParcel(Parcel dest, int flags)
Parcel
.writeToParcel
in interface Parcelable
dest
- The Parcel
to be written.flags
- The flags used for parceling.