summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2022-02-11 18:45:17 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-02-11 18:45:17 +0000
commit466b596cc5d79f47357ec0d3d07389cdf4fc92bc (patch)
tree62582f8185a6ea99ec72b6cddb6d101145f3b06b
parent909e4b4cc5ee364948b5dd02fc7e3aef2be27c15 (diff)
parentac977b60166c0b7b4dd016b4d15eb35f0c1e14d9 (diff)
downloadlibhardware-466b596cc5d79f47357ec0d3d07389cdf4fc92bc.tar.gz
Merge "Add audio_hw_device.set_device_connected_state_v7 method" am: ac977b6016
Original change: https://android-review.googlesource.com/c/platform/hardware/libhardware/+/1978754 Change-Id: Ice502eaba6c5dd8ca1157d3fde1b5b5b223267e4
-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 a3b52146..daaa16f1 100644
--- a/include/hardware/audio.h
+++ b/include/hardware/audio.h
@@ -1047,6 +1047,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;