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

Commit d708555b authored by Yan Han's avatar Yan Han Committed by Android (Google) Code Review
Browse files

Merge changes I958029a4,I45653246,I49161c8f,I1c862e86,I5e8c0bbe, ...

* changes:
  Add action to query <Set Audio Volume Level> support
  Add feature action for sending <Give Features>
  Update CEC network with feature support on receiving <Report Features>
  Create class for building and parsing <Report Features>
  Validate all messages on construction
  Keep DeviceFeatures updated in local devices.
  Add CEC feature tracking to HdmiDeviceInfo
  Refactor HdmiDeviceInfo construction to use a builder
parents accf0777 62086fda
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -3834,7 +3834,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();
@@ -3855,6 +3855,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
@@ -3868,6 +3869,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 {
+395 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.hardware.hdmi;

import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;

/**
 * Immutable class that stores support status for features in the [Device Features] operand.
 * Each feature may be supported, be not supported, or have an unknown support status.
 *
 * @hide
 */
public class DeviceFeatures {

    @IntDef({
            FEATURE_NOT_SUPPORTED,
            FEATURE_SUPPORTED,
            FEATURE_SUPPORT_UNKNOWN
    })
    public @interface FeatureSupportStatus {};

    public static final int FEATURE_NOT_SUPPORTED = 0;
    public static final int FEATURE_SUPPORTED = 1;
    public static final int FEATURE_SUPPORT_UNKNOWN = 2;

    /**
     * Instance representing no knowledge of any feature's support.
     */
    @NonNull
    public static final DeviceFeatures ALL_FEATURES_SUPPORT_UNKNOWN =
            new Builder(FEATURE_SUPPORT_UNKNOWN).build();

    /**
     * Instance representing no support for any feature.
     */
    @NonNull
    public static final DeviceFeatures NO_FEATURES_SUPPORTED =
            new Builder(FEATURE_NOT_SUPPORTED).build();

    @FeatureSupportStatus private final int mRecordTvScreenSupport;
    @FeatureSupportStatus private final int mSetOsdStringSupport;
    @FeatureSupportStatus private final int mDeckControlSupport;
    @FeatureSupportStatus private final int mSetAudioRateSupport;
    @FeatureSupportStatus private final int mArcTxSupport;
    @FeatureSupportStatus private final int mArcRxSupport;
    @FeatureSupportStatus private final int mSetAudioVolumeLevelSupport;

    private DeviceFeatures(@NonNull Builder builder) {
        this.mRecordTvScreenSupport = builder.mRecordTvScreenSupport;
        this.mSetOsdStringSupport = builder.mOsdStringSupport;
        this.mDeckControlSupport = builder.mDeckControlSupport;
        this.mSetAudioRateSupport = builder.mSetAudioRateSupport;
        this.mArcTxSupport = builder.mArcTxSupport;
        this.mArcRxSupport = builder.mArcRxSupport;
        this.mSetAudioVolumeLevelSupport = builder.mSetAudioVolumeLevelSupport;
    }

    /**
     * Converts an instance to a builder.
     */
    public Builder toBuilder() {
        return new Builder(this);
    }

    /**
     * Constructs an instance from a [Device Features] operand.
     *
     * Bit 7 of [Device Features] is currently ignored. It indicates whether the operand spans more
     * than one byte, but only the first byte contains information as of CEC 2.0.
     *
     * @param deviceFeaturesOperand The [Device Features] operand to parse.
     * @return Instance representing the [Device Features] operand.
     */
    @NonNull
    public static DeviceFeatures fromOperand(@NonNull byte[] deviceFeaturesOperand) {
        Builder builder = new Builder(FEATURE_SUPPORT_UNKNOWN);

        // Read feature support status from the bits of [Device Features]
        if (deviceFeaturesOperand.length >= 1) {
            byte b = deviceFeaturesOperand[0];
            builder
                    .setRecordTvScreenSupport(bitToFeatureSupportStatus(((b >> 6) & 1) == 1))
                    .setSetOsdStringSupport(bitToFeatureSupportStatus(((b >> 5) & 1) == 1))
                    .setDeckControlSupport(bitToFeatureSupportStatus(((b >> 4) & 1) == 1))
                    .setSetAudioRateSupport(bitToFeatureSupportStatus(((b >> 3) & 1) == 1))
                    .setArcTxSupport(bitToFeatureSupportStatus(((b >> 2) & 1) == 1))
                    .setArcRxSupport(bitToFeatureSupportStatus(((b >> 1) & 1) == 1))
                    .setSetAudioVolumeLevelSupport(bitToFeatureSupportStatus((b & 1) == 1));
        }
        return builder.build();
    }

    /**
     * Returns the input that is not {@link #FEATURE_SUPPORT_UNKNOWN}. If neither is equal to
     * {@link #FEATURE_SUPPORT_UNKNOWN}, returns the second input.
     */
    private static @FeatureSupportStatus int updateFeatureSupportStatus(
            @FeatureSupportStatus int oldStatus, @FeatureSupportStatus int newStatus) {
        if (newStatus == FEATURE_SUPPORT_UNKNOWN) {
            return oldStatus;
        } else {
            return newStatus;
        }
    }

    /**
     * Returns the [Device Features] operand corresponding to this instance.
     * {@link #FEATURE_SUPPORT_UNKNOWN} maps to 0, indicating no support.
     *
     * As of CEC 2.0, the returned byte array will always be of length 1.
     */
    @NonNull
    public byte[] toOperand() {
        byte result = 0;

        if (mRecordTvScreenSupport == FEATURE_SUPPORTED) result |= (byte) (1 << 6);
        if (mSetOsdStringSupport == FEATURE_SUPPORTED) result = (byte) (1 << 5);
        if (mDeckControlSupport == FEATURE_SUPPORTED) result = (byte) (1 << 4);
        if (mSetAudioRateSupport == FEATURE_SUPPORTED) result = (byte) (1 << 3);
        if (mArcTxSupport == FEATURE_SUPPORTED) result = (byte) (1 << 2);
        if (mArcRxSupport == FEATURE_SUPPORTED) result = (byte) (1 << 1);
        if (mSetAudioVolumeLevelSupport == FEATURE_SUPPORTED) result = (byte) 1;

        return new byte[]{ result };
    }

    @FeatureSupportStatus
    private static int bitToFeatureSupportStatus(boolean bit) {
        return bit ? FEATURE_SUPPORTED : FEATURE_NOT_SUPPORTED;
    }

    /**
     * Returns whether the device is a TV that supports <Record TV Screen>.
     */
    @FeatureSupportStatus
    public int getRecordTvScreenSupport() {
        return mRecordTvScreenSupport;
    }

    /**
     * Returns whether the device is a TV that supports <Set OSD String>.
     */
    @FeatureSupportStatus
    public int getSetOsdStringSupport() {
        return mSetOsdStringSupport;
    }

    /**
     * Returns whether the device supports being controlled by Deck Control.
     */
    @FeatureSupportStatus
    public int getDeckControlSupport() {
        return mDeckControlSupport;
    }

    /**
     * Returns whether the device is a Source that supports <Set Audio Rate>.
     */
    @FeatureSupportStatus
    public int getSetAudioRateSupport() {
        return mSetAudioRateSupport;
    }

    /**
     * Returns whether the device is a Sink that supports ARC Tx.
     */
    @FeatureSupportStatus
    public int getArcTxSupport() {
        return mArcTxSupport;
    }

    /**
     * Returns whether the device is a Source that supports ARC Rx.
     */
    @FeatureSupportStatus
    public int getArcRxSupport() {
        return mArcRxSupport;
    }

    /**
     * Returns whether the device supports <Set Audio Volume Level>.
     */
    @FeatureSupportStatus
    public int getSetAudioVolumeLevelSupport() {
        return mSetAudioVolumeLevelSupport;
    }

    @Override
    public boolean equals(@Nullable Object obj) {
        if (!(obj instanceof DeviceFeatures)) {
            return false;
        }

        DeviceFeatures other = (DeviceFeatures) obj;
        return mRecordTvScreenSupport == other.mRecordTvScreenSupport
                && mSetOsdStringSupport == other.mSetOsdStringSupport
                && mDeckControlSupport == other.mDeckControlSupport
                && mSetAudioRateSupport == other.mSetAudioRateSupport
                && mArcTxSupport == other.mArcTxSupport
                && mArcRxSupport == other.mArcRxSupport
                && mSetAudioVolumeLevelSupport == other.mSetAudioVolumeLevelSupport;
    }

    @Override
    public int hashCode() {
        return java.util.Objects.hash(
                mRecordTvScreenSupport,
                mSetOsdStringSupport,
                mDeckControlSupport,
                mSetAudioRateSupport,
                mArcTxSupport,
                mArcRxSupport,
                mSetAudioVolumeLevelSupport
        );
    }

    @NonNull
    @Override
    public String toString() {
        StringBuilder s = new StringBuilder();
        s.append("Device features: ");
        s.append("record_tv_screen: ")
                .append(featureSupportStatusToString(mRecordTvScreenSupport)).append(" ");
        s.append("set_osd_string: ")
                .append(featureSupportStatusToString(mSetOsdStringSupport)).append(" ");
        s.append("deck_control: ")
                .append(featureSupportStatusToString(mDeckControlSupport)).append(" ");
        s.append("set_audio_rate: ")
                .append(featureSupportStatusToString(mSetAudioRateSupport)).append(" ");
        s.append("arc_tx: ")
                .append(featureSupportStatusToString(mArcTxSupport)).append(" ");
        s.append("arc_rx: ")
                .append(featureSupportStatusToString(mArcRxSupport)).append(" ");
        s.append("set_audio_volume_level: ")
                .append(featureSupportStatusToString(mSetAudioVolumeLevelSupport)).append(" ");
        return s.toString();
    }

    @NonNull
    private static String featureSupportStatusToString(@FeatureSupportStatus int status) {
        switch (status) {
            case FEATURE_SUPPORTED:
                return "Y";
            case FEATURE_NOT_SUPPORTED:
                return "N";
            case FEATURE_SUPPORT_UNKNOWN:
            default:
                return "?";
        }
    }

    /**
     * Builder for {@link DeviceFeatures} instances.
     */
    public static final class Builder {
        @FeatureSupportStatus private int mRecordTvScreenSupport;
        @FeatureSupportStatus private int mOsdStringSupport;
        @FeatureSupportStatus private int mDeckControlSupport;
        @FeatureSupportStatus private int mSetAudioRateSupport;
        @FeatureSupportStatus private int mArcTxSupport;
        @FeatureSupportStatus private int mArcRxSupport;
        @FeatureSupportStatus private int mSetAudioVolumeLevelSupport;

        private Builder(@FeatureSupportStatus int defaultFeatureSupportStatus) {
            mRecordTvScreenSupport = defaultFeatureSupportStatus;
            mOsdStringSupport = defaultFeatureSupportStatus;
            mDeckControlSupport = defaultFeatureSupportStatus;
            mSetAudioRateSupport = defaultFeatureSupportStatus;
            mArcTxSupport = defaultFeatureSupportStatus;
            mArcRxSupport = defaultFeatureSupportStatus;
            mSetAudioVolumeLevelSupport = defaultFeatureSupportStatus;
        }

        private Builder(DeviceFeatures info) {
            mRecordTvScreenSupport = info.getRecordTvScreenSupport();
            mOsdStringSupport = info.getSetOsdStringSupport();
            mDeckControlSupport = info.getDeckControlSupport();
            mSetAudioRateSupport = info.getSetAudioRateSupport();
            mArcTxSupport = info.getArcTxSupport();
            mArcRxSupport = info.getArcRxSupport();
            mSetAudioVolumeLevelSupport = info.getSetAudioVolumeLevelSupport();
        }

        /**
         * Creates a new {@link DeviceFeatures} object.
         */
        public DeviceFeatures build() {
            return new DeviceFeatures(this);
        }

        /**
         * Sets the value for {@link #getRecordTvScreenSupport()}.
         */
        @NonNull
        public Builder setRecordTvScreenSupport(@FeatureSupportStatus int recordTvScreenSupport) {
            mRecordTvScreenSupport = recordTvScreenSupport;
            return this;
        }

        /**
         * Sets the value for {@link #getSetOsdStringSupport()}.
         */
        @NonNull
        public Builder setSetOsdStringSupport(@FeatureSupportStatus int setOsdStringSupport) {
            mOsdStringSupport = setOsdStringSupport;
            return this;
        }

        /**
         * Sets the value for {@link #getDeckControlSupport()}.
         */
        @NonNull
        public Builder setDeckControlSupport(@FeatureSupportStatus int deckControlSupport) {
            mDeckControlSupport = deckControlSupport;
            return this;
        }

        /**
         * Sets the value for {@link #getSetAudioRateSupport()}.
         */
        @NonNull
        public Builder setSetAudioRateSupport(@FeatureSupportStatus int setAudioRateSupport) {
            mSetAudioRateSupport = setAudioRateSupport;
            return this;
        }

        /**
         * Sets the value for {@link #getArcTxSupport()}.
         */
        @NonNull
        public Builder setArcTxSupport(@FeatureSupportStatus int arcTxSupport) {
            mArcTxSupport = arcTxSupport;
            return this;
        }

        /**
         * Sets the value for {@link #getArcRxSupport()}.
         */
        @NonNull
        public Builder setArcRxSupport(@FeatureSupportStatus int arcRxSupport) {
            mArcRxSupport = arcRxSupport;
            return this;
        }

        /**
         * Sets the value for {@link #getSetAudioRateSupport()}.
         */
        @NonNull
        public Builder setSetAudioVolumeLevelSupport(
                @FeatureSupportStatus int setAudioVolumeLevelSupport) {
            mSetAudioVolumeLevelSupport = setAudioVolumeLevelSupport;
            return this;
        }

        /**
         * Updates all fields with those in a 'new' instance of {@link DeviceFeatures}.
         * All fields are replaced with those in the new instance, except when the field is
         * {@link #FEATURE_SUPPORT_UNKNOWN} in the new instance.
         */
        @NonNull
        public Builder update(DeviceFeatures newDeviceFeatures) {
            mRecordTvScreenSupport = updateFeatureSupportStatus(mRecordTvScreenSupport,
                    newDeviceFeatures.getRecordTvScreenSupport());
            mOsdStringSupport = updateFeatureSupportStatus(mOsdStringSupport,
                    newDeviceFeatures.getSetOsdStringSupport());
            mDeckControlSupport = updateFeatureSupportStatus(mDeckControlSupport,
                    newDeviceFeatures.getDeckControlSupport());
            mSetAudioRateSupport = updateFeatureSupportStatus(mSetAudioRateSupport,
                    newDeviceFeatures.getSetAudioRateSupport());
            mArcTxSupport = updateFeatureSupportStatus(mArcTxSupport,
                    newDeviceFeatures.getArcTxSupport());
            mArcRxSupport = updateFeatureSupportStatus(mArcRxSupport,
                    newDeviceFeatures.getArcRxSupport());
            mSetAudioVolumeLevelSupport = updateFeatureSupportStatus(mSetAudioVolumeLevelSupport,
                    newDeviceFeatures.getSetAudioVolumeLevelSupport());
            return this;
        }
    }
}
+290 −114

File changed.

Preview size limit exceeded, changes collapsed.

+114 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.hardware.hdmi;

import static android.hardware.hdmi.DeviceFeatures.FEATURE_NOT_SUPPORTED;
import static android.hardware.hdmi.DeviceFeatures.FEATURE_SUPPORTED;
import static android.hardware.hdmi.DeviceFeatures.FEATURE_SUPPORT_UNKNOWN;

import static com.google.common.truth.Truth.assertThat;

import androidx.test.filters.SmallTest;

import com.google.common.testing.EqualsTester;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

/** Tests for {@link DeviceFeatures} */
@RunWith(JUnit4.class)
@SmallTest
public class DeviceFeaturesTest {

    @Test
    public void testEquals() {
        new EqualsTester()
                .addEqualityGroup(DeviceFeatures.ALL_FEATURES_SUPPORT_UNKNOWN)
                .addEqualityGroup(DeviceFeatures.NO_FEATURES_SUPPORTED)
                .addEqualityGroup(
                        DeviceFeatures.fromOperand(
                                new byte[]{(byte) 0b0111_0000}),
                        DeviceFeatures.fromOperand(
                                new byte[]{(byte) 0b1111_0000}),
                        DeviceFeatures.fromOperand(
                                new byte[]{(byte) 0b1111_0000, (byte) 0b0101_0101}),
                        DeviceFeatures.ALL_FEATURES_SUPPORT_UNKNOWN.toBuilder()
                                .setRecordTvScreenSupport(FEATURE_SUPPORTED)
                                .setSetOsdStringSupport(FEATURE_SUPPORTED)
                                .setDeckControlSupport(FEATURE_SUPPORTED)
                                .setSetAudioRateSupport(FEATURE_NOT_SUPPORTED)
                                .setArcTxSupport(FEATURE_NOT_SUPPORTED)
                                .setArcRxSupport(FEATURE_NOT_SUPPORTED)
                                .setSetAudioVolumeLevelSupport(FEATURE_NOT_SUPPORTED)
                                .build()
                )
                .testEquals();
    }

    @Test
    public void testDeviceFeaturesOperandConversion() {
        DeviceFeatures info = DeviceFeatures.fromOperand(
                new byte[]{(byte) 0b0111_0000});

        assertThat(info.getRecordTvScreenSupport()).isEqualTo(FEATURE_SUPPORTED);
        assertThat(info.getSetOsdStringSupport()).isEqualTo(FEATURE_SUPPORTED);
        assertThat(info.getDeckControlSupport()).isEqualTo(FEATURE_SUPPORTED);
        assertThat(info.getSetAudioRateSupport()).isEqualTo(FEATURE_NOT_SUPPORTED);
        assertThat(info.getArcTxSupport()).isEqualTo(FEATURE_NOT_SUPPORTED);
        assertThat(info.getArcRxSupport()).isEqualTo(FEATURE_NOT_SUPPORTED);
        assertThat(info.getSetAudioVolumeLevelSupport()).isEqualTo(FEATURE_NOT_SUPPORTED);

        assertThat(info.toOperand()).isEqualTo(new byte[]{(byte) 0b0111_0000});
    }

    @Test
    public void testUpdate() {
        DeviceFeatures oldFeatures = DeviceFeatures.ALL_FEATURES_SUPPORT_UNKNOWN.toBuilder()
                .setRecordTvScreenSupport(FEATURE_SUPPORTED)
                .setSetOsdStringSupport(FEATURE_SUPPORTED)
                .setDeckControlSupport(FEATURE_NOT_SUPPORTED)
                .setSetAudioRateSupport(FEATURE_NOT_SUPPORTED)
                .setArcTxSupport(FEATURE_SUPPORT_UNKNOWN)
                .setArcRxSupport(FEATURE_SUPPORT_UNKNOWN)
                .setSetAudioVolumeLevelSupport(FEATURE_SUPPORT_UNKNOWN)
                .build();

        DeviceFeatures newFeatures = DeviceFeatures.ALL_FEATURES_SUPPORT_UNKNOWN.toBuilder()
                .setRecordTvScreenSupport(FEATURE_NOT_SUPPORTED)
                .setSetOsdStringSupport(FEATURE_SUPPORT_UNKNOWN)
                .setDeckControlSupport(FEATURE_SUPPORTED)
                .setSetAudioRateSupport(FEATURE_SUPPORT_UNKNOWN)
                .setArcTxSupport(FEATURE_SUPPORTED)
                .setArcRxSupport(FEATURE_NOT_SUPPORTED)
                .setSetAudioVolumeLevelSupport(FEATURE_SUPPORT_UNKNOWN)
                .build();

        // Always take the field from newFeatures, unless it's FEATURE_SUPPORT_UNKNOWN
        DeviceFeatures updatedFeatures = DeviceFeatures.ALL_FEATURES_SUPPORT_UNKNOWN.toBuilder()
                .setRecordTvScreenSupport(FEATURE_NOT_SUPPORTED)
                .setSetOsdStringSupport(FEATURE_SUPPORTED)
                .setDeckControlSupport(FEATURE_SUPPORTED)
                .setSetAudioRateSupport(FEATURE_NOT_SUPPORTED)
                .setArcTxSupport(FEATURE_SUPPORTED)
                .setArcRxSupport(FEATURE_NOT_SUPPORTED)
                .setSetAudioVolumeLevelSupport(FEATURE_SUPPORT_UNKNOWN)
                .build();

        assertThat(oldFeatures.toBuilder().update(newFeatures).build()).isEqualTo(updatedFeatures);
    }
}
+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();
    }
}
Loading