From: Johan Hedberg Date: Thu, 20 Mar 2014 14:06:21 +0000 (+0200) Subject: core: Fix Paired property notification for multiple bearers X-Git-Tag: android-x86-4.4-r3~4611 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=48231ada62027b6419ade4a103887a58af4e3f8e;p=android-x86%2Fexternal-bluetooth-bluez.git core: Fix Paired property notification for multiple bearers The code in device_set_paired wasn't quite right previously. We should not be sending Paired=true if we've already done that once due to the other supported bearer. --- diff --git a/src/device.c b/src/device.c index f72a72b8e..67c4e6d98 100644 --- a/src/device.c +++ b/src/device.c @@ -4002,13 +4002,21 @@ void device_set_paired(struct btd_device *dev, uint8_t bdaddr_type) if (state->paired) return; - if (!state->svc_resolved) + state->paired = true; + + /* If the other bearer state was alraedy true we don't need to + * send any property signals. + */ + if (dev->bredr_state.paired == dev->le_state.paired) + return; + + if (!state->svc_resolved) { dev->pending_paired = true; - else if (dev->bredr_state.paired != dev->le_state.paired) - g_dbus_emit_property_changed(dbus_conn, dev->path, - DEVICE_INTERFACE, "Paired"); + return; + } - state->paired = true; + g_dbus_emit_property_changed(dbus_conn, dev->path, + DEVICE_INTERFACE, "Paired"); } static void device_auth_req_free(struct btd_device *device)