Validate profile when DISCONNECTED before sending callback 38/248438/1
authorNishant Chaprana <n.chaprana@samsung.com>
Thu, 26 Nov 2020 11:27:57 +0000 (16:57 +0530)
committerNishant Chaprana <n.chaprana@samsung.com>
Thu, 26 Nov 2020 11:27:57 +0000 (16:57 +0530)
Change-Id: I2577766708887d14dd03783d382d0e507149a85e
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
packaging/capi-network-wifi-manager.spec
src/wifi_internal.c

index 2079c34f3d82e6e15e118bcd1c8567ac4383cb92..33a17e8638f93f8cc8aa5ce2e80ba80d756936d6 100755 (executable)
@@ -1,6 +1,6 @@
 Name:          capi-network-wifi-manager
 Summary:       Network Wi-Fi library in TIZEN C API
-Version:       1.2.11
+Version:       1.2.12
 Release:       1
 Group:         System/Network
 License:       Apache-2.0
index ed8df84599e9eef7f2f74900a27673f51339ef65..36eb4fbd327c6520efea241207c0553183a69b1b 100755 (executable)
@@ -1335,8 +1335,23 @@ static void _wifi_evt_cb(net_event_info_s *event_cb, void *user_data)
                WIFI_LOG(WIFI_INFO, "state: %s", __convert_ap_state_to_string(ap_state));
                WIFI_LOG(WIFI_INFO, "profile name: %s", event_cb->ProfileName);
 
-               __state_changed_cb(wifi_handle, event_cb->ProfileName, prof_info_p, ap_state);
+               if (ap_state == WIFI_MANAGER_CONNECTION_STATE_DISCONNECTED) {
+                       net_profile_info_s *profile = NULL;
+                       bool is_profile_exists = false;
+
+                       for (GSList *list = wifi_handle->profile_iterator; list; list = list->next) {
+                               profile = (net_profile_info_s *)list->data;
+                               if (!g_strcmp0(event_cb->ProfileName, profile->ProfileName)) {
+                                       is_profile_exists = true;
+                                       break;
+                               }
+                       }
 
+                       if (is_profile_exists == false)
+                               prof_info_p = NULL;
+               }
+
+               __state_changed_cb(wifi_handle, event_cb->ProfileName, prof_info_p, ap_state);
                break;
        case NET_EVENT_WIFI_SCAN_RSP:
        case NET_EVENT_WIFI_SCAN_IND: