diff options
author | Ulyana Trafimovich <skvadrik@google.com> | 2021-02-23 17:14:58 +0000 |
---|---|---|
committer | Ulyana Trafimovich <skvadrik@google.com> | 2021-02-23 17:14:58 +0000 |
commit | d2155d82f96bb21fe9848ea2e5c68839a323d9d5 (patch) | |
tree | 6a3ef18e5a849ab04062b813170d17691cb6f749 | |
parent | 075a5630c593ae5e79b50fd8973f09551bd6f9b6 (diff) | |
download | tvsystem-d2155d82f96bb21fe9848ea2e5c68839a323d9d5.tar.gz |
Revert "Changes in tvsystem/ DeviceProductInfo to mirror changes..."
Revert "Adding new CTS test for the API display#getDeviceProductInfo"
Revert submission 13552775-expose DisplayInfo.deviceProductInfo
Reason for revert: broken test android.compat.sjp.cts.StrictJavaPackagesTest#testBootClassPathAndSystemServerClasspath_nonDuplicateClasses
on git_sc-dev on cf_x86_64_phone-userdebug at 7162420
Bug: 181021245
Reverted Changes:
Id6767127f:Adding aidl file to share deviceProductInfo consta...
I6959d2829:Adding public API to expose DisplayInfo.deviceProd...
I720dbfe84:Adding new CTS test for the API display#getDeviceP...
I6c726e12c:Changes in tvsystem/ DeviceProductInfo to mirror c...
Change-Id: I2c80ad16c444f8368a3765e4370f679f3f38abd9
-rw-r--r-- | api/current.txt | 10 | ||||
-rw-r--r-- | java/com/android/libraries/tv/tvsystem/display/DeviceProductInfo.java | 72 | ||||
-rw-r--r-- | java/com/android/libraries/tv/tvsystem/display/DisplayCompatUtil.java | 2 |
3 files changed, 11 insertions, 73 deletions
diff --git a/api/current.txt b/api/current.txt index fd59a47..09cb6e8 100644 --- a/api/current.txt +++ b/api/current.txt @@ -2,19 +2,13 @@ package com.android.libraries.tv.tvsystem.display { public final class DeviceProductInfo { - ctor @Deprecated public DeviceProductInfo(String, String, String, Integer, com.android.libraries.tv.tvsystem.display.DeviceProductInfo.ManufactureDate, int[]); - ctor public DeviceProductInfo(String, String, String, Integer, com.android.libraries.tv.tvsystem.display.DeviceProductInfo.ManufactureDate, int); - method public int getConnectionToSinkType(); + ctor public DeviceProductInfo(String, String, String, Integer, com.android.libraries.tv.tvsystem.display.DeviceProductInfo.ManufactureDate, int[]); method public com.android.libraries.tv.tvsystem.display.DeviceProductInfo.ManufactureDate getManufactureDate(); method public String getManufacturerPnpId(); method public Integer getModelYear(); method public String getName(); method public String getProductId(); - method @Deprecated public int[] getRelativeAddress(); - field public static final int CONNECTION_TO_SINK_BUILT_IN = 1; // 0x1 - field public static final int CONNECTION_TO_SINK_DIRECT = 2; // 0x2 - field public static final int CONNECTION_TO_SINK_TRANSITIVE = 3; // 0x3 - field public static final int CONNECTION_TO_SINK_UNKNOWN = 0; // 0x0 + method public int[] getRelativeAddress(); } public static class DeviceProductInfo.ManufactureDate { diff --git a/java/com/android/libraries/tv/tvsystem/display/DeviceProductInfo.java b/java/com/android/libraries/tv/tvsystem/display/DeviceProductInfo.java index 5620f45..6e78253 100644 --- a/java/com/android/libraries/tv/tvsystem/display/DeviceProductInfo.java +++ b/java/com/android/libraries/tv/tvsystem/display/DeviceProductInfo.java @@ -16,10 +16,7 @@ package com.android.libraries.tv.tvsystem.display; -import android.annotation.IntDef; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; +import java.util.Arrays; import java.util.Objects; /** @@ -28,39 +25,13 @@ import java.util.Objects; * product information about the intermediate device. */ public final class DeviceProductInfo { - /** @hide */ - @IntDef(prefix = {"CONNECTION_TO_SINK_"}, value = { - CONNECTION_TO_SINK_UNKNOWN, - CONNECTION_TO_SINK_BUILT_IN, - CONNECTION_TO_SINK_DIRECT, - CONNECTION_TO_SINK_TRANSITIVE - }) - @Retention(RetentionPolicy.SOURCE) - public @interface ConnectionToSinkType { } - - /** The device connection to the display sink is unknown. */ - public static final int CONNECTION_TO_SINK_UNKNOWN = 0; - - /** The display sink is built-in to the device */ - public static final int CONNECTION_TO_SINK_BUILT_IN = 1; - - /** The device is directly connected to the display sink. */ - public static final int CONNECTION_TO_SINK_DIRECT = 2; - - /** The device is transitively connected to the display sink. */ - public static final int CONNECTION_TO_SINK_TRANSITIVE = 3; - private final String mName; private final String mManufacturerPnpId; private final String mProductId; private final Integer mModelYear; private final ManufactureDate mManufactureDate; - private final @ConnectionToSinkType int mConnectionToSinkType; + private final int[] mRelativeAddress; - /** @deprecated use - * {@link #DeviceProductInfo(String, String, String, Integer, ManufactureDate, int)} ()} - * instead.*/ - @Deprecated public DeviceProductInfo( String name, String manufacturerPnpId, @@ -73,22 +44,7 @@ public final class DeviceProductInfo { this.mProductId = productId; this.mModelYear = modelYear; this.mManufactureDate = manufactureDate; - this.mConnectionToSinkType = CONNECTION_TO_SINK_UNKNOWN; - } - - public DeviceProductInfo( - String name, - String manufacturerPnpId, - String productId, - Integer modelYear, - ManufactureDate manufactureDate, - int connectionToSinkType) { - this.mName = name; - this.mManufacturerPnpId = manufacturerPnpId; - this.mProductId = productId; - this.mModelYear = modelYear; - this.mManufactureDate = manufactureDate; - this.mConnectionToSinkType = connectionToSinkType; + this.mRelativeAddress = relativeAddress; } /** @@ -131,21 +87,9 @@ public final class DeviceProductInfo { /** * @return Relative address in the display network. For example, for HDMI connected devices this * can be its physical address. Each component of the address is in the range [0, 255]. - * - * @deprecated use {@link #getConnectionToSinkType()} instead. */ - @Deprecated public int[] getRelativeAddress() { - return null; - } - - /** - * @return How the current device is connected to the display sink. For example, the display - * can be connected immediately to the device or there can be a receiver in between. - */ - @ConnectionToSinkType - public int getConnectionToSinkType() { - return mConnectionToSinkType; + return mRelativeAddress; } @Override @@ -161,8 +105,8 @@ public final class DeviceProductInfo { + mModelYear + ", manufactureDate=" + mManufactureDate - + ", connectionToSinkType=" - + mConnectionToSinkType + + ", relativeAddress=" + + Arrays.toString(mRelativeAddress) + '}'; } @@ -176,13 +120,13 @@ public final class DeviceProductInfo { && Objects.equals(mProductId, that.mProductId) && Objects.equals(mModelYear, that.mModelYear) && Objects.equals(mManufactureDate, that.mManufactureDate) - && mConnectionToSinkType == that.mConnectionToSinkType; + && Arrays.equals(mRelativeAddress, that.mRelativeAddress); } @Override public int hashCode() { return Objects.hash(mName, mManufacturerPnpId, mProductId, mModelYear, mManufactureDate, - mConnectionToSinkType); + mRelativeAddress); } /** diff --git a/java/com/android/libraries/tv/tvsystem/display/DisplayCompatUtil.java b/java/com/android/libraries/tv/tvsystem/display/DisplayCompatUtil.java index 746f90b..fb19f98 100644 --- a/java/com/android/libraries/tv/tvsystem/display/DisplayCompatUtil.java +++ b/java/com/android/libraries/tv/tvsystem/display/DisplayCompatUtil.java @@ -64,7 +64,7 @@ public final class DisplayCompatUtil { } return new DeviceProductInfo(info.getName(), info.getManufacturerPnpId(), info.getProductId(), info.getModelYear(), manufactureDate, - info.getConnectionToSinkType()); + info.getRelativeAddress()); } private DisplayCompatUtil() {} |