From: Johan Hedberg Date: Fri, 12 Jul 2013 10:18:14 +0000 (+0300) Subject: core: Fix incorrect update of dev->svc_refreshed X-Git-Tag: android-x86-4.4-r3~7894 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=3bdc3d0f00ab0440071f319e67676089b3672e54;p=android-x86%2Fexternal-bluetooth-bluez.git core: Fix incorrect update of dev->svc_refreshed --- diff --git a/src/device.c b/src/device.c index 18d0d460f..bd513eca0 100644 --- a/src/device.c +++ b/src/device.c @@ -1440,10 +1440,18 @@ static void device_svc_resolved(struct btd_device *dev, int err) DBusMessage *reply; struct browse_req *req = dev->browse; + DBG("%s err %d", dev->path, err); + dev->svc_resolved = true; - dev->svc_refreshed = true; dev->browse = NULL; + /* Disconnection notification can happen before this function + * gets called, so don't set svc_refreshed for a disconnected + * device. + */ + if (dev->connected) + dev->svc_refreshed = true; + g_slist_free_full(dev->eir_uuids, g_free); dev->eir_uuids = NULL;