Diff between f2ec4f54bf2cea2197c0244605632475c815f3ee and 728d50c20483ff20f584ab797544a323bb6958e7

Changed Files

File Additions Deletions Status
doc/device-api.txt +3 -3 modified
src/device.c +3 -3 modified

Full Patch

diff --git a/doc/device-api.txt b/doc/device-api.txt
index ac5604f..8b69c2e 100644
--- a/doc/device-api.txt
+++ b/doc/device-api.txt
@@ -52,9 +52,9 @@ Methods		void Connect()
 			This method can be also used to cancel a preceding
 			Connect call before a reply to it has been received.
 
-			When connected over LE bearer calling this method will
-			prevent incoming connections until Connect method is
-			called again.
+			For non-trusted devices connected over LE bearer calling
+			this method will disable incoming connections until
+			Connect method is called again.
 
 			Possible errors: org.bluez.Error.NotConnected
 
diff --git a/src/device.c b/src/device.c
index e811811..a753d21 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1483,10 +1483,10 @@ static DBusMessage *dev_disconnect(DBusConnection *conn, DBusMessage *msg,
 	struct btd_device *device = user_data;
 
 	/*
-	 * Disable connections through passive scanning until
-	 * Device1.Connect is called
+	 * If device is not trusted disable connections through passive
+	 * scanning until Device1.Connect is called
 	 */
-	if (device->auto_connect) {
+	if (device->auto_connect && !device->trusted) {
 		device->disable_auto_connect = TRUE;
 		device_set_auto_connect(device, FALSE);
 	}