Modify to get wifi state
[platform/core/api/connection.git] / src / libnetwork.c
index 8f30b58..05ed682 100755 (executable)
@@ -617,9 +617,8 @@ int _connection_libnet_get_wifi_state(connection_wifi_state_e *state)
 {
        int rv;
        net_wifi_state_t wlan_state;
-       net_profile_name_t profile_name;
 
-       rv = net_get_wifi_state(&wlan_state, &profile_name);
+       rv = net_get_wifi_state(&wlan_state);
        if (rv == NET_ERR_ACCESS_DENIED) {
                CONNECTION_LOG(CONNECTION_ERROR, "Access denied");
                return CONNECTION_ERROR_PERMISSION_DENIED;
@@ -1444,6 +1443,8 @@ guint _connection_callback_add(GSourceFunc func, gpointer user_data)
 {
        guint id;
        struct managed_idle_data *data;
+       GMainContext *context;
+       GSource *src;
 
        if (!func)
                return 0;
@@ -1455,8 +1456,12 @@ guint _connection_callback_add(GSourceFunc func, gpointer user_data)
        data->func = func;
        data->user_data = user_data;
 
-       id = g_idle_add_full(G_PRIORITY_DEFAULT_IDLE, __connection_idle_cb, data,
-                       __connection_idle_destroy_cb);
+       context = g_main_context_get_thread_default();
+       src = g_idle_source_new();
+       g_source_set_callback(src, __connection_idle_cb, data,
+               __connection_idle_destroy_cb);
+       id = g_source_attach(src, context);
+       g_source_unref(src);
        if (!id) {
                g_free(data);
                return id;
@@ -1551,7 +1556,6 @@ int _connection_check_feature_supported(const char *feature_name, ...)
                if (strcmp(key, ETHERNET_FEATURE) == 0)
                        value = __libnet_check_feature_supported(key, CONNECTION_SUPPORTED_FEATURE_ETHERNET);
 
-               SECURE_CONNECTION_LOG(CONNECTION_INFO, "%s feature is %s", key, (value ? "true" : "false"));
                feature_supported |= value;
                key = va_arg(list, const char *);
                if (!key) break;