public class HdmiDeviceInfo extends Object implements Parcelable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static int |
ADDR_INTERNAL
Logical address used to indicate the source comes from internal device.
|
static Parcelable.Creator<HdmiDeviceInfo> |
CREATOR
A helper class to deserialize
HdmiDeviceInfo for a parcel. |
static int |
DEVICE_AUDIO_SYSTEM
Audio system device type.
|
static int |
DEVICE_INACTIVE |
static int |
DEVICE_PLAYBACK
Playback device type.
|
static int |
DEVICE_PURE_CEC_SWITCH |
static int |
DEVICE_RECORDER
Recording device type.
|
static int |
DEVICE_RESERVED
Device type reserved for future usage.
|
static int |
DEVICE_TUNER
Tuner device type.
|
static int |
DEVICE_TV
TV device type.
|
static int |
DEVICE_VIDEO_PROCESSOR |
static int |
ID_INVALID
Invalid device ID
|
static HdmiDeviceInfo |
INACTIVE_DEVICE
Device info used to indicate an inactivated device.
|
static int |
PATH_INTERNAL
Physical address used to indicate the source comes from internal device.
|
static int |
PATH_INVALID
Invalid physical address (routing path)
|
static int |
PORT_INVALID
Invalid port ID
|
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
HdmiDeviceInfo()
Constructor.
|
HdmiDeviceInfo(int physicalAddress,
int portId)
Constructor.
|
HdmiDeviceInfo(int physicalAddress,
int portId,
int adopterId,
int deviceId)
Constructor.
|
HdmiDeviceInfo(int logicalAddress,
int physicalAddress,
int portId,
int deviceType,
int vendorId,
String displayName)
Constructor.
|
HdmiDeviceInfo(int logicalAddress,
int physicalAddress,
int portId,
int deviceType,
int vendorId,
String displayName,
int powerStatus)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
describeContents()
Describes the kinds of special objects contained in this Parcelable's marshalled
representation.
|
boolean |
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
int |
getAdopterId()
Returns MHL adopter id.
|
int |
getDeviceId()
Returns MHL device id.
|
int |
getDevicePowerStatus()
Returns device's power status.
|
int |
getDeviceType()
Returns CEC type of the device.
|
String |
getDisplayName()
Returns display (OSD) name of the device.
|
int |
getId()
Returns the id of the device.
|
int |
getLogicalAddress()
Returns the CEC logical address of the device.
|
int |
getPhysicalAddress()
Returns the physical address of the device.
|
int |
getPortId()
Returns the port ID.
|
int |
getVendorId()
Returns vendor id of the device.
|
static int |
idForCecDevice(int address)
Returns the id to be used for CEC device.
|
static int |
idForHardware(int portId)
Returns the id to be used for hardware port.
|
static int |
idForMhlDevice(int portId)
Returns the id to be used for MHL device.
|
boolean |
isCecDevice()
Returns
true if the device represents an HDMI-CEC device. |
boolean |
isInactivated()
Return
true if the device represents an inactivated device that relinquishes
its status as active source by <Active Source> (HDMI-CEC) or Content-off (MHL). |
boolean |
isMhlDevice()
Returns
true if the device represents an MHL device. |
boolean |
isSourceType()
Returns
true if the device is of a type that can be an input source. |
String |
toString()
Returns a string representation of the object.
|
void |
writeToParcel(Parcel dest,
int flags)
Serializes this object into a
Parcel . |
public static final int DEVICE_TV
public static final int DEVICE_RECORDER
public static final int DEVICE_RESERVED
public static final int DEVICE_TUNER
public static final int DEVICE_PLAYBACK
public static final int DEVICE_AUDIO_SYSTEM
public static final int DEVICE_PURE_CEC_SWITCH
public static final int DEVICE_VIDEO_PROCESSOR
public static final int DEVICE_INACTIVE
public static final int ADDR_INTERNAL
public static final int PATH_INTERNAL
public static final int PATH_INVALID
public static final int PORT_INVALID
public static final int ID_INVALID
public static final HdmiDeviceInfo INACTIVE_DEVICE
public static final Parcelable.Creator<HdmiDeviceInfo> CREATOR
HdmiDeviceInfo
for a parcel.public HdmiDeviceInfo(int logicalAddress, int physicalAddress, int portId, int deviceType, int vendorId, String displayName, int powerStatus)
logicalAddress
- logical address of HDMI-CEC devicephysicalAddress
- physical address of HDMI-CEC deviceportId
- HDMI port ID (1 for HDMI1)deviceType
- type of devicevendorId
- vendor id of device. Used for vendor specific command.displayName
- name of devicepowerStatus
- device power statuspublic HdmiDeviceInfo(int logicalAddress, int physicalAddress, int portId, int deviceType, int vendorId, String displayName)
logicalAddress
- logical address of HDMI-CEC devicephysicalAddress
- physical address of HDMI-CEC deviceportId
- HDMI port ID (1 for HDMI1)deviceType
- type of devicevendorId
- vendor id of device. Used for vendor specific command.displayName
- name of devicepublic HdmiDeviceInfo(int physicalAddress, int portId)
physicalAddress
- physical address of the portportId
- HDMI port ID (1 for HDMI1)public HdmiDeviceInfo(int physicalAddress, int portId, int adopterId, int deviceId)
physicalAddress
- physical address of HDMI deviceportId
- portId HDMI port ID (1 for HDMI1)adopterId
- adopter id of MHLdeviceId
- device id of MHLpublic HdmiDeviceInfo()
public int getId()
public static int idForCecDevice(int address)
address
- logical address of CEC devicepublic static int idForMhlDevice(int portId)
portId
- port which the MHL device is connected topublic static int idForHardware(int portId)
portId
- port idpublic int getLogicalAddress()
public int getPhysicalAddress()
public int getPortId()
public int getDeviceType()
DEVICE_TV
and DEVICE_INACTIVE
.public int getDevicePowerStatus()
public int getDeviceId()
public int getAdopterId()
public boolean isSourceType()
true
if the device is of a type that can be an input source.public boolean isCecDevice()
true
if the device represents an HDMI-CEC device. false
if the device
is either MHL or other device.public boolean isMhlDevice()
true
if the device represents an MHL device. false
if the device is
either CEC or other device.public boolean isInactivated()
true
if the device represents an inactivated device that relinquishes
its status as active source by <Active Source> (HDMI-CEC) or Content-off (MHL).public String getDisplayName()
public int getVendorId()
public int describeContents()
describeContents
in interface Parcelable
Parcelable.CONTENTS_FILE_DESCRIPTOR
public void writeToParcel(Parcel dest, int flags)
Parcel
.writeToParcel
in interface Parcelable
dest
- The Parcel in which the object should be written.flags
- Additional flags about how the object should be written. May be 0 or
Parcelable.PARCELABLE_WRITE_RETURN_VALUE
.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 boolean equals(Object obj)
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
obj
- the reference object with which to compare.true
if this object is the same as the obj
argument; false
otherwise.Object.hashCode()
,
HashMap