From e08774af7a7474d2b0974e0bb383787bdbbb1b99 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 12 Jul 2013 11:14:44 +0300 Subject: [PATCH] core: Fix returning correct D-Bus reply when refreshing services --- src/device.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/device.c b/src/device.c index 176ccac35..13deebde9 100644 --- a/src/device.c +++ b/src/device.c @@ -1312,8 +1312,13 @@ static DBusMessage *connect_profiles(struct btd_device *dev, DBusMessage *msg, dev->pending = create_pending_list(dev, uuid); if (!dev->pending) { - if (dev->svc_refreshed) - return btd_error_not_available(msg); + if (dev->svc_refreshed) { + if (find_service_with_state(dev->services, + BTD_SERVICE_STATE_CONNECTED)) + return dbus_message_new_method_return(msg); + else + return btd_error_not_available(msg); + } goto resolve_services; } -- 2.11.0