[wifi-ug-efl]:Refactoring the Scan handling Path 31/104831/1
authorManeesh Jain <maneesh.jain@samsung.com>
Wed, 14 Dec 2016 11:03:02 +0000 (16:33 +0530)
committerManeesh Jain <maneesh.jain@samsung.com>
Wed, 14 Dec 2016 11:03:02 +0000 (16:33 +0530)
Description: This patch is used to handle following case.

1. Issue the Scan using "scan" button
2. Press the "WiFi" option to get the Scan list

Change-Id: Ic3a63d5e4ddf72f454a1336506af9dcc335b32c1
Signed-off-by: Maneesh Jain <maneesh.jain@samsung.com>
sources/libraries/WlanManager/WlanManager/wlan_manager.c
sources/ui-gadget/wifi-efl-UG.c

index 0fe7208..a8c7bc6 100755 (executable)
@@ -173,8 +173,10 @@ static void wlan_manager_network_event_cb(
                goto exit;
                /* fall through */
        case WLAN_MANAGER_REQ_TYPE_SCAN:
+               INFO_LOG(UG_NAME_NORMAL, "Scan Complete Event ");
                if (WIFI_ERROR_NONE == error_code) {
                        event_info.event_type = WLAN_MANAGER_RESPONSE_TYPE_SCAN_OK;
+                       manager_object->b_scan_blocked = FALSE;
                } else {
                        goto exit;
                }
@@ -813,6 +815,7 @@ int wlan_manager_scan(void)
        wlan_mgr_req_data_t *req_data = g_new0(wlan_mgr_req_data_t, 1);
        req_data->req_type = WLAN_MANAGER_REQ_TYPE_SCAN;
 
+       manager_object->b_scan_blocked = TRUE;
        int ret = wifi_scan(wlan_manager_network_event_cb, req_data);
        if (ret != WLAN_MANAGER_ERR_NONE) {
                ERROR_LOG(UG_NAME_REQ, "Scan failed. Ret: %d", ret);
@@ -824,9 +827,8 @@ int wlan_manager_scan(void)
        }
 
        /* Since the scan request was success,
-        * lets reset the ui refresh and scan update blocked flags.
+        * lets reset the ui refresh
         */
-       manager_object->b_scan_blocked = FALSE;
        manager_object->b_ui_refresh = FALSE;
 
        __COMMON_FUNC_EXIT__;
index 8da98c1..350a791 100755 (executable)
@@ -77,8 +77,9 @@ static void _bg_scan_status_callback(GDBusConnection *conn,
                if (g_strcmp0(key, "Scanning") == 0) {
                        value = g_variant_get_boolean(var);
                        if (value) {
-                               viewer_manager_header_mode_set(HEADER_MODE_SEARCHING);
-                               viewer_manager_show(VIEWER_WINSET_SEARCHING);
+                               //TODO: Ignore the Supplicant Property Change Singal.
+                               //viewer_manager_header_mode_set(HEADER_MODE_SEARCHING);
+                               //viewer_manager_show(VIEWER_WINSET_SEARCHING);
                        }
 
                        g_variant_unref(var);
@@ -259,8 +260,10 @@ static void *on_create(ui_gadget_h ug, enum ug_mode mode,
        case WLAN_MANAGER_UNCONNECTED:
        case WLAN_MANAGER_CONNECTED:
                viewer_manager_hide(VIEWER_WINSET_SEARCHING);
+               viewer_manager_header_mode_set(HEADER_MODE_ON);
                viewer_manager_show(VIEWER_WINSET_SUB_CONTENTS);
-               viewer_manager_header_mode_set(HEADER_MODE_SEARCHING);
+               INFO_LOG(UG_NAME_NORMAL, "Issue the WiFi Scan");
+               viewer_manager_request_scan();
                break;
 
        case WLAN_MANAGER_ERROR: