diff mbox series

[BlueZ,v2,3/8] device: Don't remove object if a service is connecting

Message ID 20240201191016.1122194-3-luiz.dentz@gmail.com (mailing list archive)
State Accepted
Commit 59bf065b6279bd49c505cab50a1d81294a6febbe
Headers show
Series [BlueZ,v2,1/8] client/mgmt: Add missing settings strings | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/IncrementalBuild success Incremental Build PASS

Commit Message

Luiz Augusto von Dentz Feb. 1, 2024, 7:10 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

If a service is connecting just restart the timer to give it more time
to complete the connection or disconnect.
---
 src/device.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/src/device.c b/src/device.c
index afd073c6c2a5..1db96d9a672c 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);