summaryrefslogtreecommitdiff
path: root/core/java/android/view/DisplayInfo.java
diff options
context:
space:
mode:
authorMarin Shalamanov <shalamanov@google.com>2019-10-08 10:48:08 +0200
committerMarin Shalamanov <shalamanov@google.com>2020-02-18 19:36:29 +0100
commit98af159104da457b8e3f9b1a5729cc34f7f3674a (patch)
treeb9cebaa9fce65250fa8ca7c01fb1276ed379759d /core/java/android/view/DisplayInfo.java
parent5cbf58e33c170d1f32ee112f59df99d51c9ca106 (diff)
DeviceProductInfo API.
DeviceProductInfo API that can be used to prime an Android TV remote with entries from an infrared database for controlling connected audio and TV devices. See go/display-identifiers. Bug: 145299597 Test: adb shell dumpsys display Change-Id: I8d709d55d830eed932b51bb8c374d32e20eecf6d
Diffstat (limited to 'core/java/android/view/DisplayInfo.java')
-rw-r--r--core/java/android/view/DisplayInfo.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/core/java/android/view/DisplayInfo.java b/core/java/android/view/DisplayInfo.java
index b9868a7e1444..3047385410b0 100644
--- a/core/java/android/view/DisplayInfo.java
+++ b/core/java/android/view/DisplayInfo.java
@@ -28,6 +28,7 @@ import android.compat.annotation.UnsupportedAppUsage;
import android.content.res.CompatibilityInfo;
import android.content.res.Configuration;
import android.graphics.Rect;
+import android.hardware.display.DeviceProductInfo;
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
@@ -70,6 +71,13 @@ public final class DisplayInfo implements Parcelable {
public DisplayAddress address;
/**
+ * Product-specific information about the display or the directly connected device on the
+ * display chain. For example, if the display is transitively connected, this field may contain
+ * product information about the intermediate device.
+ */
+ public DeviceProductInfo deviceProductInfo;
+
+ /**
* The human-readable name of the display.
*/
public String name;
@@ -297,6 +305,7 @@ public final class DisplayInfo implements Parcelable {
&& type == other.type
&& displayId == other.displayId
&& Objects.equals(address, other.address)
+ && Objects.equals(deviceProductInfo, other.deviceProductInfo)
&& Objects.equals(uniqueId, other.uniqueId)
&& appWidth == other.appWidth
&& appHeight == other.appHeight
@@ -336,6 +345,7 @@ public final class DisplayInfo implements Parcelable {
type = other.type;
displayId = other.displayId;
address = other.address;
+ deviceProductInfo = other.deviceProductInfo;
name = other.name;
uniqueId = other.uniqueId;
appWidth = other.appWidth;
@@ -373,6 +383,7 @@ public final class DisplayInfo implements Parcelable {
type = source.readInt();
displayId = source.readInt();
address = source.readParcelable(null);
+ deviceProductInfo = source.readParcelable(null);
name = source.readString();
appWidth = source.readInt();
appHeight = source.readInt();
@@ -418,6 +429,7 @@ public final class DisplayInfo implements Parcelable {
dest.writeInt(type);
dest.writeInt(displayId);
dest.writeParcelable(address, flags);
+ dest.writeParcelable(deviceProductInfo, flags);
dest.writeString(name);
dest.writeInt(appWidth);
dest.writeInt(appHeight);
@@ -645,6 +657,8 @@ public final class DisplayInfo implements Parcelable {
if (address != null) {
sb.append(", address ").append(address);
}
+ sb.append(", deviceProductInfo ");
+ sb.append(deviceProductInfo);
sb.append(", state ");
sb.append(Display.stateToString(state));
if (ownerUid != 0 || ownerPackageName != null) {