Revert "Fix compile error which is specific for GCC 6.2"
[platform/core/connectivity/net-config.git] / src / wifi-state.c
index 3819afc..072431f 100755 (executable)
@@ -45,6 +45,8 @@ static wifi_tech_state_e g_tech_state = NETCONFIG_WIFI_TECH_UNKNOWN;
 
 static GSList *notifier_list = NULL;
 
+static guint network_connected_popup_timer_id = 0;
+static gboolean block_network_connected_popup = FALSE;
 
 static void __netconfig_pop_wifi_connected_poppup(const char *ssid)
 {
@@ -66,6 +68,13 @@ static void __netconfig_pop_wifi_connected_poppup(const char *ssid)
        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)
 {
        const char *essid_name = NULL;
@@ -87,7 +96,15 @@ 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)
@@ -585,12 +602,8 @@ void wifi_state_set_service_state(wifi_service_state_e new_state)
 
        _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)
@@ -677,9 +690,6 @@ 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)