Fields Summary |
---|
public static final int | DEVICE_TVTV device type. |
public static final int | DEVICE_RECORDERRecording device type. |
public static final int | DEVICE_RESERVEDDevice type reserved for future usage. |
public static final int | DEVICE_TUNERTuner device type. |
public static final int | DEVICE_PLAYBACKPlayback device type. |
public static final int | DEVICE_AUDIO_SYSTEMAudio system device type. |
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_INTERNALLogical address used to indicate the source comes from internal device. The logical address
of TV(0) is used. |
public static final int | PATH_INTERNALPhysical address used to indicate the source comes from internal device. The physical address
of TV(0) is used. |
public static final int | PATH_INVALIDInvalid physical address (routing path) |
public static final int | PORT_INVALIDInvalid port ID |
public static final int | ID_INVALIDInvalid device ID |
public static final HdmiDeviceInfo | INACTIVE_DEVICEDevice info used to indicate an inactivated device. |
private static final int | HDMI_DEVICE_TYPE_CEC |
private static final int | HDMI_DEVICE_TYPE_MHL |
private static final int | HDMI_DEVICE_TYPE_HARDWARE |
private static final int | HDMI_DEVICE_TYPE_INACTIVE |
private static final int | ID_OFFSET_CEC |
private static final int | ID_OFFSET_MHL |
private static final int | ID_OFFSET_HARDWARE |
private final int | mId |
private final int | mHdmiDeviceType |
private final int | mPhysicalAddress |
private final int | mPortId |
private final int | mLogicalAddress |
private final int | mDeviceType |
private final int | mVendorId |
private final String | mDisplayName |
private final int | mDevicePowerStatus |
private final int | mDeviceId |
private final int | mAdopterId |
public static final Parcelable.Creator | CREATORA helper class to deserialize {@link HdmiDeviceInfo} for a parcel. |
Constructors Summary |
---|
public HdmiDeviceInfo(int logicalAddress, int physicalAddress, int portId, int deviceType, int vendorId, String displayName, int powerStatus)Constructor. Used to initialize the instance for CEC device.
mHdmiDeviceType = HDMI_DEVICE_TYPE_CEC;
mPhysicalAddress = physicalAddress;
mPortId = portId;
mId = idForCecDevice(logicalAddress);
mLogicalAddress = logicalAddress;
mDeviceType = deviceType;
mVendorId = vendorId;
mDevicePowerStatus = powerStatus;
mDisplayName = displayName;
mDeviceId = -1;
mAdopterId = -1;
|
public HdmiDeviceInfo(int logicalAddress, int physicalAddress, int portId, int deviceType, int vendorId, String displayName)Constructor. Used to initialize the instance for CEC device.
this(logicalAddress, physicalAddress, portId, deviceType,
vendorId, displayName, HdmiControlManager.POWER_STATUS_UNKNOWN);
|
public HdmiDeviceInfo(int physicalAddress, int portId)Constructor. Used to initialize the instance for device representing hardware port.
mHdmiDeviceType = HDMI_DEVICE_TYPE_HARDWARE;
mPhysicalAddress = physicalAddress;
mPortId = portId;
mId = idForHardware(portId);
mLogicalAddress = -1;
mDeviceType = DEVICE_RESERVED;
mVendorId = 0;
mDevicePowerStatus = HdmiControlManager.POWER_STATUS_UNKNOWN;
mDisplayName = "HDMI" + portId;
mDeviceId = -1;
mAdopterId = -1;
|
public HdmiDeviceInfo(int physicalAddress, int portId, int adopterId, int deviceId)Constructor. Used to initialize the instance for MHL device.
mHdmiDeviceType = HDMI_DEVICE_TYPE_MHL;
mPhysicalAddress = physicalAddress;
mPortId = portId;
mId = idForMhlDevice(portId);
mLogicalAddress = -1;
mDeviceType = DEVICE_RESERVED;
mVendorId = 0;
mDevicePowerStatus = HdmiControlManager.POWER_STATUS_UNKNOWN;
mDisplayName = "Mobile";
mDeviceId = adopterId;
mAdopterId = deviceId;
|
public HdmiDeviceInfo()Constructor. Used to initialize the instance representing an inactivated device.
Can be passed input change listener to indicate the active source yielded
its status, hence the listener should take an appropriate action such as
switching to other input.
mHdmiDeviceType = HDMI_DEVICE_TYPE_INACTIVE;
mPhysicalAddress = PATH_INVALID;
mId = ID_INVALID;
mLogicalAddress = -1;
mDeviceType = DEVICE_INACTIVE;
mPortId = PORT_INVALID;
mDevicePowerStatus = HdmiControlManager.POWER_STATUS_UNKNOWN;
mDisplayName = "Inactive";
mVendorId = 0;
mDeviceId = -1;
mAdopterId = -1;
|
Methods Summary |
---|
public int | describeContents()Describes the kinds of special objects contained in this Parcelable's marshalled
representation.
return 0;
|
public boolean | equals(java.lang.Object obj)
if (!(obj instanceof HdmiDeviceInfo)) {
return false;
}
HdmiDeviceInfo other = (HdmiDeviceInfo) obj;
return mHdmiDeviceType == other.mHdmiDeviceType
&& mPhysicalAddress == other.mPhysicalAddress
&& mPortId == other.mPortId
&& mLogicalAddress == other.mLogicalAddress
&& mDeviceType == other.mDeviceType
&& mVendorId == other.mVendorId
&& mDevicePowerStatus == other.mDevicePowerStatus
&& mDisplayName.equals(other.mDisplayName)
&& mDeviceId == other.mDeviceId
&& mAdopterId == other.mAdopterId;
|
public int | getAdopterId()Returns MHL adopter id. Return -1 for non-MHL device.
return mAdopterId;
|
public int | getDeviceId()Returns MHL device id. Return -1 for non-MHL device.
return mDeviceId;
|
public int | getDevicePowerStatus()Returns device's power status. It should be one of the following values.
- {@link HdmiControlManager#POWER_STATUS_ON}
- {@link HdmiControlManager#POWER_STATUS_STANDBY}
- {@link HdmiControlManager#POWER_STATUS_TRANSIENT_TO_ON}
- {@link HdmiControlManager#POWER_STATUS_TRANSIENT_TO_STANDBY}
- {@link HdmiControlManager#POWER_STATUS_UNKNOWN}
return mDevicePowerStatus;
|
public int | getDeviceType()Returns CEC type of the device. For more details, refer constants between {@link #DEVICE_TV}
and {@link #DEVICE_INACTIVE}.
return mDeviceType;
|
public java.lang.String | getDisplayName()Returns display (OSD) name of the device.
return mDisplayName;
|
public int | getId()Returns the id of the device.
return mId;
|
public int | getLogicalAddress()Returns the CEC logical address of the device.
return mLogicalAddress;
|
public int | getPhysicalAddress()Returns the physical address of the device.
return mPhysicalAddress;
|
public int | getPortId()Returns the port ID.
return mPortId;
|
public int | getVendorId()Returns vendor id of the device. Vendor id is used to distinguish devices built by other
manufactures. This is required for vendor-specific command on CEC standard.
return mVendorId;
|
public static int | idForCecDevice(int address)Returns the id to be used for CEC device.
// The id is generated based on the logical address.
return ID_OFFSET_CEC + address;
|
public static int | idForHardware(int portId)Returns the id to be used for hardware port.
return ID_OFFSET_HARDWARE + portId;
|
public static int | idForMhlDevice(int portId)Returns the id to be used for MHL device.
// The id is generated based on the port id since there can be only one MHL device per port.
return ID_OFFSET_MHL + portId;
|
public boolean | isCecDevice()Returns {@code true} if the device represents an HDMI-CEC device. {@code false} if the device
is either MHL or other device.
return mHdmiDeviceType == HDMI_DEVICE_TYPE_CEC;
|
public boolean | isInactivated()Return {@code true} if the device represents an inactivated device that relinquishes
its status as active source by <Active Source> (HDMI-CEC) or Content-off (MHL).
return mHdmiDeviceType == HDMI_DEVICE_TYPE_INACTIVE;
|
public boolean | isMhlDevice()Returns {@code true} if the device represents an MHL device. {@code false} if the device is
either CEC or other device.
return mHdmiDeviceType == HDMI_DEVICE_TYPE_MHL;
|
public boolean | isSourceType()Returns {@code true} if the device is of a type that can be an input source.
if (isCecDevice()) {
return mDeviceType == DEVICE_PLAYBACK
|| mDeviceType == DEVICE_RECORDER
|| mDeviceType == DEVICE_TUNER;
} else if (isMhlDevice()) {
return true;
} else {
return false;
}
|
public java.lang.String | toString()
StringBuffer s = new StringBuffer();
switch (mHdmiDeviceType) {
case HDMI_DEVICE_TYPE_CEC:
s.append("CEC: ");
s.append("logical_address: ").append(String.format("0x%02X", mLogicalAddress));
s.append(" ");
s.append("device_type: ").append(mDeviceType).append(" ");
s.append("vendor_id: ").append(mVendorId).append(" ");
s.append("display_name: ").append(mDisplayName).append(" ");
s.append("power_status: ").append(mDevicePowerStatus).append(" ");
break;
case HDMI_DEVICE_TYPE_MHL:
s.append("MHL: ");
s.append("device_id: ").append(String.format("0x%04X", mDeviceId)).append(" ");
s.append("adopter_id: ").append(String.format("0x%04X", mAdopterId)).append(" ");
break;
case HDMI_DEVICE_TYPE_HARDWARE:
s.append("Hardware: ");
break;
case HDMI_DEVICE_TYPE_INACTIVE:
s.append("Inactivated: ");
break;
default:
return "";
}
s.append("physical_address: ").append(String.format("0x%04X", mPhysicalAddress));
s.append(" ");
s.append("port_id: ").append(mPortId);
return s.toString();
|
public void | writeToParcel(android.os.Parcel dest, int flags)Serializes this object into a {@link Parcel}.
dest.writeInt(mHdmiDeviceType);
dest.writeInt(mPhysicalAddress);
dest.writeInt(mPortId);
switch (mHdmiDeviceType) {
case HDMI_DEVICE_TYPE_CEC:
dest.writeInt(mLogicalAddress);
dest.writeInt(mDeviceType);
dest.writeInt(mVendorId);
dest.writeInt(mDevicePowerStatus);
dest.writeString(mDisplayName);
break;
case HDMI_DEVICE_TYPE_MHL:
dest.writeInt(mDeviceId);
dest.writeInt(mAdopterId);
break;
case HDMI_DEVICE_TYPE_INACTIVE:
// flow through
default:
// no-op
}
|