Skip to contentSkip to conversation

core/device: Fix marking auto-connect flag

PATCH New Luiz Augusto von Dentz 1 participant 1 message Aug 22, 2016 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 core/device: Fix marking auto-connect flag

From: Luiz Augusto von Dentz <[email protected]>

Device auto-connect shall be set only if the profile is able to accept incoming connections, this fixes the wrong behavior or connecting LE with dual mode devices immediatelly after probing service as profiles may have auto-connect flag for outgoing connection (usually BR/EDR only).

---
 src/device.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
src/device.c +4 -1
index c103bb2..14de7e8 100644
@@ -4080,7 +4080,10 @@ static struct btd_service *probe_service(struct btd_device *device,
 		return NULL;
 	}
 
-	if (profile->auto_connect)
+	/* Only set auto connect if profile has set the flag and can really
+	 * accept connections.
+	 */
+	if (profile->auto_connect && profile->accept)
 		device_set_auto_connect(device, TRUE);
 
 	return service;
Signature · 1 line
2.7.4