2 #include <vconf-keys.h>
3 #include <net_connection.h>
6 #include "wlan_manager.h"
7 #include "connection_manager.h"
9 static connection_h connection = NULL;
11 static void _connection_type_changed_cb(connection_type_e type, void* user_data)
13 __COMMON_FUNC_ENTER__;
15 if (wlan_manager_state_get() != WLAN_MANAGER_CONNECTED)
18 if (type == CONNECTION_TYPE_CELLULAR ||
19 type == CONNECTION_TYPE_WIFI)
20 wlan_manager_scanned_profile_refresh();
25 gboolean connection_manager_create(void)
27 __COMMON_FUNC_ENTER__;
31 ret = connection_create(&connection);
32 if (ret != CONNECTION_ERROR_NONE)
35 ret = connection_set_type_changed_cb(connection, _connection_type_changed_cb, NULL);
36 if (ret != CONNECTION_ERROR_NONE)
43 gboolean connection_manager_destroy(void)
45 __COMMON_FUNC_ENTER__;
49 if (connection == NULL)
52 ret = connection_destroy(connection);
53 if (ret != CONNECTION_ERROR_NONE)
62 gboolean connection_manager_is_wifi_connection_used(void)
64 __COMMON_FUNC_ENTER__;
67 connection_type_e type;
69 if (connection == NULL)
72 ret = connection_get_type(connection, &type);
73 if (ret != CONNECTION_ERROR_NONE)
76 if (type != CONNECTION_TYPE_WIFI)