From: Nishant Chaprana Date: Thu, 26 Nov 2020 11:27:57 +0000 (+0530) Subject: Validate profile when DISCONNECTED before sending callback X-Git-Tag: submit/tizen_6.0/20201127.053526~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=301ba474c1c2c24fc7cf636f0a9da5b69a4db2dd;p=platform%2Fcore%2Fapi%2Fwifi-manager.git Validate profile when DISCONNECTED before sending callback Change-Id: I2577766708887d14dd03783d382d0e507149a85e Signed-off-by: Nishant Chaprana --- diff --git a/packaging/capi-network-wifi-manager.spec b/packaging/capi-network-wifi-manager.spec index 2079c34..33a17e8 100755 --- a/packaging/capi-network-wifi-manager.spec +++ b/packaging/capi-network-wifi-manager.spec @@ -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 diff --git a/src/wifi_internal.c b/src/wifi_internal.c index ed8df84..36eb4fb 100755 --- a/src/wifi_internal.c +++ b/src/wifi_internal.c @@ -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: