diff options
author | Deokhyun Kim <dukan.kim@samsung.com> | 2016-11-16 14:49:42 +0900 |
---|---|---|
committer | DoHyun Pyun <dh79.pyun@samsung.com> | 2016-11-16 18:11:40 +0900 |
commit | 73983ce4a89dfd73b929364e729e960b3d3bea9d (patch) | |
tree | 0b60194adf6e76925c0dba477d1741df6e19f2e7 | |
parent | be877c063ebebbc167e1e5800eabf8307b787a57 (diff) | |
download | bluez-accepted/tizen/mobile/20161121.011732.tar.gz bluez-accepted/tizen/mobile/20161121.011732.tar.bz2 bluez-accepted/tizen/mobile/20161121.011732.zip |
Disconnect HID device service when HID profile is removed.submit/tizen/20161118.002314submit/tizen/20161117.015745accepted/tizen/wearable/20161121.011917accepted/tizen/tv/20161121.011827accepted/tizen/mobile/20161121.011732accepted/tizen/ivi/20161121.012013accepted/tizen/common/20161118.090639accepted/tizen/common/20161117.085347
- Even though App which registered HID device profile is terminated abnoramlly,
HID is still connected. If trying to connect HID again then it fails always.
- A profile of device structure & a profile registered by App are different.
A profile of device structure maintains connceted status.
- If a HID profile registered by App is removed in status of connected,
disconnect the connection of the profile intentionally.
Change-Id: Ic507032ba46e864e23c142177d9a7ba35ebe5d15
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
-rw-r--r-- | src/device.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/device.c b/src/device.c index f032f751..4b9b3d2e 100644 --- a/src/device.c +++ b/src/device.c @@ -5866,8 +5866,27 @@ void device_remove_profile(gpointer a, gpointer b) GSList *l; l = find_service_with_profile(device->services, profile); +#ifdef TIZEN_BT_HID_DEVICE_ENABLE + if (l == NULL) { + if (g_strcmp0(profile->local_uuid , HID_DEVICE_UUID) == 0) { + l = find_service_with_uuid(device->services, + HID_DEVICE_UUID); + service = l->data; + + if (btd_service_get_state(service) == + BTD_SERVICE_STATE_CONNECTED) { + int err; + err = btd_service_disconnect(service); + if (err) + error("error: %s", strerror(-err)); + } + } + return; + } +#else if (l == NULL) return; +#endif service = l->data; device->services = g_slist_delete_link(device->services, l); |