Diff between bdf0701768697b46429ddfdfb401edea4984db20 and 04d98fe2a9f772aec452b2bbc6d3da395c6d79ad
Changed Files
| File | Additions | Deletions | Status |
| android/hidhost.c | +6 | -5 | modified |
Full Patch
diff --git a/android/hidhost.c b/android/hidhost.c
index 652baa0..3dc3c25 100644
--- a/android/hidhost.c
+++ b/android/hidhost.c
@@ -867,12 +867,13 @@ static void bt_hid_connect(const void *buf, uint16_t len)
android2bdaddr(&cmd->bdaddr, &dst);
l = g_slist_find_custom(devices, &dst, device_cmp);
- if (l) {
- status = HAL_STATUS_FAILED;
- goto failed;
- }
+ if (l)
+ dev = l->data;
+ else
+ dev = hid_device_new(&dst);
- dev = hid_device_new(&dst);
+ if (dev->state != HAL_HIDHOST_STATE_DISCONNECTED)
+ goto done;
ba2str(&dev->dst, addr);
DBG("connecting to %s", addr);