Remove GetProperties call from profile STATE_IND event 53/245053/3 submit/tizen/20201106.060323
authorNishant Chaprana <n.chaprana@samsung.com>
Thu, 29 Oct 2020 09:11:27 +0000 (14:41 +0530)
committerNishant Chaprana <n.chaprana@samsung.com>
Mon, 2 Nov 2020 11:20:50 +0000 (16:50 +0530)
Change-Id: I6fd74f493b5d82ec54bb815148df1eddeaabbbd0
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
packaging/capi-network-wifi-manager.spec
src/network_signal.c
src/wifi_internal.c

index a989c18..027f9fe 100755 (executable)
@@ -1,6 +1,6 @@
 Name:          capi-network-wifi-manager
 Summary:       Network Wi-Fi library in TIZEN C API
-Version:       1.2.7
+Version:       1.2.8
 Release:       1
 Group:         System/Network
 License:       Apache-2.0
index 8ce810c..ea4423d 100755 (executable)
@@ -560,7 +560,7 @@ static int __net_handle_wifi_netlink_scan_rsp(network_info_s *network_info,
 }
 
 static void __net_handle_state_ind(network_info_s *network_info,
-               const char *profile_name, net_state_type_e profile_state)
+               const char *profile_name, net_profile_info_s *prof_info)
 {
        __NETWORK_FUNC_ENTER__;
 
@@ -577,12 +577,12 @@ static void __net_handle_state_ind(network_info_s *network_info,
 
        g_strlcpy(event_data->ProfileName, profile_name, sizeof(event_data->ProfileName));
 
-       event_data->Datalength = sizeof(net_state_type_e);
-       event_data->Data = &profile_state;
+       event_data->Datalength = sizeof(net_profile_info_s);
+       event_data->Data = prof_info;
 
        WIFI_LOG(WIFI_INFO,
                        "Sending NET_EVENT_NET_STATE_IND, state: %d, profile name: %s",
-                       profile_state, event_data->ProfileName);
+                       prof_info->ProfileState, event_data->ProfileName);
 
        if (network_info->event_callback)
                network_info->event_callback(event_data, network_info->user_data);
@@ -640,7 +640,7 @@ static void __net_handle_failure_ind(network_info_s *network_info,
 
                event_data->Event = NET_EVENT_CLOSE_RSP;
        } else {
-               __net_handle_state_ind(network_info, profile_info->ProfileName, NET_STATE_TYPE_FAILURE);
+               __net_handle_state_ind(network_info, profile_info->ProfileName, profile_info);
                g_free(event_data);
                __NETWORK_FUNC_EXIT__;
                return;
@@ -814,7 +814,7 @@ static int __net_handle_service_state_changed(network_info_s *network_info,
 
        case NET_STATE_TYPE_ASSOCIATION:
        case NET_STATE_TYPE_CONFIGURATION:
-               __net_handle_state_ind(network_info, sig_path, new_state);
+               __net_handle_state_ind(network_info, sig_path, prof_info);
                break;
 
        case NET_STATE_TYPE_READY:
index 025df19..ddbe6f2 100755 (executable)
@@ -1228,10 +1228,7 @@ static void _wifi_evt_cb(net_event_info_s *event_cb, void *user_data)
 {
        bool is_requested = false;
        net_profile_info_s *prof_info_p = NULL;
-       net_profile_info_s prof_info;
        wifi_manager_error_e result = WIFI_MANAGER_ERROR_NONE;
-       bool is_profile_exists = false;
-       GSList *list = NULL;
        wifi_manager_handle_s *wifi_handle = user_data;
 
        switch (event_cb->Event) {
@@ -1333,46 +1330,17 @@ static void _wifi_evt_cb(net_event_info_s *event_cb, void *user_data)
                if (_wifi_check_profile_name_validity(event_cb->ProfileName) != true)
                        return;
 
-               if (event_cb->Datalength != sizeof(net_state_type_e))
+               if (event_cb->Datalength != sizeof(net_profile_info_s))
                        return;
 
-               net_state_type_e *profile_state = (net_state_type_e *)event_cb->Data;
-               wifi_manager_connection_state_e ap_state = _wifi_convert_to_ap_state(*profile_state);
+               prof_info_p = (net_profile_info_s *)event_cb->Data;
+               net_state_type_e profile_state = prof_info_p->ProfileState;
+               wifi_manager_connection_state_e ap_state = _wifi_convert_to_ap_state(profile_state);
 
                WIFI_LOG(WIFI_INFO, "state: %s", __convert_ap_state_to_string(ap_state));
                WIFI_LOG(WIFI_INFO, "profile name: %s", event_cb->ProfileName);
 
-               if (net_get_profile_info(wifi_handle->network_info,
-                               event_cb->ProfileName, &prof_info) == NET_ERR_NONE) {
-                       __state_changed_cb(wifi_handle, event_cb->ProfileName, &prof_info, ap_state);
-
-                       /* Free internal GSList */
-                       if (prof_info.vsie_list) {
-                               g_slist_free_full(prof_info.vsie_list, g_free);
-                               prof_info.vsie_list = NULL;
-                       }
-
-                       if (prof_info.bssid_list) {
-                               g_slist_free_full(prof_info.bssid_list, g_free);
-                               prof_info.bssid_list = NULL;
-                       }
-               } else if (ap_state == WIFI_MANAGER_CONNECTION_STATE_DISCONNECTED) {
-                       net_profile_info_s *profile = NULL;
-                       for (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 == true) {
-                               profile->ProfileState = *profile_state;
-                               __state_changed_cb(wifi_handle, event_cb->ProfileName, profile, ap_state);
-                       } else
-                               __state_changed_cb(wifi_handle, event_cb->ProfileName, NULL, ap_state);
-               } else
-                       __state_changed_cb(wifi_handle, event_cb->ProfileName, NULL, ap_state);
+               __state_changed_cb(wifi_handle, event_cb->ProfileName, prof_info_p, ap_state);
 
                break;
        case NET_EVENT_WIFI_SCAN_RSP: