aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2024-02-01 10:06:40 -0500
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2024-02-02 10:10:39 -0500
commit59bf065b6279bd49c505cab50a1d81294a6febbe (patch)
tree33eb19d0e5ba749c99bc314428196710a4d273c0
parent17c1a9b494900e1f412032d751db2a5e623c35f5 (diff)
device: Don't remove object if a service is connecting
If a service is connecting just restart the timer to give it more time to complete the connection or disconnect.
-rw-r--r--src/device.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/device.c b/src/device.c
index afd073c6c2..1db96d9a67 100644
--- a/src/device.c
+++ b/src/device.c
@@ -3276,6 +3276,13 @@ static bool device_disappeared(gpointer user_data)
{
struct btd_device *dev = user_data;
+ /* If there are services connecting restart the timer to give more time
+ * for the service to either complete the connection or disconnect.
+ */
+ if (find_service_with_state(dev->services,
+ BTD_SERVICE_STATE_CONNECTING))
+ return TRUE;
+
dev->temporary_timer = 0;
btd_adapter_remove_device(dev->adapter, dev);