Tethering: Do not trigger scan event when turning on Wi-Fi tethering 71/5671/1
authorLiu, Guoqiang <guoqiangx.liu@intel.com>
Mon, 1 Apr 2013 07:35:59 +0000 (15:35 +0800)
committerZhang zhengguang <zhengguang.zhang@intel.com>
Fri, 12 Jul 2013 05:55:52 +0000 (13:55 +0800)
Two signals received when turning on Wi-Fi tethering:
"Powered on" and "Tethering on", do not trigger scan event
when received the Wi-Fi "Powered on" signal in this case.

Signed-off-by: Liu, Guoqiang <guoqiangx.liu@intel.com>
src/wifi-background-scan.c

index 46e98e2..a53628a 100644 (file)
@@ -153,10 +153,18 @@ static gboolean __netconfig_wifi_bgscan_request_scan(gpointer data)
 {
        struct bgscan_timer_data *timer = (struct bgscan_timer_data *)data;
        int pm_state = VCONFKEY_PM_STATE_NORMAL;
+       int hotspot_wifi_state = VCONFKEY_MOBILE_HOTSPOT_WIFI_OFF;
 
        if (timer == NULL)
                return FALSE;
 
+       /* If Wi-Fi tethering is pending on, don't trigger scan event*/
+       vconf_get_int(VCONFKEY_MOBILE_HOTSPOT_WIFI_STATE, &hotspot_wifi_state);
+       if (hotspot_wifi_state == VCONFKEY_MOBILE_HOTSPOT_WIFI_PENDING_ON) {
+               DBG("hotspot_wifi_state %d", hotspot_wifi_state);
+               return TRUE;
+       }
+
        /* In case of LCD off, we don't need Wi-Fi scan */
        vconf_get_int(VCONFKEY_PM_STATE, &pm_state);
        if (pm_state >= VCONFKEY_PM_STATE_LCDOFF)