[TSAM-10389] Fixed AP Name Display on Network Settings 52/101352/1 accepted/tizen/common/20161201.135857 accepted/tizen/ivi/20161202.005239 accepted/tizen/mobile/20161202.005143 accepted/tizen/tv/20161202.005200 accepted/tizen/wearable/20161202.005218 submit/tizen/20161201.032946
authorsinikang <sinikang@samsung.com>
Thu, 1 Dec 2016 02:56:43 +0000 (11:56 +0900)
committersinikang <sinikang@samsung.com>
Thu, 1 Dec 2016 02:56:43 +0000 (11:56 +0900)
Description: This patch fixes the AP Name which is displayed
in Connected Network Settings of AP in mobile device.

Change-Id: I1d9016d6dcd647deefb8c64af89e402f036387fd

packaging/wifi-efl-ug.spec
sources/ui-gadget/viewers-layout/view_detail.c

index 28907f8..ef2dc90 100644 (file)
@@ -1,7 +1,7 @@
 %define _unpackaged_files_terminate_build 0
 Name:          wifi-efl-ug
 Summary:       Wi-Fi UI Gadget for TIZEN
-Version:       1.0.218
+Version:       1.0.219
 Release:       1
 Group:         App/Network
 License:       Flora-1.1
index a37da01..3b3b620 100755 (executable)
@@ -334,6 +334,9 @@ static void _remove_all(view_detail_data *_detail_data)
                ip_info_delete_prev(_detail_data->ip_info->prev_ip_info);
                _detail_data->ip_info->prev_ip_info = NULL;
 
+               wifi_ap_destroy(_detail_data->ap);
+               _detail_data->ap = NULL;
+
                g_free(_detail_data->ap_image_path);
                _detail_data->ap_image_path = NULL;
 
@@ -574,7 +577,6 @@ void view_detail(wifi_device_info_t *device_info, Evas_Object *win_main,
        __COMMON_FUNC_ENTER__;
        bool favorite = 0;
        guint id;
-       wifi_ap_h ap;
        static Elm_Genlist_Item_Class grouptitle_itc;
        Evas_Object *layout = NULL;
        Evas_Object *navi_frame = NULL;
@@ -601,8 +603,15 @@ void view_detail(wifi_device_info_t *device_info, Evas_Object *win_main,
 
        _detail_data->win = win_main;
        _detail_data->nav = navi_frame;
-       _detail_data->ap = ap = device_info->ap;
-       wifi_ap_is_favorite(ap, &favorite);
+
+       if (wifi_ap_clone(&_detail_data->ap, device_info->ap) != WIFI_ERROR_NONE) {
+               ERROR_LOG(UG_NAME_NORMAL, "Failed to get cloned ap");
+               g_free(_detail_data);
+               __COMMON_FUNC_EXIT__;
+               return;
+       }
+
+       wifi_ap_is_favorite(_detail_data->ap, &favorite);
 
        if (device_info->ap_image_path) {
                _detail_data->ap_image_path = g_strdup(device_info->ap_image_path);
@@ -697,12 +706,12 @@ void view_detail(wifi_device_info_t *device_info, Evas_Object *win_main,
        }
 
        wifi_security_type_e type = WIFI_SECURITY_TYPE_NONE;
-       wifi_ap_get_security_type(ap, &type);
+       wifi_ap_get_security_type(_detail_data->ap, &type);
        if (WIFI_SECURITY_TYPE_EAP == type) {
                wifi_connection_state_e connection_state;
-               wifi_ap_get_connection_state(ap, &connection_state);
+               wifi_ap_get_connection_state(_detail_data->ap, &connection_state);
                if (favorite || WIFI_CONNECTION_STATE_CONNECTED == connection_state) {
-                       _detail_data->eap_info_list = eap_info_append_items(ap,
+                       _detail_data->eap_info_list = eap_info_append_items(_detail_data->ap,
                                        detailview_list, PACKAGE, __view_detail_imf_ctxt_evnt_cb,
                                        navi_it);
                }
@@ -711,6 +720,8 @@ void view_detail(wifi_device_info_t *device_info, Evas_Object *win_main,
        /* Append the ip info details */
        id = common_util_managed_idle_add(__view_detail_load_ip_info_list_cb, _detail_data);
        if (!id) {
+               wifi_ap_destroy(_detail_data->ap);
+               g_free(_detail_data->ap_image_path);
                g_free(_detail_data);
        }