All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] device: Fix missing Paired property change on non-bonded device
@ 2018-03-06 14:15 Szymon Janc
  2018-03-07  8:06 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Szymon Janc @ 2018-03-06 14:15 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

If device is paired but not bonded than Paired property should be
also updated when device is disconnected.
---
 src/device.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/device.c b/src/device.c
index 8af77dbc8..7c7196ca1 100644
--- a/src/device.c
+++ b/src/device.c
@@ -2735,10 +2735,19 @@ void device_remove_connection(struct btd_device *device, uint8_t bdaddr_type)
 		dbus_message_unref(msg);
 	}
 
-	if (state->paired && !state->bonded)
+	if (state->paired && !state->bonded) {
 		btd_adapter_remove_bonding(device->adapter, &device->bdaddr,
 								bdaddr_type);
 
+		state->paired = false;
+
+		/* report change only if both bearers are unpaired */
+		if (!device->bredr_state.paired && !device->le_state.paired)
+			g_dbus_emit_property_changed(dbus_conn, device->path,
+							DEVICE_INTERFACE,
+							"Paired");
+	}
+
 	if (device->bredr_state.connected || device->le_state.connected)
 		return;
 
-- 
2.14.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] device: Fix missing Paired property change on non-bonded device
  2018-03-06 14:15 [PATCH] device: Fix missing Paired property change on non-bonded device Szymon Janc
@ 2018-03-07  8:06 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2018-03-07  8:06 UTC (permalink / raw)
  To: Szymon Janc; +Cc: linux-bluetooth

Hi Szymon,

On Tue, Mar 06, 2018, Szymon Janc wrote:
> If device is paired but not bonded than Paired property should be
> also updated when device is disconnected.
> ---
>  src/device.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)

Applied. Thanks.

Johan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-07  8:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-06 14:15 [PATCH] device: Fix missing Paired property change on non-bonded device Szymon Janc
2018-03-07  8:06 ` Johan Hedberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.