From 10b392ed494255b7c0a50a998f768989d9a29752 Mon Sep 17 00:00:00 2001 From: "Liu, Guoqiang" Date: Mon, 1 Apr 2013 15:35:59 +0800 Subject: [PATCH] Tethering: Do not trigger scan event when turning on Wi-Fi tethering 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 --- src/wifi-background-scan.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/wifi-background-scan.c b/src/wifi-background-scan.c index 46e98e2..a53628a 100644 --- a/src/wifi-background-scan.c +++ b/src/wifi-background-scan.c @@ -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) -- 2.7.4