Fix the return value of the function providing connected status (TSAM-8605) 95/90895/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 4 Oct 2016 23:19:05 +0000 (08:19 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 4 Oct 2016 23:19:05 +0000 (08:19 +0900)
Change-Id: I805af963a64364b478d30051a244bc7fa3bb8ce1
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
bt-service/bt-service-device.c

index d98b29a..a5bfb0f 100644 (file)
@@ -1729,16 +1729,17 @@ int _bt_is_device_connected(bluetooth_device_address_t *device_address,
                                        &error);
 
                if (result == NULL) {
-                       int ret = BLUETOOTH_ERROR_INTERNAL;
                        BT_ERR("[IsConnectedProfile] Error occured in Proxy call");
                        if (error) {
                                BT_ERR("%s", error->message);
                                if (g_strrstr(error->message, "Not Connected"))
-                                       ret = BLUETOOTH_ERROR_NOT_CONNECTED;
+                                       BT_DBG("Not connected");
                                g_error_free(error);
                        }
+                       *is_connected = FALSE;
                        g_object_unref(device_proxy);
-                       return ret;
+                       g_free(uuid);
+                       return BLUETOOTH_ERROR_NONE;
                }
                g_variant_get(result, "(b)", is_connected);
                g_free(uuid);