From f2165b709154d05952587fed6d967b7b0d7f2f88 Mon Sep 17 00:00:00 2001 From: Milind Murhekar Date: Thu, 10 Nov 2016 19:47:43 +0530 Subject: [PATCH] [TSAM-9221] Fixed Issue for multiple network connected popup's Change-Id: I0ea09f6e1a5ad5594ac2b9da6b8cff1f25571a54 Signed-off-by: cheoleun --- src/wifi-state.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/wifi-state.c b/src/wifi-state.c index 95618f4..072431f 100755 --- a/src/wifi-state.c +++ b/src/wifi-state.c @@ -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) -- 2.34.1