#include <ITapiSim.h>
#include <bluetooth.h>
#include <nfc.h>
+#include <wifi-manager.h>
#include "setting-connection.h"
#include "util.h"
static int is_supported_telephony = 0;
static TapiHandle *tel_handle = NULL;
+static wifi_manager_h wifi_handle = { 0 };
void _bluetooth_cb(void *data, Evas_Object *obj, void *event_info);
void _wifi_cb(void *data, Evas_Object *obj, void *event_info);
static void bt_status_changed_cb(int result, bt_adapter_state_e adapter_state, void *user_data);
static void wifi_status_vconf_changed_cb(keynode_t *key, void *data);
+static void wifi_status_changed_cb(wifi_manager_device_state_e state, void *user_data);
static void nfc_status_vconf_changed_cb(bool activated, void *user_data);
static void location_status_vconf_changed_cb(keynode_t *key, void *data);
g_app_context = NULL;
- unregister_vconf_changing(VCONFKEY_WIFI_STATE, wifi_status_vconf_changed_cb);
unregister_vconf_changing(VCONFKEY_LOCATION_USE_MY_LOCATION, location_status_vconf_changed_cb);
if (tel_handle) {
if (nfc_ret != NFC_ERROR_NONE)
ERR("ERROR NFC deinit %d", nfc_ret);
+ wifi_manager_unset_device_state_changed_cb(wifi_handle);
+ int wifi_ret = wifi_manager_deinitialize(wifi_handle);
+ ERR("ERROR WIFI deinit %d", wifi_ret);
}
int ret = 0;
bool is_on = 0;
bt_adapter_state_e bt_val = 0;
+ bool is_activated = 0;
if (!strcmp(part, "elm.text")) {
snprintf(buf, sizeof(buf) - 1, "%s", _(connection_menu_its[id->menu_array_idx].name));
snprintf(buf, sizeof(buf) - 1, text_color, bt_val ? _("IDS_COM_BODY_ON_ABB") : _("IDS_COM_BODY_OFF_ABB_M_STATUS"));
break;
case SETTING_CONNECTION_WIFI:
- vconf_get_int(VCONFKEY_WIFI_STATE, &val);
- snprintf(buf, sizeof(buf) - 1, text_color, val ? _("IDS_COM_BODY_ON_ABB") : _("IDS_COM_BODY_OFF_ABB_M_STATUS"));
+ ret = wifi_manager_is_activated(wifi_handle, &is_activated);
+ if (ret != WIFI_MANAGER_ERROR_NONE)
+ DBG("ERROR WIFI activated checker %d", ret);
+ snprintf(buf, sizeof(buf) - 1, text_color, is_activated ? _("IDS_COM_BODY_ON_ABB") : _("IDS_COM_BODY_OFF_ABB_M_STATUS"));
break;
case SETTING_CONNECTION_NFC:
is_on = nfc_manager_is_activated();
g_connection_genlist = genlist;
- register_vconf_changing(VCONFKEY_WIFI_STATE, wifi_status_vconf_changed_cb, ad);
register_vconf_changing(VCONFKEY_LOCATION_USE_MY_LOCATION, location_status_vconf_changed_cb, ad);
if (nfc_ret != NFC_ERROR_NONE)
ERR("ERROR NFC register changed cb %d", nfc_ret);
+ int wifi_ret = wifi_manager_initialize(&wifi_handle);
+ if (wifi_ret != WIFI_MANAGER_ERROR_NONE)
+ DBG("ERROR WIFI init%d", wifi_ret);
+
+ wifi_ret = wifi_manager_set_device_state_changed_cb(wifi_handle, wifi_status_changed_cb, ad);
+ if (wifi_ret != WIFI_MANAGER_ERROR_NONE)
+ DBG("ERROR WIFI set changed cb%d", wifi_ret);
+
return genlist;
}
_update_connection_list(g_BT_item);
}
-static void wifi_status_vconf_changed_cb(keynode_t *key, void *data)
+static void wifi_status_changed_cb(wifi_manager_device_state_e state, void *user_data)
{
- DBG("Setting - wifi_status_vconf_changed_cb() is called!!");
+ DBG("Setting - wifi_status_changed_cb() is called!!");
_update_connection_list(g_WIFI_item);
}