Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8bd2ec2f authored by Yan Han's avatar Yan Han
Browse files

Refactor HdmiDeviceInfo construction to use a builder

The builder makes it easier to copy a HdmiDeviceInfo with a few parameters changed.

All HdmiDeviceInfo constructors are replaced by static factory methods:
- The factory methods for MHL devices and hardware port devices retain their original parameters and use the builder internally.
- The factory method for CEC devices returns a builder; most parameters
are optional and are set individually.

Change-Id: I488cc76570eaa5433ae1d723dc19d65600d20319
Bug: 204854539
Test: atest com.android.server.hdmi
parent aec1bdf2
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -3835,7 +3835,7 @@ package android.hardware.hdmi {
  }
  public class HdmiDeviceInfo implements android.os.Parcelable {
    ctor public HdmiDeviceInfo();
    ctor @Deprecated public HdmiDeviceInfo();
    method public int describeContents();
    method public int getAdopterId();
    method public int getDeviceId();
@@ -3856,6 +3856,7 @@ package android.hardware.hdmi {
    method public boolean isSourceType();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int ADDR_INTERNAL = 0; // 0x0
    field public static final int ADDR_INVALID = -1; // 0xffffffff
    field @NonNull public static final android.os.Parcelable.Creator<android.hardware.hdmi.HdmiDeviceInfo> CREATOR;
    field public static final int DEVICE_AUDIO_SYSTEM = 5; // 0x5
    field public static final int DEVICE_INACTIVE = -1; // 0xffffffff
@@ -3869,6 +3870,7 @@ package android.hardware.hdmi {
    field public static final int PATH_INTERNAL = 0; // 0x0
    field public static final int PATH_INVALID = 65535; // 0xffff
    field public static final int PORT_INVALID = -1; // 0xffffffff
    field public static final int VENDOR_ID_UNKNOWN = 16777215; // 0xffffff
  }
  public final class HdmiHotplugEvent implements android.os.Parcelable {
+247 −114
Original line number Diff line number Diff line
@@ -68,6 +68,9 @@ public class HdmiDeviceInfo implements Parcelable {
     */
    public static final int ADDR_INTERNAL = 0;

    /** Invalid or uninitialized logical address */
    public static final int ADDR_INVALID = -1;

    /**
     * Physical address used to indicate the source comes from internal device. The physical address
     * of TV(0) is used.
@@ -83,7 +86,15 @@ public class HdmiDeviceInfo implements Parcelable {
    /** Invalid device ID */
    public static final int ID_INVALID = 0xFFFF;

    /** Device info used to indicate an inactivated device. */
    /** Unknown vendor ID */
    public static final int VENDOR_ID_UNKNOWN = 0xFFFFFF;

    /**
     * Instance that represents an inactive device.
     * Can be passed to an input change listener to indicate that the active source
     * yielded its status, allowing the listener to take an appropriate action such as
     * switching to another input.
     */
    public static final HdmiDeviceInfo INACTIVE_DEVICE = new HdmiDeviceInfo();

    private static final int HDMI_DEVICE_TYPE_CEC = 0;
@@ -109,7 +120,7 @@ public class HdmiDeviceInfo implements Parcelable {
    private final int mLogicalAddress;
    private final int mDeviceType;
    @HdmiCecVersion
    private final int mHdmiCecVersion;
    private final int mCecVersion;
    private final int mVendorId;
    private final String mDisplayName;
    private final int mDevicePowerStatus;
@@ -137,14 +148,22 @@ public class HdmiDeviceInfo implements Parcelable {
                            int powerStatus = source.readInt();
                            String displayName = source.readString();
                            int cecVersion = source.readInt();
                            return new HdmiDeviceInfo(logicalAddress, physicalAddress, portId,
                                    deviceType, vendorId, displayName, powerStatus, cecVersion);
                            return cecDeviceBuilder()
                                    .setLogicalAddress(logicalAddress)
                                    .setPhysicalAddress(physicalAddress)
                                    .setPortId(portId)
                                    .setDeviceType(deviceType)
                                    .setVendorId(vendorId)
                                    .setDisplayName(displayName)
                                    .setDevicePowerStatus(powerStatus)
                                    .setCecVersion(cecVersion)
                                    .build();
                        case HDMI_DEVICE_TYPE_MHL:
                            int deviceId = source.readInt();
                            int adopterId = source.readInt();
                            return new HdmiDeviceInfo(physicalAddress, portId, adopterId, deviceId);
                            return mhlDevice(physicalAddress, portId, adopterId, deviceId);
                        case HDMI_DEVICE_TYPE_HARDWARE:
                            return new HdmiDeviceInfo(physicalAddress, portId);
                            return hardwarePort(physicalAddress, portId);
                        case HDMI_DEVICE_TYPE_INACTIVE:
                            return HdmiDeviceInfo.INACTIVE_DEVICE;
                        default:
@@ -159,97 +178,80 @@ public class HdmiDeviceInfo implements Parcelable {
            };

    /**
     * Constructor. Used to initialize the instance for CEC device.
     * Constructor. Initializes the instance representing an inactive device.
     * Can be passed to an input change listener to indicate that the active source
     * yielded its status, allowing the listener to take an appropriate action such as
     * switching to another input.
     *
     * @param logicalAddress logical address of HDMI-CEC device
     * @param physicalAddress physical address of HDMI-CEC device
     * @param portId HDMI port ID (1 for HDMI1)
     * @param deviceType type of device
     * @param vendorId vendor id of device. Used for vendor specific command.
     * @param displayName name of device
     * @param powerStatus device power status
     * @hide
     * @deprecated Use {@link #INACTIVE_DEVICE} instead.
     */
    public HdmiDeviceInfo(int logicalAddress, int physicalAddress, int portId, int deviceType,
            int vendorId, String displayName, int powerStatus, int hdmiCecVersion) {
        mHdmiDeviceType = HDMI_DEVICE_TYPE_CEC;
        mPhysicalAddress = physicalAddress;
        mPortId = portId;
    @Deprecated
    public HdmiDeviceInfo() {
        mHdmiDeviceType = HDMI_DEVICE_TYPE_INACTIVE;
        mPhysicalAddress = PATH_INVALID;
        mId = ID_INVALID;

        mId = idForCecDevice(logicalAddress);
        mLogicalAddress = logicalAddress;
        mDeviceType = deviceType;
        mHdmiCecVersion = hdmiCecVersion;
        mVendorId = vendorId;
        mDevicePowerStatus = powerStatus;
        mDisplayName = displayName;
        mLogicalAddress = ADDR_INVALID;
        mDeviceType = DEVICE_INACTIVE;
        mCecVersion = HdmiControlManager.HDMI_CEC_VERSION_1_4_B;
        mPortId = PORT_INVALID;
        mDevicePowerStatus = HdmiControlManager.POWER_STATUS_UNKNOWN;
        mDisplayName = "Inactive";
        mVendorId = 0;

        mDeviceId = -1;
        mAdopterId = -1;
    }

    /**
     * Constructor. Used to initialize the instance for CEC device.
     * Converts an instance to a builder.
     *
     * @param logicalAddress logical address of HDMI-CEC device
     * @param physicalAddress physical address of HDMI-CEC device
     * @param portId HDMI port ID (1 for HDMI1)
     * @param deviceType type of device
     * @param vendorId vendor id of device. Used for vendor specific command.
     * @param displayName name of device
     * @param powerStatus device power status
     * @hide
     */
    public HdmiDeviceInfo(int logicalAddress, int physicalAddress, int portId, int deviceType,
            int vendorId, String displayName, int powerStatus) {
        this(logicalAddress, physicalAddress, portId, deviceType,
                vendorId, displayName, powerStatus, HdmiControlManager.HDMI_CEC_VERSION_1_4_B);
    }
    public Builder toBuilder() {
        return new Builder(this);
    }

    private HdmiDeviceInfo(Builder builder) {
        this.mHdmiDeviceType = builder.mHdmiDeviceType;
        this.mPhysicalAddress = builder.mPhysicalAddress;
        this.mPortId = builder.mPortId;
        this.mLogicalAddress = builder.mLogicalAddress;
        this.mDeviceType = builder.mDeviceType;
        this.mCecVersion = builder.mCecVersion;
        this.mVendorId = builder.mVendorId;
        this.mDisplayName = builder.mDisplayName;
        this.mDevicePowerStatus = builder.mDevicePowerStatus;
        this.mDeviceId = builder.mDeviceId;
        this.mAdopterId = builder.mAdopterId;

    /**
     * Constructor. Used to initialize the instance for CEC device.
     *
     * @param logicalAddress  logical address of HDMI-CEC device
     * @param physicalAddress physical address of HDMI-CEC device
     * @param portId          HDMI port ID (1 for HDMI1)
     * @param deviceType      type of device
     * @param vendorId        vendor id of device. Used for vendor specific command.
     * @param displayName     name of device
     * @hide
     */
    public HdmiDeviceInfo(int logicalAddress, int physicalAddress, int portId, int deviceType,
            int vendorId, String displayName) {
        this(logicalAddress, physicalAddress, portId, deviceType,
                vendorId, displayName, HdmiControlManager.POWER_STATUS_UNKNOWN,
                HdmiControlManager.HDMI_CEC_VERSION_1_4_B);
        switch (mHdmiDeviceType) {
            case HDMI_DEVICE_TYPE_MHL:
                this.mId = idForMhlDevice(mPortId);
                break;
            case HDMI_DEVICE_TYPE_HARDWARE:
                this.mId = idForHardware(mPortId);
                break;
            case HDMI_DEVICE_TYPE_CEC:
                this.mId = idForCecDevice(mLogicalAddress);
                break;
            case HDMI_DEVICE_TYPE_INACTIVE:
            default:
                this.mId = ID_INVALID;
        }
    }

    /**
     * Constructor. Used to initialize the instance for device representing hardware port.
     * Creates a Builder for an {@link HdmiDeviceInfo} representing a CEC device.
     *
     * @param physicalAddress physical address of the port
     * @param portId HDMI port ID (1 for HDMI1)
     * @hide
     */
    public HdmiDeviceInfo(int physicalAddress, int portId) {
        mHdmiDeviceType = HDMI_DEVICE_TYPE_HARDWARE;
        mPhysicalAddress = physicalAddress;
        mPortId = portId;

        mId = idForHardware(portId);
        mLogicalAddress = -1;
        mDeviceType = DEVICE_RESERVED;
        mHdmiCecVersion = HdmiControlManager.HDMI_CEC_VERSION_1_4_B;
        mVendorId = 0;
        mDevicePowerStatus = HdmiControlManager.POWER_STATUS_UNKNOWN;
        mDisplayName = "HDMI" + portId;

        mDeviceId = -1;
        mAdopterId = -1;
    public static Builder cecDeviceBuilder() {
        return new Builder(HDMI_DEVICE_TYPE_CEC);
    }

    /**
     * Constructor. Used to initialize the instance for MHL device.
     * Creates an {@link HdmiDeviceInfo} representing an MHL device.
     *
     * @param physicalAddress physical address of HDMI device
     * @param portId portId HDMI port ID (1 for HDMI1)
@@ -257,44 +259,32 @@ public class HdmiDeviceInfo implements Parcelable {
     * @param deviceId device id of MHL
     * @hide
     */
    public HdmiDeviceInfo(int physicalAddress, int portId, int adopterId, int deviceId) {
        mHdmiDeviceType = HDMI_DEVICE_TYPE_MHL;
        mPhysicalAddress = physicalAddress;
        mPortId = portId;

        mId = idForMhlDevice(portId);
        mLogicalAddress = -1;
        mDeviceType = DEVICE_RESERVED;
        mHdmiCecVersion = HdmiControlManager.HDMI_CEC_VERSION_1_4_B;
        mVendorId = 0;
        mDevicePowerStatus = HdmiControlManager.POWER_STATUS_UNKNOWN;
        mDisplayName = "Mobile";

        mDeviceId = adopterId;
        mAdopterId = deviceId;
    public static HdmiDeviceInfo mhlDevice(
            int physicalAddress, int portId, int adopterId, int deviceId) {
        return new Builder(HDMI_DEVICE_TYPE_MHL)
                .setPhysicalAddress(physicalAddress)
                .setPortId(portId)
                .setVendorId(0)
                .setDisplayName("Mobile")
                .setDeviceId(adopterId)
                .setAdopterId(deviceId)
                .build();
    }

    /**
     * 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.
     * Creates an {@link HdmiDeviceInfo} representing a hardware port.
     *
     * @param physicalAddress physical address of the port
     * @param portId HDMI port ID (1 for HDMI1)
     * @hide
     */
    public HdmiDeviceInfo() {
        mHdmiDeviceType = HDMI_DEVICE_TYPE_INACTIVE;
        mPhysicalAddress = PATH_INVALID;
        mId = ID_INVALID;

        mLogicalAddress = -1;
        mDeviceType = DEVICE_INACTIVE;
        mHdmiCecVersion = HdmiControlManager.HDMI_CEC_VERSION_1_4_B;
        mPortId = PORT_INVALID;
        mDevicePowerStatus = HdmiControlManager.POWER_STATUS_UNKNOWN;
        mDisplayName = "Inactive";
        mVendorId = 0;

        mDeviceId = -1;
        mAdopterId = -1;
    public static HdmiDeviceInfo hardwarePort(int physicalAddress, int portId) {
        return new Builder(HDMI_DEVICE_TYPE_HARDWARE)
                .setPhysicalAddress(physicalAddress)
                .setPortId(portId)
                .setVendorId(0)
                .setDisplayName("HDMI" + portId)
                .build();
    }

    /**
@@ -372,7 +362,7 @@ public class HdmiDeviceInfo implements Parcelable {
     */
    @HdmiCecVersion
    public int getCecVersion() {
        return mHdmiCecVersion;
        return mCecVersion;
    }

    /**
@@ -485,7 +475,7 @@ public class HdmiDeviceInfo implements Parcelable {
                dest.writeInt(mVendorId);
                dest.writeInt(mDevicePowerStatus);
                dest.writeString(mDisplayName);
                dest.writeInt(mHdmiCecVersion);
                dest.writeInt(mCecVersion);
                break;
            case HDMI_DEVICE_TYPE_MHL:
                dest.writeInt(mDeviceId);
@@ -508,7 +498,7 @@ public class HdmiDeviceInfo implements Parcelable {
                s.append("logical_address: ").append(String.format("0x%02X", mLogicalAddress));
                s.append(" ");
                s.append("device_type: ").append(mDeviceType).append(" ");
                s.append("cec_version: ").append(mHdmiCecVersion).append(" ");
                s.append("cec_version: ").append(mCecVersion).append(" ");
                s.append("vendor_id: ").append(mVendorId).append(" ");
                s.append("display_name: ").append(mDisplayName).append(" ");
                s.append("power_status: ").append(mDevicePowerStatus).append(" ");
@@ -546,7 +536,7 @@ public class HdmiDeviceInfo implements Parcelable {
                && mPortId == other.mPortId
                && mLogicalAddress == other.mLogicalAddress
                && mDeviceType == other.mDeviceType
                && mHdmiCecVersion == other.mHdmiCecVersion
                && mCecVersion == other.mCecVersion
                && mVendorId == other.mVendorId
                && mDevicePowerStatus == other.mDevicePowerStatus
                && mDisplayName.equals(other.mDisplayName)
@@ -562,11 +552,154 @@ public class HdmiDeviceInfo implements Parcelable {
                mPortId,
                mLogicalAddress,
                mDeviceType,
                mHdmiCecVersion,
                mCecVersion,
                mVendorId,
                mDevicePowerStatus,
                mDisplayName,
                mDeviceId,
                mAdopterId);
    }

    /**
     * Builder for {@link HdmiDeviceInfo} instances.
     *
     * @hide
     */
    public static final class Builder {
        // Required parameters
        private final int mHdmiDeviceType;

        // Common parameters
        private int mPhysicalAddress = PATH_INVALID;
        private int mPortId = PORT_INVALID;

        // CEC parameters
        private int mLogicalAddress = ADDR_INVALID;
        private int mDeviceType = DEVICE_RESERVED;
        @HdmiCecVersion
        private int mCecVersion = HdmiControlManager.HDMI_CEC_VERSION_1_4_B;
        private int mVendorId = VENDOR_ID_UNKNOWN;
        private String mDisplayName = "";
        private int mDevicePowerStatus = HdmiControlManager.POWER_STATUS_UNKNOWN;

        // MHL parameters
        private int mDeviceId = -1;
        private int mAdopterId = -1;

        private Builder(int hdmiDeviceType) {
            mHdmiDeviceType = hdmiDeviceType;
        }

        private Builder(@NonNull HdmiDeviceInfo hdmiDeviceInfo) {
            mHdmiDeviceType = hdmiDeviceInfo.mHdmiDeviceType;
            mPhysicalAddress = hdmiDeviceInfo.mPhysicalAddress;
            mPortId = hdmiDeviceInfo.mPortId;
            mLogicalAddress = hdmiDeviceInfo.mLogicalAddress;
            mDeviceType = hdmiDeviceInfo.mDeviceType;
            mCecVersion = hdmiDeviceInfo.mCecVersion;
            mVendorId = hdmiDeviceInfo.mVendorId;
            mDisplayName = hdmiDeviceInfo.mDisplayName;
            mDevicePowerStatus = hdmiDeviceInfo.mDevicePowerStatus;
            mDeviceId = hdmiDeviceInfo.mDeviceId;
            mAdopterId = hdmiDeviceInfo.mAdopterId;
        }

        /**
         * Create a new {@link HdmiDeviceInfo} object.
         */
        @NonNull
        public HdmiDeviceInfo build() {
            return new HdmiDeviceInfo(this);
        }

        /**
         * Sets the value for {@link #getPhysicalAddress()}.
         */
        @NonNull
        public Builder setPhysicalAddress(int physicalAddress) {
            mPhysicalAddress = physicalAddress;
            return this;
        }

        /**
         * Sets the value for {@link #getPortId()}.
         */
        @NonNull
        public Builder setPortId(int portId) {
            mPortId = portId;
            return this;
        }

        /**
         * Sets the value for {@link #getLogicalAddress()}.
         */
        @NonNull
        public Builder setLogicalAddress(int logicalAddress) {
            mLogicalAddress = logicalAddress;
            return this;
        }

        /**
         * Sets the value for {@link #getDeviceType()}.
         */
        @NonNull
        public Builder setDeviceType(int deviceType) {
            mDeviceType = deviceType;
            return this;
        }

        /**
         * Sets the value for {@link #getCecVersion()}.
         */
        @NonNull
        public Builder setCecVersion(int hdmiCecVersion) {
            mCecVersion = hdmiCecVersion;
            return this;
        }

        /**
         * Sets the value for {@link #getVendorId()}.
         */
        @NonNull
        public Builder setVendorId(int vendorId) {
            mVendorId = vendorId;
            return this;
        }

        /**
         * Sets the value for {@link #getDisplayName()}.
         */
        @NonNull
        public Builder setDisplayName(@NonNull String displayName) {
            mDisplayName = displayName;
            return this;
        }

        /**
         * Sets the value for {@link #getDevicePowerStatus()}.
         */
        @NonNull
        public Builder setDevicePowerStatus(int devicePowerStatus) {
            mDevicePowerStatus = devicePowerStatus;
            return this;
        }

        /**
         * Sets the value for {@link #getDeviceId()}.
         */
        @NonNull
        public Builder setDeviceId(int deviceId) {
            mDeviceId = deviceId;
            return this;
        }

        /**
         * Sets the value for {@link #getAdopterId()}.
         */
        @NonNull
        public Builder setAdopterId(int adopterId) {
            mAdopterId = adopterId;
            return this;
        }
    }
}
+23 −35
Original line number Diff line number Diff line
@@ -43,44 +43,32 @@ public class HdmiDeviceInfoTest {
        int adopterId = 2;

        new EqualsTester()
                .addEqualityGroup(new HdmiDeviceInfo())
                .addEqualityGroup(HdmiDeviceInfo.INACTIVE_DEVICE)
                .addEqualityGroup(
                        new HdmiDeviceInfo(phyAddr, portId), new HdmiDeviceInfo(phyAddr, portId))
                        HdmiDeviceInfo.hardwarePort(phyAddr, portId),
                        HdmiDeviceInfo.hardwarePort(phyAddr, portId))
                .addEqualityGroup(
                        new HdmiDeviceInfo(phyAddr, portId, adopterId, deviceId),
                        new HdmiDeviceInfo(phyAddr, portId, adopterId, deviceId))
                        HdmiDeviceInfo.mhlDevice(phyAddr, portId, adopterId, deviceId),
                        HdmiDeviceInfo.mhlDevice(phyAddr, portId, adopterId, deviceId))
                .addEqualityGroup(
                        new HdmiDeviceInfo(
                                logicalAddr, phyAddr, portId, deviceType, vendorId, displayName),
                        new HdmiDeviceInfo(
                                logicalAddr, phyAddr, portId, deviceType, vendorId, displayName))
                .addEqualityGroup(
                        new HdmiDeviceInfo(
                                logicalAddr,
                                phyAddr,
                                portId,
                                deviceType,
                                vendorId,
                                displayName,
                                powerStatus),
                        new HdmiDeviceInfo(
                                logicalAddr,
                                phyAddr,
                                portId,
                                deviceType,
                                vendorId,
                                displayName,
                                powerStatus))
                .addEqualityGroup(
                        new HdmiDeviceInfo(
                                logicalAddr,
                                phyAddr,
                                portId,
                                deviceType,
                                vendorId,
                                displayName,
                                powerStatus,
                                cecVersion))
                        HdmiDeviceInfo.cecDeviceBuilder()
                                .setLogicalAddress(logicalAddr)
                                .setPhysicalAddress(phyAddr)
                                .setPortId(portId)
                                .setDeviceType(deviceType)
                                .setVendorId(vendorId)
                                .setDisplayName(displayName)
                                .setDevicePowerStatus(powerStatus)
                                .setCecVersion(cecVersion).build(),
                        HdmiDeviceInfo.cecDeviceBuilder()
                                .setLogicalAddress(logicalAddr)
                                .setPhysicalAddress(phyAddr)
                                .setPortId(portId)
                                .setDeviceType(deviceType)
                                .setVendorId(vendorId)
                                .setDisplayName(displayName)
                                .setDevicePowerStatus(powerStatus)
                                .setCecVersion(cecVersion).build())
                .testEquals();
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ final class Constants {
    public static final int ADDR_BROADCAST = 15;

    /** Logical address used to indicate it is not initialized or invalid. */
    public static final int ADDR_INVALID = -1;
    public static final int ADDR_INVALID = HdmiDeviceInfo.ADDR_INVALID;

    /** Logical address used to indicate the source comes from internal device. */
    public static final int ADDR_INTERNAL = HdmiDeviceInfo.ADDR_INTERNAL;
@@ -243,7 +243,7 @@ final class Constants {
    static final int MESSAGE_CDC_MESSAGE = 0xF8;
    static final int MESSAGE_ABORT = 0xFF;

    static final int UNKNOWN_VENDOR_ID = 0xFFFFFF;
    static final int VENDOR_ID_UNKNOWN = HdmiDeviceInfo.VENDOR_ID_UNKNOWN;

    static final int TRUE = 1;
    static final int FALSE = 0;
+10 −3
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ final class DeviceDiscoveryAction extends HdmiCecFeatureAction {

        private int mPhysicalAddress = Constants.INVALID_PHYSICAL_ADDRESS;
        private int mPortId = Constants.INVALID_PORT_ID;
        private int mVendorId = Constants.UNKNOWN_VENDOR_ID;
        private int mVendorId = Constants.VENDOR_ID_UNKNOWN;
        private int mPowerStatus = HdmiControlManager.POWER_STATUS_UNKNOWN;
        private String mDisplayName = "";
        private int mDeviceType = HdmiDeviceInfo.DEVICE_INACTIVE;
@@ -87,8 +87,15 @@ final class DeviceDiscoveryAction extends HdmiCecFeatureAction {
        }

        private HdmiDeviceInfo toHdmiDeviceInfo() {
            return new HdmiDeviceInfo(mLogicalAddress, mPhysicalAddress, mPortId, mDeviceType,
                    mVendorId, mDisplayName, mPowerStatus);
            return  HdmiDeviceInfo.cecDeviceBuilder()
                    .setLogicalAddress(mLogicalAddress)
                    .setPhysicalAddress(mPhysicalAddress)
                    .setPortId(mPortId)
                    .setVendorId(mVendorId)
                    .setDeviceType(mDeviceType)
                    .setDisplayName(mDisplayName)
                    .setDevicePowerStatus(mPowerStatus)
                    .build();
        }
    }

Loading