diff options
author | Hsin-Yu Chao <hychao@chromium.org> | 2015-03-20 18:54:19 +0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-03-20 16:23:16 +0000 |
commit | 58ce2f4836f725ab16a122bfad83e156869f9654 (patch) | |
tree | 37e8cdb130c3290a730f8d61e4862ec339570f9a /cras/src/server/cras_bt_device.h | |
parent | 5bb52c0da2ff4cc430a8beb7e949ccce105d7c94 (diff) | |
download | adhd-58ce2f4836f725ab16a122bfad83e156869f9654.tar.gz |
CRAS: bt_device - Add function to disconnect bt device
On Chrome OS we support only single headset so when multiple
headsets are connected the old one will be removed to avoid
user getting into a state that two headsets are used for input
and output respectively. To better improve user experience,
force disconnect BT headset so it'll shown as disconnected
when it's no longer listed as an audio input/ouput option.
BUG=chromium:468882
TEST=Connect HFP/HSP-only headset, play audio. Try connect
to an A2DP/HFP headset from bluetooth UI. Verify audio has
transferred to the A2DP/HFP headset and the previous HFP/HSP
only headset show disconnected in bluetooth UI.
Change-Id: Ice8fb5f5952bc0d17d0d8df4028f901d060a566e
Reviewed-on: https://chromium-review.googlesource.com/261541
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Diffstat (limited to 'cras/src/server/cras_bt_device.h')
-rw-r--r-- | cras/src/server/cras_bt_device.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cras/src/server/cras_bt_device.h b/cras/src/server/cras_bt_device.h index 3def2191..0c203183 100644 --- a/cras/src/server/cras_bt_device.h +++ b/cras/src/server/cras_bt_device.h @@ -45,6 +45,16 @@ void cras_bt_device_update_properties(struct cras_bt_device *device, DBusMessageIter *properties_array_iter, DBusMessageIter *invalidated_array_iter); +/* Forces disconnect the bt device. Used when handling audio error + * that we want to make the device be completely disconnected from + * host to reflect the state that an error has occurred. + * Args: + * conn - The dbus connection. + * device - The bt device to disconnect. + */ +int cras_bt_device_disconnect(DBusConnection *conn, + struct cras_bt_device *device); + /* Gets the SCO socket for the device. * Args: * device - The device object to get SCO socket for. |