summaryrefslogtreecommitdiffstats
path: root/tv
diff options
context:
space:
mode:
authorShubang Lu <shubang@google.com>2017-03-15 17:29:08 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-03-15 17:29:11 +0000
commit08216a57771c4f3219ff9b19bb882db823f26dd0 (patch)
tree1f8da1cb4ff847f2988bd5bb7e02ff15bd1ff557 /tv
parentdca2095a8cdcde036041f0ec7b3c57dbce01c84a (diff)
parent4b43ed728f88fb1c5f66671f081810252621636c (diff)
downloadandroid_hardware_interfaces-08216a57771c4f3219ff9b19bb882db823f26dd0.tar.gz
android_hardware_interfaces-08216a57771c4f3219ff9b19bb882db823f26dd0.tar.bz2
android_hardware_interfaces-08216a57771c4f3219ff9b19bb882db823f26dd0.zip
Merge "Add a field for auto cable plugin detection in TV Input HAL"
Diffstat (limited to 'tv')
-rw-r--r--tv/input/1.0/default/TvInput.cpp1
-rw-r--r--tv/input/1.0/types.hal23
2 files changed, 19 insertions, 5 deletions
diff --git a/tv/input/1.0/default/TvInput.cpp b/tv/input/1.0/default/TvInput.cpp
index 6fcb2e5c0..0bc6401fa 100644
--- a/tv/input/1.0/default/TvInput.cpp
+++ b/tv/input/1.0/default/TvInput.cpp
@@ -158,6 +158,7 @@ void TvInput::notify(struct tv_input_device* __unused, tv_input_event_t* event,
tvInputEvent.deviceInfo.type = static_cast<TvInputType>(
event->device_info.type);
tvInputEvent.deviceInfo.portId = event->device_info.hdmi.port_id;
+ tvInputEvent.deviceInfo.cableConnectionStatus = CableConnectionStatus::UNKNOWN;
// TODO: Ensure the legacy audio type code is the same once audio HAL default
// implementation is ready.
tvInputEvent.deviceInfo.audioType = static_cast<AudioDevice>(
diff --git a/tv/input/1.0/types.hal b/tv/input/1.0/types.hal
index 6852c703a..55eb6adea 100644
--- a/tv/input/1.0/types.hal
+++ b/tv/input/1.0/types.hal
@@ -40,14 +40,27 @@ enum TvInputType : int32_t {
DISPLAY_PORT = 10,
};
+/*
+ * Status of cable connection.
+ * This status is for devices having availability to detect the cable in a mechanical way,
+ * regardless of whether the connected external device is electrically on or not.
+ * If the device does not have such capability, you must use UNKNOWN.
+ */
+enum CableConnectionStatus : int32_t {
+ UNKNOWN = 0,
+ CONNECTED = 1,
+ DISCONNECTED = 2,
+};
+
struct TvInputDeviceInfo {
int32_t deviceId;
TvInputType type;
- uint32_t portId; // HDMI port ID number. e.g. 2 for HDMI 2
- AudioDevice audioType; // Audio device type. e.g AudioDevice::IN_HDMI
- uint8_t[32] audioAddress; // Audio device address. "" if N/A. If the text
- // length is less than 32, the remaining part
- // must be filled with 0s.
+ uint32_t portId; // HDMI port ID number. e.g. 2 for HDMI 2
+ CableConnectionStatus cableConnectionStatus; // Cable connection status.
+ AudioDevice audioType; // Audio device type. e.g AudioDevice::IN_HDMI
+ uint8_t[32] audioAddress; // Audio device address. "" if N/A. If the text
+ // length is less than 32, the remaining part
+ // must be filled with 0s.
};
enum TvInputEventType : int32_t {