Modify background scan policy
authorDanny Jeongseok Seo <S.Seo@samsung.com>
Thu, 19 Jul 2012 04:24:25 +0000 (13:24 +0900)
committerDanny Jeongseok Seo <S.Seo@samsung.com>
Thu, 19 Jul 2012 04:24:25 +0000 (13:24 +0900)
debian/changelog
packaging/net-config.spec
src/wifi-background-scan.c

index ac6187b..a19f990 100644 (file)
@@ -1,3 +1,12 @@
+net-config (0.1.75) unstable; urgency=low
+
+  * Modify background scan policy
+  * disallow to request bg scan in case the state is connected and rssi is below level 2
+  * Git: slp/pkgs/n/net-config
+  * Tag: net-config_0.1.75
+
+ -- Sanghoon Cho <sanghoon80.cho@samsung.com>  Fri, 13 Apr 2012 16:37:55 +0900
+
 net-config (0.1.74) unstable; urgency=low
 
   * Fix Wi-Fi power bug when Wi-Fi direct is on
index dfad74a..5a565ce 100644 (file)
@@ -2,7 +2,7 @@
 
 Name:       net-config
 Summary:    TIZEN Network Configuration Module
-Version:    0.1.74
+Version:    0.1.75
 Release:    1
 Group:      System/Network
 License:    Apache License Version 2.0
index 3cc6026..3abe65f 100644 (file)
  */
 
 #include <glib.h>
+#include <vconf.h>
+#include <vconf-keys.h>
 
 #include "log.h"
 #include "dbus.h"
 #include "util.h"
 #include "wifi.h"
+#include "wifi-state.h"
 #include "wifi-background-scan.h"
 
 #define SCAN_INITIAL_DELAY             10
@@ -91,6 +94,17 @@ static gboolean __netconfig_wifi_bgscan_request_connman_scan(void)
                NULL
        };
 
+       int snr_level = 0;
+
+       vconf_get_int(VCONFKEY_WIFI_STRENGTH, &snr_level);
+       if (netconfig_wifi_state_get_service_state() == NETCONFIG_WIFI_CONNECTED)
+               if (__netconfig_wifi_bgscan_get_mode() == WIFI_BGSCAN_MODE_EXPONENTIAL)
+                       if (snr_level > 2)
+                               return FALSE;
+
+       if (netconfig_wifi_state_get_service_state() == NETCONFIG_WIFI_CONNECTING)
+               return FALSE;
+
        param_array[0] = path;
        param_array[1] = request;
        param_array[2] = param1;