Add a number of iteration for updating device list 92/245892/1
authorhyunuk.tak <hyunuk.tak@samsung.com>
Mon, 19 Oct 2020 07:48:39 +0000 (16:48 +0900)
committerhyunuk.tak <hyunuk.tak@samsung.com>
Mon, 19 Oct 2020 07:48:39 +0000 (16:48 +0900)
Change-Id: Ia4c4f74ca41907cf154ed627f87f8a4fda094d51

src/wifi-state.c

index 8b7e4a6eaaa222f5c3b117dd1a81ce3c1db612ad..ee3b1d424e4e9ddd8724b176c32f5e82246f584a 100755 (executable)
 #include "network-statistics.h"
 #include "wifi-background-scan.h"
 
+#define NETCONFIG_UPDATE_DEVICE_LIST_COUNT             3
 #define NETCONFIG_UPDATE_DEVICE_LIST_TIMEOUT   1 * 1000
 #define NETCONFIG_NETWORK_NOTIFICATION_TIMEOUT 15 * 1000
 
 static gboolean new_bss_found = FALSE;
 
+static guint network_update_timer_cnt = 0;
 static guint network_update_timer_id = 0;
 static guint network_noti_timer_id = 0;
 
@@ -727,8 +729,13 @@ GSList *wifi_state_get_device_list(void)
 
 static gboolean __state_update_device_list(gpointer data)
 {
-       if (wifi_state_update_device_list() == FALSE)
-               return TRUE;
+       if (wifi_state_update_device_list() == FALSE) {
+               if (network_update_timer_cnt <
+                       NETCONFIG_UPDATE_DEVICE_LIST_COUNT) {
+                       network_update_timer_cnt++;
+                       return TRUE;
+               }
+       }
 
        netconfig_stop_timer(&network_update_timer_id);
        return FALSE;