Validate profile when DISCONNECTED before sending callback 34/248234/4
authorNishant Chaprana <n.chaprana@samsung.com>
Tue, 24 Nov 2020 05:46:04 +0000 (11:16 +0530)
committerNishant Chaprana <n.chaprana@samsung.com>
Thu, 26 Nov 2020 05:55:25 +0000 (11:25 +0530)
Change-Id: I39a1d9458c77f3521fba740547d2178d1cbd5179
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
packaging/capi-network-wifi-manager.spec
src/wifi_internal.c

index ca2277b..3c60183 100755 (executable)
@@ -1,6 +1,6 @@
 Name:          capi-network-wifi-manager
 Summary:       Network Wi-Fi library in TIZEN C API
-Version:       1.3.3
+Version:       1.3.4
 Release:       1
 Group:         System/Network
 License:       Apache-2.0
index ed8df84..36eb4fb 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: