device: Fix missing Paired property change on non-bonded device
If device is paired but not bonded than Paired property should be
also updated when device is disconnected.
diff --git a/src/device.c b/src/device.c
index 8af77db..7c7196c 100644
--- a/src/device.c
+++ b/src/device.c
@@ -2735,10 +2735,19 @@
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;