#include <vconf.h>
#include <vconf-keys.h>
-#include <bundle.h>
-#include <bundle_internal.h>
-#include <eventsystem.h>
-#include <syspopup_caller.h>
#include "log.h"
#include "util.h"
static GSList *notifier_list = NULL;
+static guint network_connected_popup_timer_id = 0;
+static gboolean block_network_connected_popup = FALSE;
+
+static const char *_convert_wifi_service_state_to_string(wifi_service_state_e wifi_service_state_type)
+{
+ switch (wifi_service_state_type) {
+ case NETCONFIG_WIFI_UNKNOWN:
+ return "unknown";
+ case NETCONFIG_WIFI_IDLE:
+ return "idle";
+ case NETCONFIG_WIFI_ASSOCIATION:
+ return "association";
+ case NETCONFIG_WIFI_CONFIGURATION:
+ return "configuration";
+ case NETCONFIG_WIFI_CONNECTED:
+ return "connected";
+ case NETCONFIG_WIFI_FAILURE:
+ return "failure";
+ default:
+ ERR("Invalid wifi_service_state_e parameter");
+ break;
+ }
-static void __netconfig_pop_wifi_connected_poppup(const char *ssid)
-{
- bundle *b = NULL;
-
- if (ssid == NULL)
- return;
-
- b = bundle_create();
-
- bundle_add(b, "_SYSPOPUP_TITLE_", "Network connection popup");
- bundle_add(b, "_SYSPOPUP_TYPE_", "toast_popup");
- bundle_add(b, "_SYSPOPUP_CONTENT_", "wifi connected");
- bundle_add(b, "_AP_NAME_", ssid);
+ return "Invalid parameter";
+}
+
+static const char *_convert_wifi_technology_state_to_string(wifi_tech_state_e wifi_tech_state_type)
+{
+ switch (wifi_tech_state_type) {
+ case NETCONFIG_WIFI_TECH_UNKNOWN:
+ return "unknown";
+ case NETCONFIG_WIFI_TECH_OFF:
+ return "off";
+ case NETCONFIG_WIFI_TECH_WPS_ONLY:
+ return "wps only";
+ case NETCONFIG_WIFI_TECH_POWERED:
+ return "powered";
+ case NETCONFIG_WIFI_TECH_CONNECTED:
+ return "connected";
+ case NETCONFIG_WIFI_TECH_TETHERED:
+ return "tethered";
+ default:
+ ERR("Invalid wifi_tech_state_e parameter");
+ break;
+ }
- DBG("Launch Wi-Fi connected alert network popup");
- syspopup_launch("net-popup", b);
+ return "Invalid parameter";
+}
- bundle_free(b);
+static gboolean _block_network_connection_popup(gpointer data)
+{
+ block_network_connected_popup = FALSE;
+ netconfig_stop_timer(&network_connected_popup_timer_id);
+ return FALSE;
}
static void __set_wifi_connected_essid(void)
}
netconfig_set_vconf_str(VCONFKEY_WIFI_CONNECTED_AP_NAME, essid_name);
- __netconfig_pop_wifi_connected_poppup(essid_name);
+
+ /* Block Network Connected popup for 3sec
+ * to avoid multiple popup's due to ready signals */
+ if (block_network_connected_popup == FALSE) {
+ block_network_connected_popup = TRUE;
+ netconfig_start_timer(3000, _block_network_connection_popup,
+ NULL, &network_connected_popup_timer_id);
+ __netconfig_pop_wifi_connected_poppup(essid_name);
+ }
}
static void __unset_wifi_connected_essid(void)
netconfig_set_vconf_int(VCONFKEY_WIFI_STATE, VCONFKEY_WIFI_UNCONNECTED);
netconfig_set_vconf_int(VCONFKEY_NETWORK_WIFI_STATE, VCONFKEY_NETWORK_WIFI_NOT_CONNECTED);
- netconfig_set_system_event(SYS_EVENT_WIFI_STATE, EVT_KEY_WIFI_STATE, EVT_VAL_WIFI_ON);
+ netconfig_set_system_event(SYS_EVT_WIFI_STATE, EKEY_WIFI_STATE, EVAL_WIFI_ON);
netconfig_wifi_bgscan_stop();
netconfig_wifi_bgscan_start(TRUE);
netconfig_set_vconf_int(VCONFKEY_WIFI_STATE, VCONFKEY_WIFI_OFF);
netconfig_set_vconf_int(VCONFKEY_NETWORK_WIFI_STATE, VCONFKEY_NETWORK_WIFI_OFF);
- netconfig_set_system_event(SYS_EVENT_WIFI_STATE, EVT_KEY_WIFI_STATE, EVT_VAL_WIFI_OFF);
+ netconfig_set_system_event(SYS_EVT_WIFI_STATE, EKEY_WIFI_STATE, EVAL_WIFI_OFF);
netconfig_wifi_set_bgscan_pause(FALSE);
netconfig_wifi_bgscan_stop();
return;
g_service_state = new_state;
- DBG("Wi-Fi state %d ==> %d", old_state, new_state);
+ DBG("Wi-Fi service state, old state[%s] ==> new state[%s]",
+ _convert_wifi_service_state_to_string(old_state), _convert_wifi_service_state_to_string(new_state));
/* During DHCP, temporarily disable Wi-Fi power saving */
if ((old_state < NETCONFIG_WIFI_ASSOCIATION || old_state == NETCONFIG_WIFI_FAILURE) && new_state == NETCONFIG_WIFI_CONFIGURATION) {
netconfig_set_vconf_int(VCONFKEY_WIFI_STATE, VCONFKEY_WIFI_CONNECTED);
netconfig_set_vconf_int(VCONFKEY_NETWORK_WIFI_STATE, VCONFKEY_NETWORK_WIFI_CONNECTED);
- netconfig_set_system_event(SYS_EVENT_WIFI_STATE, EVT_KEY_WIFI_STATE, EVT_VAL_WIFI_CONNECTED);
+ netconfig_set_system_event(SYS_EVT_WIFI_STATE, EKEY_WIFI_STATE, EVAL_WIFI_CONNECTED);
__set_wifi_connected_essid();
netconfig_set_vconf_int (VCONFKEY_WIFI_STATE, VCONFKEY_WIFI_UNCONNECTED);
netconfig_set_vconf_int(VCONFKEY_NETWORK_WIFI_STATE, VCONFKEY_NETWORK_WIFI_NOT_CONNECTED);
- netconfig_set_system_event(SYS_EVENT_WIFI_STATE, EVT_KEY_WIFI_STATE, EVT_VAL_WIFI_ON);
+ netconfig_set_system_event(SYS_EVT_WIFI_STATE, EKEY_WIFI_STATE, EVAL_WIFI_ON);
netconfig_wifi_indicator_stop();
_wifi_state_changed(new_state);
- if (new_state == NETCONFIG_WIFI_CONNECTED) {
+ if (new_state == NETCONFIG_WIFI_CONNECTED)
_wifi_state_connected_activation();
-#if defined TIZEN_WEARABLE
- wc_launch_syspopup(WC_POPUP_TYPE_WIFI_CONNECTED);
-#endif
- }
}
wifi_service_state_e wifi_state_get_service_state(void)
g_tech_state = new_state;
- DBG("Wi-Fi technology state %d ==> %d", old_state, new_state);
+ DBG("Wi-Fi technology state, old state[%s] ==> new state[%s]",
+ _convert_wifi_technology_state_to_string(old_state), _convert_wifi_technology_state_to_string(new_state));
}
wifi_tech_state_e wifi_state_get_technology_state(void)
void wifi_state_set_connected_essid(void)
{
__set_wifi_connected_essid();
-#if defined TIZEN_WEARABLE
- wc_launch_syspopup(WC_POPUP_TYPE_WIFI_CONNECTED);
-#endif
}
void wifi_state_get_connected_essid(gchar **essid)