diff options
author | Mikhail Naganov <mnaganov@google.com> | 2022-01-31 22:41:55 +0000 |
---|---|---|
committer | Mikhail Naganov <mnaganov@google.com> | 2022-02-09 19:29:39 +0000 |
commit | f9121419563862eb21b08fb5a342aca47c8d6b62 (patch) | |
tree | 62582f8185a6ea99ec72b6cddb6d101145f3b06b | |
parent | 5c264411c68c2583051e5c9cfa9bfec2c87d549c (diff) | |
download | libhardware-f9121419563862eb21b08fb5a342aca47c8d6b62.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
(cherry picked from commit 521310bc2607ed550b89efb638207420de23f85f)
Merged-In: I0868cdfdbe46d1399071967653372b55713843e4
-rw-r--r-- | include/hardware/audio.h | 18 |
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; |