summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMikhail Naganov <mnaganov@google.com>2022-01-31 22:41:55 +0000
committerMikhail Naganov <mnaganov@google.com>2022-01-31 22:52:21 +0000
commit521310bc2607ed550b89efb638207420de23f85f (patch)
treec1d15718174b226bb2373e194d8ed24ce2e1015a /include
parentcbcdc02ef4b8ab8e070f71e9a72e58e1fde40b27 (diff)
downloadlibhardware-521310bc2607ed550b89efb638207420de23f85f.tar.gz
Add audio_hw_device.set_device_connected_state_v7 method
Add an interface method for providing extra information about the connected device. Bug: 211601178 Test: m Change-Id: I0868cdfdbe46d1399071967653372b55713843e4
Diffstat (limited to 'include')
-rw-r--r--include/hardware/audio.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/hardware/audio.h b/include/hardware/audio.h
index adec3da8..6c883f28 100644
--- a/include/hardware/audio.h
+++ b/include/hardware/audio.h
@@ -982,6 +982,24 @@ struct audio_hw_device {
*/
int (*get_audio_port_v7)(struct audio_hw_device *dev,
struct audio_port_v7 *port);
+
+ /**
+ * Called when the state of the connection of an external device has been changed.
+ * The "port" parameter is only used as input and besides identifying the device
+ * port, also may contain additional information such as extra audio descriptors.
+ *
+ * HAL version 3.2 and higher only. If the HAL does not implement this method,
+ * it must leave the function entry as null, or return -ENOSYS. In this case
+ * the framework will use 'set_parameters', which can only pass the device address.
+ *
+ * @param dev the audio HAL device context.
+ * @param port device port identification and extra information.
+ * @param connected whether the external device is connected.
+ * @return retval operation completion status.
+ */
+ int (*set_device_connected_state_v7)(struct audio_hw_device *dev,
+ struct audio_port_v7 *port,
+ bool connected);
};
typedef struct audio_hw_device audio_hw_device_t;