From cd3cc7d195cf722f51e319ec83fcecd811d35eed Mon Sep 17 00:00:00 2001 From: Nishant Chaprana Date: Wed, 26 Oct 2016 17:22:58 +0530 Subject: [PATCH 01/16] Remove redundant NULL check for ugd in __motion_shake_cb() Change-Id: Ida43e7edb82699785cbfd37762775e4091b0c440 Signed-off-by: Nishant Chaprana --- packaging/ug-setting-wifidirect-efl.spec | 2 +- ug-wifidirect/src/wfd_motion_control.c | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/packaging/ug-setting-wifidirect-efl.spec b/packaging/ug-setting-wifidirect-efl.spec index 3dc7971..1791d00 100644 --- a/packaging/ug-setting-wifidirect-efl.spec +++ b/packaging/ug-setting-wifidirect-efl.spec @@ -1,6 +1,6 @@ Name: ug-setting-wifidirect-efl Summary: Wi-Fi Direct setting UI gadget -Version: 1.11.81 +Version: 1.11.82 Release: 1 Group: Applications/Network License: Flora-1.1 diff --git a/ug-wifidirect/src/wfd_motion_control.c b/ug-wifidirect/src/wfd_motion_control.c index f3ca73f..8eae098 100755 --- a/ug-wifidirect/src/wfd_motion_control.c +++ b/ug-wifidirect/src/wfd_motion_control.c @@ -91,11 +91,6 @@ static void __motion_shake_cb(unsigned int event_type, sensor_event_data_t *even int ret = -1; const char *btn_text = NULL; - if (NULL == ugd) { - DBG(LOG_ERROR, "Incorrect parameter(NULL)\n"); - return; - } - wfd_refresh_wifi_direct_state(ugd); if (NULL == ugd->scan_toolbar) { -- 2.7.4 From 454cf0afcf029c42b9d0d0618b423cd822a16e22 Mon Sep 17 00:00:00 2001 From: Yu Jiung Date: Tue, 15 Nov 2016 15:54:38 +0900 Subject: [PATCH 02/16] Remove unused layout style Change-Id: Ic58858dd1de94de634f60630ea2829c912389784 Signed-off-by: Yu jiung --- packaging/ug-setting-wifidirect-efl.spec | 2 +- ug-wifidirect/include/wfd_ug_view.h | 2 ++ ug-wifidirect/src/wfd_ug_genlist.c | 46 ++++++++++---------------------- 3 files changed, 17 insertions(+), 33 deletions(-) diff --git a/packaging/ug-setting-wifidirect-efl.spec b/packaging/ug-setting-wifidirect-efl.spec index 1791d00..731a13d 100644 --- a/packaging/ug-setting-wifidirect-efl.spec +++ b/packaging/ug-setting-wifidirect-efl.spec @@ -1,6 +1,6 @@ Name: ug-setting-wifidirect-efl Summary: Wi-Fi Direct setting UI gadget -Version: 1.11.82 +Version: 1.11.83 Release: 1 Group: Applications/Network License: Flora-1.1 diff --git a/ug-wifidirect/include/wfd_ug_view.h b/ug-wifidirect/include/wfd_ug_view.h index 9997f30..5ff7090 100644 --- a/ug-wifidirect/include/wfd_ug_view.h +++ b/ug-wifidirect/include/wfd_ug_view.h @@ -60,6 +60,8 @@ #define WFD_ICON_DEVICE_MORE_HELP "A09_popup_help.png" +#define WFD_UG_EDJ_ICON_SIZE 40 + enum { HEAD_TEXT_TYPE_DIRECT, HEAD_TEXT_TYPE_DEACTIVATING, diff --git a/ug-wifidirect/src/wfd_ug_genlist.c b/ug-wifidirect/src/wfd_ug_genlist.c index 18fabf1..329d26c 100755 --- a/ug-wifidirect/src/wfd_ug_genlist.c +++ b/ug-wifidirect/src/wfd_ug_genlist.c @@ -358,7 +358,6 @@ static Evas_Object *_gl_peer_icon_get(void *data, Evas_Object *obj, const char * assertm_if(NULL == part, "NULL!!"); device_type_s *peer = (device_type_s *) data; Evas_Object *icon = NULL; - Evas_Object *layout = NULL; if (data == NULL) { DBG(LOG_ERROR, "Incorrect parameter(NULL)\n"); @@ -367,10 +366,8 @@ static Evas_Object *_gl_peer_icon_get(void *data, Evas_Object *obj, const char * DBG(LOG_INFO, "part = %s", part); if (!strcmp("elm.swallow.icon", part)) { - DBG(LOG_INFO, "elm.swallow.icon - category [%d]\n", peer->category); char *img_name = NULL; - layout = elm_layout_add(obj); - elm_layout_theme_set(layout, "layout", "list/B/type.3", "default"); + DBG(LOG_INFO, "elm.swallow.icon - category [%d]\n", peer->category); /* * the icon of connected device is * different from available and busy device @@ -424,34 +421,28 @@ static Evas_Object *_gl_peer_icon_get(void *data, Evas_Object *obj, const char * break; } - icon = elm_image_add(layout); + icon = elm_image_add(obj); elm_image_file_set(icon, WFD_UG_EDJ_PATH, img_name); - evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_min_set(icon, ELM_SCALE_SIZE(WFD_UG_EDJ_ICON_SIZE), + ELM_SCALE_SIZE(WFD_UG_EDJ_ICON_SIZE)); evas_object_color_set(icon, 2, 61, 132, 204); - evas_object_show(icon); - evas_object_propagate_events_set(icon, EINA_FALSE); - elm_layout_content_set(layout, "elm.swallow.content", icon); + if(img_name) + DBG(LOG_INFO, "img_name = %s", img_name); + } else if (!strcmp("elm.swallow.end", part)) { DBG(LOG_INFO, "elm.icon.2 - connection status [%d]\n", peer->conn_status); if (peer->conn_status == PEER_CONN_STATUS_CONNECTING) { - layout = elm_layout_add(obj); - elm_layout_theme_set(layout, "layout", "list/C/type.2", "default"); - icon = elm_progressbar_add(layout); + icon = elm_progressbar_add(obj); elm_object_style_set(icon, "process_medium"); elm_progressbar_pulse(icon, EINA_TRUE); } else if (peer->conn_status == PEER_CONN_STATUS_CONNECTED) { return NULL; } - evas_object_show(icon); - elm_layout_content_set(layout, "elm.swallow.content", icon); } - if (layout) - evas_object_show(layout); - __FUNC_EXIT__; - return layout; + + return icon; } /** @@ -468,7 +459,6 @@ static Evas_Object *_gl_conn_peer_icon_get(void *data, Evas_Object *obj, const c assertm_if(NULL == part, "NULL!!"); device_type_s *peer = (device_type_s *) data; Evas_Object *icon = NULL; - Evas_Object *layout = NULL; if (data == NULL) { DBG(LOG_ERROR, "Incorrect parameter(NULL)\n"); @@ -479,8 +469,6 @@ static Evas_Object *_gl_conn_peer_icon_get(void *data, Evas_Object *obj, const c if (!strcmp("elm.swallow.icon", part)) { DBG(LOG_INFO, "elm.swallow.icon - category [%d]\n", peer->category); char *img_name = NULL; - layout = elm_layout_add(obj); - elm_layout_theme_set(layout, "layout", "list/B/type.3", "default"); /* * the icon of connected device is * different from available and busy device @@ -534,21 +522,15 @@ static Evas_Object *_gl_conn_peer_icon_get(void *data, Evas_Object *obj, const c break; } - icon = elm_image_add(layout); + icon = elm_image_add(obj); elm_image_file_set(icon, WFD_UG_EDJ_PATH, img_name); - evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_min_set(icon, ELM_SCALE_SIZE(WFD_UG_EDJ_ICON_SIZE), + ELM_SCALE_SIZE(WFD_UG_EDJ_ICON_SIZE)); evas_object_color_set(icon, 2, 61, 132, 204); - evas_object_show(icon); - evas_object_propagate_events_set(icon, EINA_FALSE); - elm_layout_content_set(layout, "elm.swallow.content", icon); } - if (layout) - evas_object_show(layout); - __FUNC_EXIT__; - return layout; + return icon; } /** -- 2.7.4 From e56a9beaa8e2db7e6eedb16badba21342808a6be Mon Sep 17 00:00:00 2001 From: Yu Jiung Date: Tue, 6 Dec 2016 17:55:29 +0900 Subject: [PATCH 03/16] Fix Svace issues WGID 143851, 152686, 152691 Change-Id: I42d8ddcad12cde927790f6fd9dbd863cfa7945be Signed-off-by: Yu jiung --- packaging/ug-setting-wifidirect-efl.spec | 2 +- popup-wifidirect/src/wfd-app-client.c | 4 ++-- popup-wifidirect/src/wfd-app-util.c | 5 +++-- ug-wifidirect/src/wfd_client.c | 6 +++--- ug-wifidirect/src/wfd_ug_main_view.c | 3 ++- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/packaging/ug-setting-wifidirect-efl.spec b/packaging/ug-setting-wifidirect-efl.spec index 731a13d..e431e88 100644 --- a/packaging/ug-setting-wifidirect-efl.spec +++ b/packaging/ug-setting-wifidirect-efl.spec @@ -1,6 +1,6 @@ Name: ug-setting-wifidirect-efl Summary: Wi-Fi Direct setting UI gadget -Version: 1.11.83 +Version: 1.11.84 Release: 1 Group: Applications/Network License: Flora-1.1 diff --git a/popup-wifidirect/src/wfd-app-client.c b/popup-wifidirect/src/wfd-app-client.c index 43bb060..737f47f 100644 --- a/popup-wifidirect/src/wfd-app-client.c +++ b/popup-wifidirect/src/wfd-app-client.c @@ -64,8 +64,8 @@ bool _wfd_connected_peer_cb(wifi_direct_connected_peer_info_s *peer, void *user_ } int peer_cnt = ad->raw_connected_peer_cnt; - strncpy(ad->raw_connected_peers[peer_cnt].ssid, peer->device_name, sizeof(ad->raw_connected_peers[peer_cnt].ssid) - 1); - strncpy(ad->raw_connected_peers[peer_cnt].mac_address, peer->mac_address, WFD_MAC_ADDRESS_SIZE - 1); + g_strlcpy(ad->raw_connected_peers[peer_cnt].ssid, peer->device_name, sizeof(ad->raw_connected_peers[peer_cnt].ssid)); + g_strlcpy(ad->raw_connected_peers[peer_cnt].mac_address, peer->mac_address, WFD_MAC_ADDRESS_SIZE); ad->raw_connected_peer_cnt++; diff --git a/popup-wifidirect/src/wfd-app-util.c b/popup-wifidirect/src/wfd-app-util.c index 96ffea1..eb99384 100644 --- a/popup-wifidirect/src/wfd-app-util.c +++ b/popup-wifidirect/src/wfd-app-util.c @@ -61,7 +61,7 @@ char *wfd_app_trim_path(const char *filewithpath) const char *space = " "; int len = strlen(filewithpath); - if (len > 20) { + if (len >= 20) { strptr = (char *) filewithpath + (len - 20); start = 0; } else if (len < 20) { @@ -70,7 +70,8 @@ char *wfd_app_trim_path(const char *filewithpath) } strncpy((char *) filename, space, strlen(space)); - strncpy((char *) filename + start, strptr, 50); + if(strptr) + strncpy((char *) filename + start, strptr, 50); return (char *) filename; #endif diff --git a/ug-wifidirect/src/wfd_client.c b/ug-wifidirect/src/wfd_client.c index 4d0052b..0c15a91 100644 --- a/ug-wifidirect/src/wfd_client.c +++ b/ug-wifidirect/src/wfd_client.c @@ -636,11 +636,11 @@ bool _wfd_connected_peer_cb(wifi_direct_connected_peer_info_s *peer, void *user_ DBG(LOG_INFO, "\tServices: [%s]\n", services); } - strncpy(ugd->raw_connected_peers[peer_cnt].ssid, peer->device_name, sizeof(ugd->raw_connected_peers[peer_cnt].ssid) - 1); + g_strlcpy(ugd->raw_connected_peers[peer_cnt].ssid, peer->device_name, sizeof(ugd->raw_connected_peers[peer_cnt].ssid)); ugd->raw_connected_peers[peer_cnt].category = peer->primary_device_type; ugd->raw_connected_peers[peer_cnt].sub_category = peer->secondary_device_type; - strncpy(ugd->raw_connected_peers[peer_cnt].mac_addr, peer->mac_address, MAC_LENGTH - 1); - strncpy(ugd->raw_connected_peers[peer_cnt].if_addr, peer->interface_address, MAC_LENGTH - 1); + g_strlcpy(ugd->raw_connected_peers[peer_cnt].mac_addr, peer->mac_address, MAC_LENGTH); + g_strlcpy(ugd->raw_connected_peers[peer_cnt].if_addr, peer->interface_address, MAC_LENGTH); ugd->raw_connected_peers[peer_cnt].conn_status = PEER_CONN_STATUS_CONNECTED; DBG(LOG_INFO, "\tStatus: [%d]\n", ugd->raw_connected_peers[peer_cnt].conn_status); diff --git a/ug-wifidirect/src/wfd_ug_main_view.c b/ug-wifidirect/src/wfd_ug_main_view.c index 7b3dba0..00126c2 100755 --- a/ug-wifidirect/src/wfd_ug_main_view.c +++ b/ug-wifidirect/src/wfd_ug_main_view.c @@ -1366,13 +1366,14 @@ void wfd_ug_update_toolbar(struct ug_data *ugd) elm_object_part_content_set(ugd->button_layout, "button.next", btn); ugd->disconnect_btn = btn; evas_object_show(ugd->disconnect_btn); + DBG(LOG_INFO, "button: disconnect button added\n"); } elm_object_part_content_set(ugd->button_layout, "button.prev", ugd->scan_toolbar); wfd_ug_view_refresh_button(ugd->scan_toolbar, "IDS_WIFI_SK4_SCAN", TRUE); evas_object_data_set(ugd->disconnect_btn, "multi", "disconnect"); - DBG(LOG_INFO, "button: disconnect button added\n"); + DBG(LOG_INFO, "button: scan button added\n"); } else { if (no_of_conn_dev == 0 && ugd->disconnect_btn != NULL) { DBG(LOG_INFO, "disconnect btn removed when conn failed\n"); -- 2.7.4 From 59bdd96fe9bf5bb8350a51db2c28e30c7c2f8fd3 Mon Sep 17 00:00:00 2001 From: taesub kim Date: Thu, 9 Mar 2017 14:33:10 +0900 Subject: [PATCH 04/16] Modified NOTICE file and license version Change-Id: Id4e5f639e354a7e2801dffc5be1073358d7c6f70 Signed-off-by: Taesub Kim --- NOTICE | 4 +++- popup-wifidirect/include/wfd-app-strings.h | 2 +- popup-wifidirect/include/wfd-app-util.h | 2 +- popup-wifidirect/include/wfd-app.h | 2 +- popup-wifidirect/src/wfd-app-client.c | 2 +- popup-wifidirect/src/wfd-app-main.c | 2 +- popup-wifidirect/src/wfd-app-popup-view.c | 2 +- popup-wifidirect/src/wfd-app-util.c | 2 +- ug-wifidirect/include/wfd_client.h | 2 +- ug-wifidirect/include/wfd_motion_control.h | 2 +- ug-wifidirect/include/wfd_ug.h | 2 +- ug-wifidirect/include/wfd_ug_view.h | 2 +- ug-wifidirect/src/wfd_client.c | 2 +- ug-wifidirect/src/wfd_motion_control.c | 2 +- ug-wifidirect/src/wfd_ug.c | 2 +- ug-wifidirect/src/wfd_ug_genlist.c | 2 +- ug-wifidirect/src/wfd_ug_main_view.c | 2 +- ug-wifidirect/src/wfd_ug_multiconnect_view.c | 2 +- ug-wifidirect/src/wfd_ug_popup.c | 2 +- ug-wifidirect/src/wfd_ug_rename_popup.c | 2 +- 20 files changed, 22 insertions(+), 20 deletions(-) diff --git a/NOTICE b/NOTICE index 4297ee3..db64ab0 100644 --- a/NOTICE +++ b/NOTICE @@ -1 +1,3 @@ -Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. +Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. +Except as noted, this software is licensed under Flora License, Version 1.1 +Please, see the LICENSE file for Flora License, Version 1.1 terms and conditions. diff --git a/popup-wifidirect/include/wfd-app-strings.h b/popup-wifidirect/include/wfd-app-strings.h index 60dac53..1031afb 100644 --- a/popup-wifidirect/include/wfd-app-strings.h +++ b/popup-wifidirect/include/wfd-app-strings.h @@ -3,7 +3,7 @@ * * Copyright 2012 Samsung Electronics Co., Ltd -* Licensed under the Flora License, Version 1.0 (the "License"); +* Licensed under the Flora License, Version 1.1 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/popup-wifidirect/include/wfd-app-util.h b/popup-wifidirect/include/wfd-app-util.h index e1adb1d..a843af9 100755 --- a/popup-wifidirect/include/wfd-app-util.h +++ b/popup-wifidirect/include/wfd-app-util.h @@ -3,7 +3,7 @@ * * Copyright 2012 Samsung Electronics Co., Ltd -* Licensed under the Flora License, Version 1.0 (the "License"); +* Licensed under the Flora License, Version 1.1 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/popup-wifidirect/include/wfd-app.h b/popup-wifidirect/include/wfd-app.h index c991236..d9adfe9 100644 --- a/popup-wifidirect/include/wfd-app.h +++ b/popup-wifidirect/include/wfd-app.h @@ -3,7 +3,7 @@ * * Copyright 2012 Samsung Electronics Co., Ltd -* Licensed under the Flora License, Version 1.0 (the "License"); +* Licensed under the Flora License, Version 1.1 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/popup-wifidirect/src/wfd-app-client.c b/popup-wifidirect/src/wfd-app-client.c index 737f47f..a9ad6ed 100644 --- a/popup-wifidirect/src/wfd-app-client.c +++ b/popup-wifidirect/src/wfd-app-client.c @@ -3,7 +3,7 @@ * * Copyright 2012 Samsung Electronics Co., Ltd -* Licensed under the Flora License, Version 1.0 (the "License"); +* Licensed under the Flora License, Version 1.1 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/popup-wifidirect/src/wfd-app-main.c b/popup-wifidirect/src/wfd-app-main.c index 3067c67..b32d096 100644 --- a/popup-wifidirect/src/wfd-app-main.c +++ b/popup-wifidirect/src/wfd-app-main.c @@ -3,7 +3,7 @@ * * Copyright 2012 Samsung Electronics Co., Ltd -* Licensed under the Flora License, Version 1.0 (the "License"); +* Licensed under the Flora License, Version 1.1 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/popup-wifidirect/src/wfd-app-popup-view.c b/popup-wifidirect/src/wfd-app-popup-view.c index 461c40e..f901219 100755 --- a/popup-wifidirect/src/wfd-app-popup-view.c +++ b/popup-wifidirect/src/wfd-app-popup-view.c @@ -3,7 +3,7 @@ * * Copyright 2012 Samsung Electronics Co., Ltd -* Licensed under the Flora License, Version 1.0 (the "License"); +* Licensed under the Flora License, Version 1.1 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/popup-wifidirect/src/wfd-app-util.c b/popup-wifidirect/src/wfd-app-util.c index eb99384..1c40a83 100644 --- a/popup-wifidirect/src/wfd-app-util.c +++ b/popup-wifidirect/src/wfd-app-util.c @@ -3,7 +3,7 @@ * * Copyright 2012 Samsung Electronics Co., Ltd -* Licensed under the Flora License, Version 1.0 (the "License"); +* Licensed under the Flora License, Version 1.1 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/ug-wifidirect/include/wfd_client.h b/ug-wifidirect/include/wfd_client.h index 6d5c1fe..9106398 100644 --- a/ug-wifidirect/include/wfd_client.h +++ b/ug-wifidirect/include/wfd_client.h @@ -3,7 +3,7 @@ * * Copyright 2012 Samsung Electronics Co., Ltd -* Licensed under the Flora License, Version 1.0 (the "License"); +* Licensed under the Flora License, Version 1.1 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/ug-wifidirect/include/wfd_motion_control.h b/ug-wifidirect/include/wfd_motion_control.h index b954b82..fcaf045 100644 --- a/ug-wifidirect/include/wfd_motion_control.h +++ b/ug-wifidirect/include/wfd_motion_control.h @@ -3,7 +3,7 @@ * * Copyright 2012 Samsung Electronics Co., Ltd * - * Licensed under the Flora License, Version 1.0 (the "License"); + * Licensed under the Flora License, Version 1.1 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * diff --git a/ug-wifidirect/include/wfd_ug.h b/ug-wifidirect/include/wfd_ug.h index c49852e..489529c 100644 --- a/ug-wifidirect/include/wfd_ug.h +++ b/ug-wifidirect/include/wfd_ug.h @@ -3,7 +3,7 @@ * * Copyright 2012 Samsung Electronics Co., Ltd -* Licensed under the Flora License, Version 1.0 (the "License"); +* Licensed under the Flora License, Version 1.1 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/ug-wifidirect/include/wfd_ug_view.h b/ug-wifidirect/include/wfd_ug_view.h index 5ff7090..8610de2 100644 --- a/ug-wifidirect/include/wfd_ug_view.h +++ b/ug-wifidirect/include/wfd_ug_view.h @@ -3,7 +3,7 @@ * * Copyright 2012 Samsung Electronics Co., Ltd -* Licensed under the Flora License, Version 1.0 (the "License"); +* Licensed under the Flora License, Version 1.1 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/ug-wifidirect/src/wfd_client.c b/ug-wifidirect/src/wfd_client.c index 0c15a91..4676e01 100644 --- a/ug-wifidirect/src/wfd_client.c +++ b/ug-wifidirect/src/wfd_client.c @@ -3,7 +3,7 @@ * * Copyright 2012 Samsung Electronics Co., Ltd -* Licensed under the Flora License, Version 1.0 (the "License"); +* Licensed under the Flora License, Version 1.1 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/ug-wifidirect/src/wfd_motion_control.c b/ug-wifidirect/src/wfd_motion_control.c index 8eae098..341b844 100755 --- a/ug-wifidirect/src/wfd_motion_control.c +++ b/ug-wifidirect/src/wfd_motion_control.c @@ -3,7 +3,7 @@ * * Copyright 2012 Samsung Electronics Co., Ltd * - * Licensed under the Flora License, Version 1.0 (the "License"); + * Licensed under the Flora License, Version 1.1 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * diff --git a/ug-wifidirect/src/wfd_ug.c b/ug-wifidirect/src/wfd_ug.c index 0258c52..ee0ef80 100644 --- a/ug-wifidirect/src/wfd_ug.c +++ b/ug-wifidirect/src/wfd_ug.c @@ -3,7 +3,7 @@ * * Copyright 2012 Samsung Electronics Co., Ltd -* Licensed under the Flora License, Version 1.0 (the "License"); +* Licensed under the Flora License, Version 1.1 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/ug-wifidirect/src/wfd_ug_genlist.c b/ug-wifidirect/src/wfd_ug_genlist.c index 329d26c..a22294e 100755 --- a/ug-wifidirect/src/wfd_ug_genlist.c +++ b/ug-wifidirect/src/wfd_ug_genlist.c @@ -3,7 +3,7 @@ * * Copyright 2012 Samsung Electronics Co., Ltd -* Licensed under the Flora License, Version 1.0 (the "License"); +* Licensed under the Flora License, Version 1.1 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/ug-wifidirect/src/wfd_ug_main_view.c b/ug-wifidirect/src/wfd_ug_main_view.c index 00126c2..826e4ca 100755 --- a/ug-wifidirect/src/wfd_ug_main_view.c +++ b/ug-wifidirect/src/wfd_ug_main_view.c @@ -3,7 +3,7 @@ * * Copyright 2012 Samsung Electronics Co., Ltd -* Licensed under the Flora License, Version 1.0 (the "License"); +* Licensed under the Flora License, Version 1.1 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/ug-wifidirect/src/wfd_ug_multiconnect_view.c b/ug-wifidirect/src/wfd_ug_multiconnect_view.c index 989a6f7..ca3a9ea 100644 --- a/ug-wifidirect/src/wfd_ug_multiconnect_view.c +++ b/ug-wifidirect/src/wfd_ug_multiconnect_view.c @@ -3,7 +3,7 @@ * * Copyright 2012 Samsung Electronics Co., Ltd -* Licensed under the Flora License, Version 1.0 (the "License"); +* Licensed under the Flora License, Version 1.1 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/ug-wifidirect/src/wfd_ug_popup.c b/ug-wifidirect/src/wfd_ug_popup.c index 8ad8bbf..d12786f 100755 --- a/ug-wifidirect/src/wfd_ug_popup.c +++ b/ug-wifidirect/src/wfd_ug_popup.c @@ -3,7 +3,7 @@ * * Copyright 2012 Samsung Electronics Co., Ltd -* Licensed under the Flora License, Version 1.0 (the "License"); +* Licensed under the Flora License, Version 1.1 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/ug-wifidirect/src/wfd_ug_rename_popup.c b/ug-wifidirect/src/wfd_ug_rename_popup.c index 24bd87d..af40c1d 100755 --- a/ug-wifidirect/src/wfd_ug_rename_popup.c +++ b/ug-wifidirect/src/wfd_ug_rename_popup.c @@ -3,7 +3,7 @@ * * Copyright 2012 Samsung Electronics Co., Ltd -* Licensed under the Flora License, Version 1.0 (the "License"); +* Licensed under the Flora License, Version 1.1 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at -- 2.7.4 From 2b9264c67102014c944ae2aacf353476ef47d56e Mon Sep 17 00:00:00 2001 From: Yu Jiung Date: Tue, 21 Mar 2017 16:31:09 +0900 Subject: [PATCH 05/16] Enable keypad popup for WPS type Keypad Change-Id: I40e64c9cc534864d5976950d71d85404ce9b6186 Signed-off-by: Yu jiung --- packaging/ug-setting-wifidirect-efl.spec | 2 +- popup-wifidirect/include/wfd-app-popup-view.h | 1 + popup-wifidirect/src/wfd-app-popup-view.c | 5 ++--- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packaging/ug-setting-wifidirect-efl.spec b/packaging/ug-setting-wifidirect-efl.spec index e431e88..586d522 100644 --- a/packaging/ug-setting-wifidirect-efl.spec +++ b/packaging/ug-setting-wifidirect-efl.spec @@ -1,6 +1,6 @@ Name: ug-setting-wifidirect-efl Summary: Wi-Fi Direct setting UI gadget -Version: 1.11.84 +Version: 1.11.85 Release: 1 Group: Applications/Network License: Flora-1.1 diff --git a/popup-wifidirect/include/wfd-app-popup-view.h b/popup-wifidirect/include/wfd-app-popup-view.h index 5b856ee..95a5cac 100644 --- a/popup-wifidirect/include/wfd-app-popup-view.h +++ b/popup-wifidirect/include/wfd-app-popup-view.h @@ -10,6 +10,7 @@ #define WFD_GENLIST_2LINE_BOTTOM_TEXT_ICON_STYLE "type2" #define WFD_GENLIST_MULTILINE_TEXT_STYLE "multiline" #define WFD_GENLIST_GROUP_INDEX_STYLE "group_index" +#define WFD_GENLIST_SWALLOW_CONTENT_STYLE "full" Evas_Object *wfd_draw_pop_type_auto_deactivation(Evas_Object * win, void *userdata); diff --git a/popup-wifidirect/src/wfd-app-popup-view.c b/popup-wifidirect/src/wfd-app-popup-view.c index f901219..bb435c1 100755 --- a/popup-wifidirect/src/wfd-app-popup-view.c +++ b/popup-wifidirect/src/wfd-app-popup-view.c @@ -846,7 +846,7 @@ static Evas_Object *__wfd_pin_entry_icon_get(void *data, Evas_Object *obj, Evas_Object *entry = NULL; Evas_Object *button = NULL; Ecore_IMF_Context *imf_context; - if (g_strcmp0(part, "elm.icon.entry")) { + if (g_strcmp0(part, "elm.swallow.content")) { __WFD_APP_FUNC_EXIT__; return NULL; } @@ -898,7 +898,6 @@ static Evas_Object *__wfd_pin_entry_icon_get(void *data, Evas_Object *obj, evas_object_event_callback_add(entry, EVAS_CALLBACK_KEY_DOWN, _entry_keydown_cb, ad); - elm_object_content_set(obj, entry); evas_object_show(entry); evas_object_smart_callback_add(entry, "changed", _smart_ime_cb, NULL); elm_object_focus_set(entry, EINA_TRUE); @@ -1049,7 +1048,7 @@ Evas_Object *wfd_draw_pop_type_keypad(Evas_Object * win, wfd_popup_t * pop) ad->pin_entry_itc = elm_genlist_item_class_new(); if (ad->pin_entry_itc != NULL) { - ad->pin_entry_itc->item_style = "entry"; + ad->pin_entry_itc->item_style = WFD_GENLIST_SWALLOW_CONTENT_STYLE; ad->pin_entry_itc->func.text_get = NULL; ad->pin_entry_itc->func.content_get = __wfd_pin_entry_icon_get; ad->pin_entry_itc->func.state_get = NULL; -- 2.7.4 From a118050c5288f9b5acd580f81de0a96453c2f7bf Mon Sep 17 00:00:00 2001 From: "chleun.moon" Date: Mon, 7 Aug 2017 18:46:53 +0900 Subject: [PATCH 06/16] [WGID-258847] Add null check after malloc Change-Id: Icff55bff08bc48c3b4e86593eb1def358dc34fdd Signed-off-by: cheoleun --- packaging/ug-setting-wifidirect-efl.spec | 2 +- popup-wifidirect/src/wfd-app-util.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packaging/ug-setting-wifidirect-efl.spec b/packaging/ug-setting-wifidirect-efl.spec index 586d522..e0ca6da 100644 --- a/packaging/ug-setting-wifidirect-efl.spec +++ b/packaging/ug-setting-wifidirect-efl.spec @@ -1,6 +1,6 @@ Name: ug-setting-wifidirect-efl Summary: Wi-Fi Direct setting UI gadget -Version: 1.11.85 +Version: 1.11.86 Release: 1 Group: Applications/Network License: Flora-1.1 diff --git a/popup-wifidirect/src/wfd-app-util.c b/popup-wifidirect/src/wfd-app-util.c index 1c40a83..c61b9e3 100644 --- a/popup-wifidirect/src/wfd-app-util.c +++ b/popup-wifidirect/src/wfd-app-util.c @@ -120,6 +120,11 @@ static void _move_data_to_app_control(const char *key, const int type, if (type == BUNDLE_TYPE_STR) { bundle_keyval_get_basic_val((bundle_keyval_t *) kv, &ptr, &size); buff = malloc(sizeof(char) * size + 1); + if (buff == NULL) { + WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to allocate memory"); + __WFD_APP_FUNC_EXIT__; + return; + } snprintf(buff, size + 1, "%s", ((char*) ptr)); WFD_APP_LOG(WFD_APP_LOG_ERROR, "Found STR -KEY: %s, VAL: %s, SIZE: %d", key, buff, size); @@ -128,6 +133,11 @@ static void _move_data_to_app_control(const char *key, const int type, } else if (type == BUNDLE_TYPE_BYTE) { bundle_keyval_get_basic_val((bundle_keyval_t *) kv, &ptr, &size); buff = malloc(sizeof(char) * size + 1); + if (buff == NULL) { + WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to allocate memory"); + __WFD_APP_FUNC_EXIT__; + return; + } snprintf(buff, size + 1, "%s", ((char*) ptr)); WFD_APP_LOG(WFD_APP_LOG_ERROR, "Found STR -KEY: %s, VAL: %s, SIZE: %d", key, buff, size); -- 2.7.4 From 4b010da94f2181966ea142a5e76da15e290472da Mon Sep 17 00:00:00 2001 From: Nishant Chaprana Date: Wed, 18 Apr 2018 10:23:50 +0530 Subject: [PATCH 07/16] Removed WFD_DBUS_LAUNCH because now wifi-direct library takes care of wfd-manager launch Change-Id: I013e7718fe01aa2804baeafc381bb334d34d92a3 Signed-off-by: Nishant Chaprana --- packaging/ug-setting-wifidirect-efl.spec | 2 +- ug-wifidirect/include/wfd_ug.h | 5 --- ug-wifidirect/src/wfd_client.c | 75 -------------------------------- ug-wifidirect/src/wfd_ug.c | 55 +---------------------- ug-wifidirect/src/wfd_ug_main_view.c | 26 ----------- 5 files changed, 3 insertions(+), 160 deletions(-) diff --git a/packaging/ug-setting-wifidirect-efl.spec b/packaging/ug-setting-wifidirect-efl.spec index e0ca6da..deb264f 100644 --- a/packaging/ug-setting-wifidirect-efl.spec +++ b/packaging/ug-setting-wifidirect-efl.spec @@ -1,6 +1,6 @@ Name: ug-setting-wifidirect-efl Summary: Wi-Fi Direct setting UI gadget -Version: 1.11.86 +Version: 1.11.87 Release: 1 Group: Applications/Network License: Flora-1.1 diff --git a/ug-wifidirect/include/wfd_ug.h b/ug-wifidirect/include/wfd_ug.h index 489529c..2d1a31e 100644 --- a/ug-wifidirect/include/wfd_ug.h +++ b/ug-wifidirect/include/wfd_ug.h @@ -351,11 +351,6 @@ struct ug_data { int wfd_discovery_status; bool is_paused; - -#ifdef WFD_DBUS_LAUNCH - GCancellable *dbus_cancellable; - GDBusConnection *conn; -#endif }; extern Elm_Gen_Item_Class device_name_title_itc; diff --git a/ug-wifidirect/src/wfd_client.c b/ug-wifidirect/src/wfd_client.c index 4676e01..ce64950 100644 --- a/ug-wifidirect/src/wfd_client.c +++ b/ug-wifidirect/src/wfd_client.c @@ -1387,81 +1387,6 @@ int init_wfd_client(void* data) return 0; } -#ifdef WFD_DBUS_LAUNCH -void wfd_gdbus_callback(GObject *source_object, GAsyncResult *result, gpointer user_data) -{ - __FUNC_ENTER__; - struct ug_data *ugd = (struct ug_data *)user_data; - WFD_RET_IF(ugd == NULL, "Incorrect parameter(NULL)\n"); - int res = -1; - - GError *error = NULL; - GVariant *return_data; - - g_object_unref(ugd->dbus_cancellable); - ugd->dbus_cancellable = NULL; - ugd->conn = G_DBUS_CONNECTION(source_object); - return_data = g_dbus_connection_call_finish(ugd->conn, result, &error); - - if (error != NULL) { - DBG(LOG_ERROR, "DBus action failed. Error Msg [%s]\n", error->message); - g_clear_error(&error); - } else { - DBG(LOG_INFO, "error msg is NULL\n"); - } - - if (return_data) - g_variant_unref(return_data); - - if (ugd->conn) { - g_object_unref(ugd->conn); - ugd->conn = NULL; - } - - res = init_wfd_client(ugd); - WFD_RET_IF(res != 0, "Failed to initialize WFD client library\n"); - - /* Activate WiFi Direct */ - DBG(LOG_INFO, "Activating WiFi Direct..."); - if (ugd->wfd_status <= WIFI_DIRECT_STATE_DEACTIVATING) { - res = wfd_client_switch_on(ugd); - WFD_RET_IF(res != 0, "Failed to activate WFD\n"); - } - - __FUNC_EXIT__; -} - -int launch_wifi_direct_manager(void *data) -{ - __FUNC_ENTER__; - - gchar *addr = NULL; - GError *error = NULL; - - struct ug_data *ugd = (struct ug_data *)data; - WFD_RETV_IF(ugd == NULL, -1, "Incorrect parameter(NULL)\n"); - - ugd->dbus_cancellable = g_cancellable_new(); - - addr = g_dbus_address_get_for_bus_sync(G_BUS_TYPE_SYSTEM, NULL, &error); - WFD_RETV_IF(addr == NULL, -1, "Fail to get dbus addr.\n"); - - ugd->conn = g_dbus_connection_new_for_address_sync(addr, G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT | - G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION, NULL, NULL, NULL); - - if (ugd->conn == NULL) { - DBG(LOG_ERROR, "g_dbus_conn is NULL\n"); - return -1; - } else { - g_dbus_connection_call(ugd->conn, "net.netconfig", "/net/netconfig/wifi", "net.netconfig.wifi", - "LaunchDirect", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, -1, ugd->dbus_cancellable, wfd_gdbus_callback, data); - } - - __FUNC_EXIT__; - return 0; -} -#endif - void wfd_client_destroy_tethering(struct ug_data *ugd) { __FUNC_ENTER__; diff --git a/ug-wifidirect/src/wfd_ug.c b/ug-wifidirect/src/wfd_ug.c index ee0ef80..b8a1691 100644 --- a/ug-wifidirect/src/wfd_ug.c +++ b/ug-wifidirect/src/wfd_ug.c @@ -230,23 +230,8 @@ void wfd_destroy_ug(void *data) __FUNC_ENTER__; struct ug_data *ugd = (struct ug_data *) data; -#ifdef WFD_DBUS_LAUNCH - if (ugd->dbus_cancellable != NULL) { - g_cancellable_cancel(ugd->dbus_cancellable); - g_object_unref(ugd->dbus_cancellable); - ugd->dbus_cancellable = NULL; - if (ugd->conn) { - g_object_unref(ugd->conn); - ugd->conn = NULL; - } - DBG(LOG_INFO, "Cancelled dbus call"); - return; - } else -#endif - { - DBG(LOG_INFO, "dbus_cancellable is NULL"); - ug_destroy_me(ugd->ug); - } + DBG(LOG_INFO, "dbus_cancellable is NULL"); + ug_destroy_me(ugd->ug); __FUNC_EXIT__; return; @@ -269,33 +254,6 @@ static void wfd_ug_layout_del_cb(void *data , Evas *e, Evas_Object *obj, void *e __FUNC_EXIT__; } -#ifdef WFD_DBUS_LAUNCH -/** - * This function let the ug initialize wfd - * @return void - * @param[in] data the pointer to the main data structure - * @param[in] evas the pointer to the evas canvas - * @param[in] obj the pointer to the evas object - * @param[in] event_info the pointer to the event information - */ -static void _wfd_init_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info) -{ - __FUNC_ENTER__; - int res = -1; - struct ug_data *ugd = (struct ug_data *)data; - WFD_RET_IF(ugd == NULL || ugd->base == NULL, "Incorrect parameter(NULL)\n"); - - evas_object_event_callback_del(ugd->base, EVAS_CALLBACK_SHOW, _wfd_init_cb); - - res = launch_wifi_direct_manager(ugd); - if (res != 0) - DBG(LOG_ERROR, "Failed to launch wifi direct manager\n"); - - __FUNC_EXIT__; - return; -} -#endif - static void *on_create(ui_gadget_h ug, enum ug_mode mode, app_control_h control, void *priv) { __FUNC_ENTER__; @@ -469,9 +427,6 @@ static void *on_create(ui_gadget_h ug, enum ug_mode mode, app_control_h control, } else { ugd->wfd_status = WIFI_DIRECT_STATE_DEACTIVATED; -#ifdef WFD_DBUS_LAUNCH - evas_object_event_callback_add(ugd->base, EVAS_CALLBACK_SHOW, _wfd_init_cb, ugd); -#else ret = init_wfd_client(ugd); WFD_RETV_IF(ret != 0, NULL, "Failed to initialize WFD client library\n"); @@ -481,7 +436,6 @@ static void *on_create(ui_gadget_h ug, enum ug_mode mode, app_control_h control, ret = wfd_client_switch_on(ugd); WFD_RETV_IF(ret != 0, NULL, "Failed to activate WFD\n"); } -#endif } ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_DEVICE_NAME_STR, __wfd_main_vconf_change_cb, ugd); @@ -626,11 +580,6 @@ static void on_destroy(ui_gadget_h ug, app_control_h control, void *priv) WFD_IF_FREE_MEM(ugd->view_type); WFD_IF_DEL_OBJ(ugd->bg); - -#ifdef WFD_DBUS_LAUNCH - if (ugd->base) - evas_object_event_callback_del(ugd->base, EVAS_CALLBACK_SHOW, _wfd_init_cb); -#endif WFD_IF_DEL_OBJ(ugd->base); DBG(LOG_INFO, "WFD client deregistered"); diff --git a/ug-wifidirect/src/wfd_ug_main_view.c b/ug-wifidirect/src/wfd_ug_main_view.c index 826e4ca..517392f 100755 --- a/ug-wifidirect/src/wfd_ug_main_view.c +++ b/ug-wifidirect/src/wfd_ug_main_view.c @@ -75,19 +75,6 @@ Eina_Bool _back_btn_cb(void *data, Elm_Object_Item *it) bool owner = FALSE; app_control_h control = NULL; -#ifdef WFD_DBUS_LAUNCH - if (ugd->dbus_cancellable != NULL) { - g_cancellable_cancel(ugd->dbus_cancellable); - g_object_unref(ugd->dbus_cancellable); - ugd->dbus_cancellable = NULL; - if (ugd->conn) { - g_object_unref(ugd->conn); - ugd->conn = NULL; - } - DBG(LOG_INFO, "Cancel dbus call"); - } -#endif - wfd_refresh_wifi_direct_state(ugd); if (ugd->wfd_status <= WIFI_DIRECT_STATE_DEACTIVATING) { DBG(LOG_INFO, "WiFi direct is already deactivated\n"); @@ -157,19 +144,6 @@ void _smart_back_btn_cb(void *data, Evas_Object *obj, void *event_info) return; } -#ifdef WFD_DBUS_LAUNCH - if (ugd->dbus_cancellable != NULL) { - g_cancellable_cancel(ugd->dbus_cancellable); - g_object_unref(ugd->dbus_cancellable); - ugd->dbus_cancellable = NULL; - if (ugd->conn) { - g_object_unref(ugd->conn); - ugd->conn = NULL; - } - DBG(LOG_INFO, "Cancel dbus call"); - } -#endif - wfd_refresh_wifi_direct_state(ugd); if (ugd->wfd_status <= WIFI_DIRECT_STATE_DEACTIVATING) { DBG(LOG_INFO, "WiFi direct is already deactivated\n"); -- 2.7.4 From 9fe0c572d9f57850c2985e0d57ffc88cbfca4c3c Mon Sep 17 00:00:00 2001 From: Jiung Date: Thu, 28 Jun 2018 10:28:08 +0900 Subject: [PATCH 08/16] Remove deprecated enumeration Change-Id: I44ca8894976a93f759974df81f285fea90213b67 Signed-off-by: Yu jiung --- packaging/ug-setting-wifidirect-efl.spec | 2 +- popup-wifidirect/src/wfd-app-main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/ug-setting-wifidirect-efl.spec b/packaging/ug-setting-wifidirect-efl.spec index deb264f..b17e0b5 100644 --- a/packaging/ug-setting-wifidirect-efl.spec +++ b/packaging/ug-setting-wifidirect-efl.spec @@ -1,6 +1,6 @@ Name: ug-setting-wifidirect-efl Summary: Wi-Fi Direct setting UI gadget -Version: 1.11.87 +Version: 1.11.88 Release: 1 Group: Applications/Network License: Flora-1.1 diff --git a/popup-wifidirect/src/wfd-app-main.c b/popup-wifidirect/src/wfd-app-main.c index b32d096..ec910a1 100644 --- a/popup-wifidirect/src/wfd-app-main.c +++ b/popup-wifidirect/src/wfd-app-main.c @@ -63,7 +63,7 @@ static Evas_Object *_create_win(Evas_Object *parent, const char *name) elm_win_borderless_set(eo, EINA_TRUE); elm_win_alpha_set(eo, EINA_TRUE); evas_object_smart_callback_add(eo, "delete,request", _win_del, NULL); - efl_util_set_notification_window_level(eo, EFL_UTIL_NOTIFICATION_LEVEL_1); + efl_util_set_notification_window_level(eo, EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT); evas_object_raise(eo); } -- 2.7.4 From 14717c9a5f2b4e90f5207cc1314e3358c995f6f2 Mon Sep 17 00:00:00 2001 From: Yu Date: Fri, 14 Dec 2018 14:17:51 +0900 Subject: [PATCH 09/16] Fix bug in dlog message format Change-Id: Iaa42369c7a5ebb8d4d62d66def07c1d6e2d1c981 Signed-off-by: Yu jiung --- packaging/ug-setting-wifidirect-efl.spec | 2 +- popup-wifidirect/src/wfd-app-popup-view.c | 2 +- popup-wifidirect/src/wfd-app-util.c | 2 +- ug-wifidirect/src/wfd_client.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packaging/ug-setting-wifidirect-efl.spec b/packaging/ug-setting-wifidirect-efl.spec index b17e0b5..a3dafa6 100644 --- a/packaging/ug-setting-wifidirect-efl.spec +++ b/packaging/ug-setting-wifidirect-efl.spec @@ -1,6 +1,6 @@ Name: ug-setting-wifidirect-efl Summary: Wi-Fi Direct setting UI gadget -Version: 1.11.88 +Version: 1.11.89 Release: 1 Group: Applications/Network License: Flora-1.1 diff --git a/popup-wifidirect/src/wfd-app-popup-view.c b/popup-wifidirect/src/wfd-app-popup-view.c index bb435c1..3b4fcf3 100755 --- a/popup-wifidirect/src/wfd-app-popup-view.c +++ b/popup-wifidirect/src/wfd-app-popup-view.c @@ -81,7 +81,7 @@ static void __popup_resp_cb(void *data, Evas_Object * obj, void *event_info) char msg[WFD_POP_STR_MAX_LEN] = {0}; char *format_str = NULL; - WFD_APP_LOG(WFD_APP_LOG_HIGH, "popup resp : %d\n", resp); + WFD_APP_LOG(WFD_APP_LOG_HIGH, "popup resp : %lu\n", resp); switch (resp) { case /* MT */ WFD_POP_RESP_APRV_CONNECT_PBC_YES: diff --git a/popup-wifidirect/src/wfd-app-util.c b/popup-wifidirect/src/wfd-app-util.c index c61b9e3..5b80486 100644 --- a/popup-wifidirect/src/wfd-app-util.c +++ b/popup-wifidirect/src/wfd-app-util.c @@ -113,7 +113,7 @@ static void _move_data_to_app_control(const char *key, const int type, size_t size = 0; - WFD_RET_IF(data == NULL || key == NULL || type == 0, , "Invialid parameter!"); + WFD_RET_IF(data == NULL || key == NULL || type == 0, "Invialid parameter!"); app_control_h control = data; diff --git a/ug-wifidirect/src/wfd_client.c b/ug-wifidirect/src/wfd_client.c index ce64950..3be0faf 100644 --- a/ug-wifidirect/src/wfd_client.c +++ b/ug-wifidirect/src/wfd_client.c @@ -251,7 +251,7 @@ int wfd_mobile_ap_on(void *data) /* Register cbs */ ret = tethering_set_enabled_cb(ugd->hotspot_handle, TETHERING_TYPE_WIFI, __enabled_cb, ugd); if (ret != TETHERING_ERROR_NONE) { - DBG(LOG_ERROR, "tethering_set_enabled_cb is failed\n", ret); + DBG(LOG_ERROR, "tethering_set_enabled_cb is failed [%d]\n", ret); return -1; } @@ -289,7 +289,7 @@ int wfd_mobile_ap_off(void *data) /* Register cbs */ ret = tethering_set_disabled_cb(ugd->hotspot_handle, TETHERING_TYPE_WIFI, __disabled_cb, ugd); if (ret != TETHERING_ERROR_NONE) { - DBG(LOG_ERROR, "tethering_set_disabled_cb is failed\n", ret); + DBG(LOG_ERROR, "tethering_set_disabled_cb is failed [%d] \n", ret); return -1; } /* Disable tethering */ -- 2.7.4 From 3903ba82538b504d6e6af2952684aa0b34b26993 Mon Sep 17 00:00:00 2001 From: Yu Date: Mon, 17 Dec 2018 14:20:54 +0900 Subject: [PATCH 10/16] Fix 64bit build error Change-Id: Ifb6da222ad42951f68e5b72dd28be3f34196243c Signed-off-by: Yu jiung --- popup-wifidirect/src/wfd-app-popup-view.c | 2 +- popup-wifidirect/src/wfd-app-util.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/popup-wifidirect/src/wfd-app-popup-view.c b/popup-wifidirect/src/wfd-app-popup-view.c index 3b4fcf3..d58170b 100755 --- a/popup-wifidirect/src/wfd-app-popup-view.c +++ b/popup-wifidirect/src/wfd-app-popup-view.c @@ -438,7 +438,7 @@ static void _smart_ime_cb(void *data, Evas_Object * obj, void *event_info) char *txt = elm_entry_markup_to_utf8(elm_entry_entry_get((const Evas_Object *) imf_context)); if (NULL != txt) { - WFD_APP_LOG(WFD_APP_LOG_LOW, "* text [%s], len=[%d]", txt, strlen(txt)); + WFD_APP_LOG(WFD_APP_LOG_LOW, "* text [%s], len=[%zu]", txt, strlen(txt)); strncpy(connection->wps_pin, txt, sizeof(connection->wps_pin) - 1); WFD_IF_FREE_MEM(txt); } else { diff --git a/popup-wifidirect/src/wfd-app-util.c b/popup-wifidirect/src/wfd-app-util.c index 5b80486..18bd5cc 100644 --- a/popup-wifidirect/src/wfd-app-util.c +++ b/popup-wifidirect/src/wfd-app-util.c @@ -126,7 +126,7 @@ static void _move_data_to_app_control(const char *key, const int type, return; } snprintf(buff, size + 1, "%s", ((char*) ptr)); - WFD_APP_LOG(WFD_APP_LOG_ERROR, "Found STR -KEY: %s, VAL: %s, SIZE: %d", key, buff, size); + WFD_APP_LOG(WFD_APP_LOG_ERROR, "Found STR -KEY: %s, VAL: %s, SIZE: %zu", key, buff, size); app_control_add_extra_data(control, key, buff); free(buff); @@ -139,7 +139,7 @@ static void _move_data_to_app_control(const char *key, const int type, return; } snprintf(buff, size + 1, "%s", ((char*) ptr)); - WFD_APP_LOG(WFD_APP_LOG_ERROR, "Found STR -KEY: %s, VAL: %s, SIZE: %d", key, buff, size); + WFD_APP_LOG(WFD_APP_LOG_ERROR, "Found STR -KEY: %s, VAL: %s, SIZE: %zu", key, buff, size); app_control_add_extra_data(control, key, buff); free(buff); -- 2.7.4 From 4d8b735f1b54dfee53b7c90a19719d20870e3140 Mon Sep 17 00:00:00 2001 From: Yu Date: Fri, 27 Dec 2019 09:39:09 +0900 Subject: [PATCH 11/16] Fix format-truncation warning for gcc 9 Change-Id: I56ea250a73bd64d35b84ee9e9bc00431c56e26df Signed-off-by: Yu jiung --- popup-wifidirect/src/wfd-app-popup-view.c | 16 +++++++++------- popup-wifidirect/src/wfd-app-util.c | 2 +- ug-wifidirect/src/wfd_ug_genlist.c | 6 ++++-- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/popup-wifidirect/src/wfd-app-popup-view.c b/popup-wifidirect/src/wfd-app-popup-view.c index d58170b..ae0cfda 100755 --- a/popup-wifidirect/src/wfd-app-popup-view.c +++ b/popup-wifidirect/src/wfd-app-popup-view.c @@ -39,6 +39,8 @@ #include "wfd-app-util.h" #include "wfd-app-popup-view.h" +#define POPUP_ADDITIONAL_STR_LEN 32 + extern wfd_appdata_t *g_wfd_ad; extern wfd_popup_t *g_wfd_pop; extern unsigned char g_wfd_peer_mac[6]; @@ -516,7 +518,7 @@ static Eina_Bool _keypad_popup_timer_cb(void *data) char msg1[WFD_POP_STR_MAX_LEN] = {0}; char msg2[WFD_POP_STR_MAX_LEN] = {0}; - char label_str[WFD_POP_STR_MAX_LEN] = {0, }; + char label_str[WFD_POP_STR_MAX_LEN * 2 + 1] = {0, }; char * format_str = NULL; Evas_Object *label = (Evas_Object*) data; @@ -803,7 +805,7 @@ static char *__wfd_main_desc_label_get(void *data, Evas_Object *obj, return NULL; WFD_APP_LOG(WFD_APP_LOG_LOW, "wfd_rename desc\n"); - char buf[WFD_POP_STR_MAX_LEN] = {0, }; + char buf[WFD_POP_STR_MAX_LEN * 2 + POPUP_ADDITIONAL_STR_LEN + 1] = {0, }; char msg1[WFD_POP_STR_MAX_LEN] = {0, }; char msg2[WFD_POP_STR_MAX_LEN] = {0, }; char *format_str = NULL; @@ -824,7 +826,7 @@ static char *__wfd_main_desc_label_get(void *data, Evas_Object *obj, snprintf(msg2, WFD_POP_STR_MAX_LEN, format_str, connection->peer_name); WFD_APP_LOG(WFD_APP_LOG_LOW, "string %s %s", msg1, msg2); - snprintf(buf, WFD_POP_STR_MAX_LEN, + snprintf(buf, sizeof(buf), "%s %s", msg1, msg2); __WFD_APP_FUNC_EXIT__; @@ -1147,8 +1149,8 @@ void wfd_prepare_popup(int type, void *user_data) wfd_appdata_t *ad = wfd_get_appdata(); wfd_popup_t *pop = ad->popup_data; wfd_connection_info_s *connection = ad->connection; - char text[WFD_POP_STR_MAX_LEN+1] = {0, }; - char text1[WFD_POP_STR_MAX_LEN+1] = {0, }; + char text[WFD_POP_STR_MAX_LEN + 1] = {0, }; + char text1[WFD_POP_STR_MAX_LEN + POPUP_ADDITIONAL_STR_LEN + 1] = {0, }; wfd_destroy_popup(); char *peer_name; char *format_str = NULL; @@ -1214,7 +1216,7 @@ void wfd_prepare_popup(int type, void *user_data) D_("IDS_WIFI_POP_CONNECT_TO_PS_IN_PD_SECONDS"), peer_name, WFD_POP_TIMER_120); - snprintf(text1, WFD_POP_STR_MAX_LEN, "%s %s", + snprintf(text1, sizeof(text1), "%s %s", text, D_("IDS_WIFI_POP_ENTER_PIN_TO_CONNECT_TO_PS")); snprintf(pop->text, sizeof(pop->text), text1, connection->peer_name); @@ -1233,7 +1235,7 @@ void wfd_prepare_popup(int type, void *user_data) D_("IDS_WIFI_POP_CONNECT_TO_PS_IN_PD_SECONDS"), peer_name, WFD_POP_TIMER_120); - snprintf(text1, WFD_POP_STR_MAX_LEN, "%s %s %s", + snprintf(text1, sizeof(text1), "%s %s %s", text, "
", D_("IDS_WIFI_POP_PIN_CODE_PS")); diff --git a/popup-wifidirect/src/wfd-app-util.c b/popup-wifidirect/src/wfd-app-util.c index 18bd5cc..7ada29f 100644 --- a/popup-wifidirect/src/wfd-app-util.c +++ b/popup-wifidirect/src/wfd-app-util.c @@ -69,7 +69,7 @@ char *wfd_app_trim_path(const char *filewithpath) start = 20 - len; } - strncpy((char *) filename, space, strlen(space)); + g_strlcpy((char *) filename, space, strlen(space) + 1); if(strptr) strncpy((char *) filename + start, strptr, 50); diff --git a/ug-wifidirect/src/wfd_ug_genlist.c b/ug-wifidirect/src/wfd_ug_genlist.c index a22294e..b735c99 100755 --- a/ug-wifidirect/src/wfd_ug_genlist.c +++ b/ug-wifidirect/src/wfd_ug_genlist.c @@ -28,6 +28,8 @@ #include "wfd_ug_view.h" #include "wfd_client.h" +#define UG_ADDITIONAL_STR_LEN 32 + Elm_Gen_Item_Class device_name_title_itc; #ifdef WFD_ON_OFF_GENLIST Elm_Gen_Item_Class wfd_onoff_itc; @@ -131,7 +133,7 @@ static char *_gl_device_name_label_get(void *data, Evas_Object *obj, wfd_get_vconf_device_name(ugd); char *dev_name = NULL; char str[WFD_GLOBALIZATION_STR_LENGTH] = {0, }; - char buf[WFD_GLOBALIZATION_STR_LENGTH] = {0, }; + char buf[WFD_GLOBALIZATION_STR_LENGTH + UG_ADDITIONAL_STR_LEN + 1] = {0, }; char *format_str = NULL; if (!strcmp("elm.text.multiline", part)) { @@ -147,7 +149,7 @@ static char *_gl_device_name_label_get(void *data, Evas_Object *obj, format_str = D_("IDS_WIFI_BODY_YOUR_DEVICE_HPS_IS_CURRENTLY_VISIBLE_TO_NEARBY_DEVICES"); snprintf(str, WFD_GLOBALIZATION_STR_LENGTH, format_str, dev_name); - snprintf(buf, WFD_GLOBALIZATION_STR_LENGTH, + snprintf(buf, sizeof(buf), "%s", str); WFD_IF_FREE_MEM(dev_name); -- 2.7.4 From a15ae4cf02d8a2b23aa99603305d749034991a79 Mon Sep 17 00:00:00 2001 From: Yu Date: Wed, 12 Feb 2020 13:47:19 +0900 Subject: [PATCH 12/16] Fix bugs which are reported by static analyzer Change-Id: Icd3037269b9a412a79f098284fdd2e2112de98e4 Signed-off-by: Yu jiung --- packaging/ug-setting-wifidirect-efl.spec | 2 +- popup-wifidirect/src/wfd-app-client.c | 2 +- ug-wifidirect/include/wfd_ug.h | 6 ++---- ug-wifidirect/src/wfd_client.c | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packaging/ug-setting-wifidirect-efl.spec b/packaging/ug-setting-wifidirect-efl.spec index a3dafa6..53809c0 100644 --- a/packaging/ug-setting-wifidirect-efl.spec +++ b/packaging/ug-setting-wifidirect-efl.spec @@ -1,6 +1,6 @@ Name: ug-setting-wifidirect-efl Summary: Wi-Fi Direct setting UI gadget -Version: 1.11.89 +Version: 1.11.91 Release: 1 Group: Applications/Network License: Flora-1.1 diff --git a/popup-wifidirect/src/wfd-app-client.c b/popup-wifidirect/src/wfd-app-client.c index a9ad6ed..3131594 100644 --- a/popup-wifidirect/src/wfd-app-client.c +++ b/popup-wifidirect/src/wfd-app-client.c @@ -364,7 +364,7 @@ void _cb_connection(int error_code, wifi_direct_connection_state_e connection_st connection = (wfd_connection_info_s*) calloc(1, sizeof(wfd_connection_info_s)); if (!connection) { WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to allocate memory for peer"); - free(peer_info); + g_free(peer_info); return; } diff --git a/ug-wifidirect/include/wfd_ug.h b/ug-wifidirect/include/wfd_ug.h index 2d1a31e..ef3dbe6 100644 --- a/ug-wifidirect/include/wfd_ug.h +++ b/ug-wifidirect/include/wfd_ug.h @@ -104,10 +104,8 @@ #define WFD_IF_FREE_MEM(mem) \ do { \ - if (mem) { \ - free(mem); \ - mem = NULL; \ - } \ + g_free(mem); \ + mem = NULL; \ } while (0) #define AP_NAME_LENGTH_MAX 32 diff --git a/ug-wifidirect/src/wfd_client.c b/ug-wifidirect/src/wfd_client.c index 3be0faf..e2d4068 100644 --- a/ug-wifidirect/src/wfd_client.c +++ b/ug-wifidirect/src/wfd_client.c @@ -591,7 +591,7 @@ bool _wfd_discoverd_peer_cb(wifi_direct_discovered_peer_info_s *peer, void *user if (NULL != peer->service_list) { for (i = 0; i < peer->service_count && peer->service_list[i] != NULL; i++) - free(peer->service_list[i]); + g_free(peer->service_list[i]); WFD_IF_FREE_MEM(peer->service_list); } -- 2.7.4 From 7aef21db1446e20fb22941878bf1a95f607a4238 Mon Sep 17 00:00:00 2001 From: Seonah Moon Date: Wed, 8 Apr 2020 11:27:00 +0900 Subject: [PATCH 13/16] Add error handling for NULL Change-Id: Ic8323552dfef9f5a6325404156fd5eec9477b493 --- ug-wifidirect/src/wfd_ug.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ug-wifidirect/src/wfd_ug.c b/ug-wifidirect/src/wfd_ug.c index b8a1691..4db9230 100644 --- a/ug-wifidirect/src/wfd_ug.c +++ b/ug-wifidirect/src/wfd_ug.c @@ -600,8 +600,13 @@ static void on_message(ui_gadget_h ug, app_control_h msg, app_control_h control, if (msg) { app_control_get_extra_data(msg, "msg", &app_msg); - DBG(LOG_DEBUG, "Msg from app: %s", app_msg); + if (!app_msg) { + DBG(LOG_ERROR, "Failed to get app_msg"); + __FUNC_EXIT__; + return; + } + DBG(LOG_DEBUG, "Msg from app: %s", app_msg); if (!strcmp(app_msg, "destroy")) { if (!ugd->rename_popup) { DBG(LOG_INFO, "Destroying UG."); -- 2.7.4 From e984a2453ae6d038a5b73ed6755f92f915bf2d30 Mon Sep 17 00:00:00 2001 From: Yu Date: Wed, 12 Aug 2020 08:12:34 +0900 Subject: [PATCH 14/16] Update API version from 2.4 to 6.0 Change-Id: I698b8ff6f8de7e5fbe25fabfbe3061c2afaa1dbf Signed-off-by: Yu jiung --- packaging/ug-setting-wifidirect-efl.spec | 2 +- popup-wifidirect/org.tizen.wifi-direct-popup.xml | 2 +- ug-wifidirect/ug-setting-wifidirect-efl.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packaging/ug-setting-wifidirect-efl.spec b/packaging/ug-setting-wifidirect-efl.spec index 53809c0..9aeea3a 100644 --- a/packaging/ug-setting-wifidirect-efl.spec +++ b/packaging/ug-setting-wifidirect-efl.spec @@ -1,6 +1,6 @@ Name: ug-setting-wifidirect-efl Summary: Wi-Fi Direct setting UI gadget -Version: 1.11.91 +Version: 1.12.0 Release: 1 Group: Applications/Network License: Flora-1.1 diff --git a/popup-wifidirect/org.tizen.wifi-direct-popup.xml b/popup-wifidirect/org.tizen.wifi-direct-popup.xml index 9a1b3b9..18f711a 100644 --- a/popup-wifidirect/org.tizen.wifi-direct-popup.xml +++ b/popup-wifidirect/org.tizen.wifi-direct-popup.xml @@ -1,5 +1,5 @@ - + Sungsik Jang Dongwook Lee diff --git a/ug-wifidirect/ug-setting-wifidirect-efl.xml b/ug-wifidirect/ug-setting-wifidirect-efl.xml index 8c9dfbb..fa1eb1e 100644 --- a/ug-wifidirect/ug-setting-wifidirect-efl.xml +++ b/ug-wifidirect/ug-setting-wifidirect-efl.xml @@ -1,5 +1,5 @@ - + Sungsik Jang Wi-Fi Direct setting UG -- 2.7.4 From 5d454b5d8ab0cfd80dcb3dc701566e69c978fb03 Mon Sep 17 00:00:00 2001 From: Yu Date: Tue, 12 Jan 2021 06:52:48 +0900 Subject: [PATCH 15/16] Fix jira issue TIZENIOT-2336 Description: Observe the button size, looks bigger comparing all other buttons Buttons should be resized according to the GUI guide Change-Id: I86ad63d664534a39dab9988cc885ca19d029d767 Signed-off-by: Yu jiung --- packaging/ug-setting-wifidirect-efl.spec | 2 +- ug-wifidirect/CMakeLists.txt | 10 ++++ ug-wifidirect/include/wfd_ug_view.h | 16 +++++++ ug-wifidirect/resources/main_layout.edc | 69 ++++++++++++++++++++++++++++ ug-wifidirect/resources/wfd_ug.edc | 67 +++++++++++++++++++++++++++ ug-wifidirect/src/wfd_client.c | 10 ++-- ug-wifidirect/src/wfd_ug.c | 15 ++++-- ug-wifidirect/src/wfd_ug_main_view.c | 45 +++++++++++++----- ug-wifidirect/src/wfd_ug_multiconnect_view.c | 4 +- ug-wifidirect/src/wfd_ug_popup.c | 2 +- 10 files changed, 215 insertions(+), 25 deletions(-) create mode 100644 ug-wifidirect/resources/main_layout.edc diff --git a/packaging/ug-setting-wifidirect-efl.spec b/packaging/ug-setting-wifidirect-efl.spec index 9aeea3a..32588df 100644 --- a/packaging/ug-setting-wifidirect-efl.spec +++ b/packaging/ug-setting-wifidirect-efl.spec @@ -1,6 +1,6 @@ Name: ug-setting-wifidirect-efl Summary: Wi-Fi Direct setting UI gadget -Version: 1.12.0 +Version: 1.12.1 Release: 1 Group: Applications/Network License: Flora-1.1 diff --git a/ug-wifidirect/CMakeLists.txt b/ug-wifidirect/CMakeLists.txt index 2f0a5cf..f7eca8d 100644 --- a/ug-wifidirect/CMakeLists.txt +++ b/ug-wifidirect/CMakeLists.txt @@ -43,10 +43,20 @@ ADD_CUSTOM_TARGET(wfd_ug.edj ${CMAKE_CURRENT_SOURCE_DIR}/resources/wfd_ug.edc ${CMAKE_BINARY_DIR}/wfd_ug.edj DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/resources/wfd_ug.edc ) + +ADD_CUSTOM_TARGET(main_layout.edj + COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/resources/images + ${CMAKE_CURRENT_SOURCE_DIR}/resources/main_layout.edc ${CMAKE_BINARY_DIR}/main_layout.edj + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/resources/main_layout.edc +) + ADD_DEPENDENCIES(${PROJECT_NAME} wfd_ug.edj) +ADD_DEPENDENCIES(${PROJECT_NAME} main_layout.edj) INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIBDIR}) INSTALL(FILES ${CMAKE_BINARY_DIR}/wfd_ug.edj DESTINATION ${EDJDIR}) +INSTALL(FILES ${CMAKE_BINARY_DIR}/main_layout.edj DESTINATION ${EDJDIR}) + INSTALL(FILES ${PACKAGE_NAME}.xml DESTINATION /usr/share/packages) INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tables/ DESTINATION ${TABLEDIR} FILES_MATCHING PATTERN "*.xml") INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/resources/icons/ DESTINATION ${IMAGEDIR} FILES_MATCHING PATTERN "*.png") diff --git a/ug-wifidirect/include/wfd_ug_view.h b/ug-wifidirect/include/wfd_ug_view.h index 8610de2..b29831e 100644 --- a/ug-wifidirect/include/wfd_ug_view.h +++ b/ug-wifidirect/include/wfd_ug_view.h @@ -24,6 +24,7 @@ #define EDJDIR "/usr/apps/ug-setting-wifidirect-efl/res/edje/ug-setting-wifidirect-efl" #define WFD_UG_EDJ_PATH EDJDIR"/wfd_ug.edj" +#define WFD_UG_COMMON_MAIN_LAYOUT_EDJ_PATH EDJDIR"/main_layout.edj" /* Genlist new style for Tizen 2.4 */ #define WFD_GENLIST_1LINE_TEXT_STYLE "type1" @@ -62,6 +63,21 @@ #define WFD_UG_EDJ_ICON_SIZE 40 +gboolean wfd_ug_util_is_profile_common(void); + +enum { + WFD_UG_BIG_BUTTON, + WFD_UG_PREV_BUTTON, + WFD_UG_NEXT_BUTTON, +}; + +#define WFD_UG_BIG_BUTTON_EDC_PART \ + (wfd_ug_util_is_profile_common() ? "button_common.big" : "button.big") +#define WFD_UG_PREV_BUTTON_EDC_PART \ + (wfd_ug_util_is_profile_common() ? "button_common.prev" : "button.prev") +#define WFD_UG_NEXT_BUTTON_EDC_PART \ + (wfd_ug_util_is_profile_common() ? "button_common.next" : "button.next") + enum { HEAD_TEXT_TYPE_DIRECT, HEAD_TEXT_TYPE_DEACTIVATING, diff --git a/ug-wifidirect/resources/main_layout.edc b/ug-wifidirect/resources/main_layout.edc new file mode 100644 index 0000000..66854d8 --- /dev/null +++ b/ug-wifidirect/resources/main_layout.edc @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define PADDING_SIZE 40 +#define PADDING_BOTTOM_SIZE 30 + +collections +{ + base_scale: 1.8; + + group { "main_layout"; + parts { + rect { "base"; + desc { "default"; + color: 238 239 241 255; + } + } + spacer { "padding.left"; scale; + desc { "default"; + min: PADDING_SIZE 0; + max: PADDING_SIZE -1; + fixed: 1 0; + align: 0.0 0.0; + rel.to: "base"; + } + } + spacer { "padding.right"; scale; + desc { "default"; + min: PADDING_SIZE 0; + max: PADDING_SIZE -1; + fixed: 1 0; + align: 1.0 0.0; + rel.to: "base"; + } + } + swallow { "elm.swallow.content"; + desc { "default"; + rel1 { relative: 1.0 0.0; to: "padding.left"; } + rel2 { relative: 0.0 0.0; + to_x: "padding.right"; + to_y: "padding.bottom"; + } + } + } + spacer { "padding.bottom"; scale; + desc { "default"; + min: 0 PADDING_BOTTOM_SIZE; + max: -1 PADDING_BOTTOM_SIZE; + fixed: 0 1; + align: 0.0 1.0; + rel.to: "base"; + } + } + } + } +} \ No newline at end of file diff --git a/ug-wifidirect/resources/wfd_ug.edc b/ug-wifidirect/resources/wfd_ug.edc index 068813e..833814b 100644 --- a/ug-wifidirect/resources/wfd_ug.edc +++ b/ug-wifidirect/resources/wfd_ug.edc @@ -3,6 +3,7 @@ #define TITLE_P_H 65 #define TITLE_L_H 30 #define TOOLBAR_H 154 +#define COMMON_TOOLBAR_H 77 #define POPUP_WITH_2_GL_ITEMS 200 #define RESOURCE_IMAGE( FILE_NAME ) \ @@ -340,6 +341,72 @@ collections { inherit: "default" 0.0; } } + part { + name: "button_common.big"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + min: 0 74; + max: -1 COMMON_TOOLBAR_H; + fixed: 0 0; + rel1 { + relative: 0.0 1.0; + offset: 21 -COMMON_TOOLBAR_H; + } + rel2 { + relative: 1.0 1.0; + offset: -21 0; + } + } + description { state: "horizontal" 0.0; + inherit: "default" 0.0; + } + } + part { + name: "button_common.prev"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + min: 0 74; + max: -1 TOOLBAR_H; + fixed: 0 0; + rel1 { + relative: 0.2 1.0; + offset: 21 -COMMON_TOOLBAR_H; + } + rel2 { + relative: 0.4 1.0; + offset: -6 0; + } + } + description { state: "horizontal" 0.0; + inherit: "default" 0.0; + } + } + part { + name: "button_common.next"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + min: 0 74; + max: -1 TOOLBAR_H; + fixed: 0 0; + rel1 { + relative: 0.6 1.0; + offset: 6 -COMMON_TOOLBAR_H; + } + rel2 { + relative: 0.8 1.0; + offset: -21 0; + } + } + description { state: "horizontal" 0.0; + inherit: "default" 0.0; + } + } part { name: "elm.swallow.content"; type: SWALLOW; scale: 1; diff --git a/ug-wifidirect/src/wfd_client.c b/ug-wifidirect/src/wfd_client.c index e2d4068..3a25c38 100644 --- a/ug-wifidirect/src/wfd_client.c +++ b/ug-wifidirect/src/wfd_client.c @@ -456,10 +456,10 @@ void _activation_cb(int error_code, wifi_direct_device_state_e device_state, voi */ if (ugd->disconnect_btn) { Evas_Object *content; - content = elm_object_part_content_unset(ugd->button_layout, "button.next"); + content = elm_object_part_content_unset(ugd->button_layout, WFD_UG_NEXT_BUTTON_EDC_PART); WFD_IF_DEL_OBJ(content); ugd->disconnect_btn = NULL; - elm_layout_content_set(ugd->button_layout, "button.big", ugd->scan_toolbar); + elm_layout_content_set(ugd->button_layout, WFD_UG_BIG_BUTTON_EDC_PART, ugd->scan_toolbar); } /* When connect is on ongoing and deactivte happened refresh scan */ @@ -911,7 +911,7 @@ void discover_cb(int error_code, wifi_direct_discovery_state_e discovery_state, ugd->wfd_discovery_status == WIFI_DIRECT_DISCOVERY_SOCIAL_CHANNEL_START) { WFD_IF_DEL_ITEM(ugd->multi_connect_toolbar_item); if (!ugd->conn_wfd_item) - elm_layout_content_set(ugd->button_layout, "button.big", ugd->scan_toolbar); + elm_layout_content_set(ugd->button_layout, WFD_UG_BIG_BUTTON_EDC_PART, ugd->scan_toolbar); wfd_ug_view_refresh_button(ugd->scan_toolbar, "IDS_WIFI_SK_STOP", TRUE); if (ugd->multiconn_scan_stop_btn) @@ -1050,9 +1050,9 @@ void _connection_cb(int error_code, wifi_direct_connection_state_e connection_st WFD_IF_DEL_OBJ(ugd->act_popup); Evas_Object *content; - content = elm_object_part_content_unset(ugd->button_layout, "button.next"); + content = elm_object_part_content_unset(ugd->button_layout, WFD_UG_NEXT_BUTTON_EDC_PART); WFD_IF_DEL_OBJ(content); - content = elm_object_part_content_unset(ugd->button_layout, "button.prev"); + content = elm_object_part_content_unset(ugd->button_layout, WFD_UG_PREV_BUTTON_EDC_PART); evas_object_hide(content); /* when disconnection, clear all the connected peers */ diff --git a/ug-wifidirect/src/wfd_ug.c b/ug-wifidirect/src/wfd_ug.c index 4db9230..cd21c29 100644 --- a/ug-wifidirect/src/wfd_ug.c +++ b/ug-wifidirect/src/wfd_ug.c @@ -181,9 +181,16 @@ static Evas_Object *_create_fullview(Evas_Object *parent, struct ug_data *ugd) return NULL; } - elm_layout_theme_set(base, "layout", "application", "default"); - evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(base, EVAS_HINT_FILL, EVAS_HINT_FILL); + if (wfd_ug_util_is_profile_common()) { + elm_layout_file_set(base, WFD_UG_COMMON_MAIN_LAYOUT_EDJ_PATH, "main_layout"); + } else { + elm_layout_theme_set(base, "layout", "application", "default"); + + ugd->bg = _create_bg(ugd->win, "group_list"); + elm_object_part_content_set(ugd->base, "elm.swallow.bg", ugd->bg); + evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(base, EVAS_HINT_FILL, EVAS_HINT_FILL); + } __FUNC_EXIT__; return base; @@ -398,8 +405,6 @@ static void *on_create(ui_gadget_h ug, enum ug_mode mode, app_control_h control, if (ugd->base) { evas_object_event_callback_add(ugd->base, EVAS_CALLBACK_DEL, wfd_ug_layout_del_cb, ugd); - ugd->bg = _create_bg(ugd->win, "group_list"); - elm_object_part_content_set(ugd->base, "elm.swallow.bg", ugd->bg); } else { DBG(LOG_ERROR, "Failed to create base layout\n"); return NULL; diff --git a/ug-wifidirect/src/wfd_ug_main_view.c b/ug-wifidirect/src/wfd_ug_main_view.c index 517392f..bea85b2 100755 --- a/ug-wifidirect/src/wfd_ug_main_view.c +++ b/ug-wifidirect/src/wfd_ug_main_view.c @@ -31,6 +31,29 @@ #include "wfd_ug_view.h" #include "wfd_client.h" +#include + +#include + +gboolean wfd_ug_util_is_profile_common(void) +{ + gboolean result = FALSE; + char *profile_name = NULL; + + system_info_get_platform_string("http://tizen.org/feature/profile", &profile_name); + if (!profile_name) + return result; + + if (!strncasecmp(profile_name, "common", 6)) { + DBG(LOG_ERROR, "WiFi direct is on common platform\n"); + result = TRUE; + } + + free(profile_name); + + return result; +} + void scan_button_create(struct ug_data *ugd) { __FUNC_ENTER__; @@ -50,7 +73,7 @@ void scan_button_create(struct ug_data *ugd) FALSE); } evas_object_smart_callback_add(btn, "clicked", _scan_btn_cb, (void *)ugd); - elm_layout_content_set(ugd->button_layout, "button.big", btn); + elm_layout_content_set(ugd->button_layout, WFD_UG_BIG_BUTTON_EDC_PART, btn); ugd->scan_toolbar = btn; elm_object_part_content_set(ugd->naviframe, "toolbar", ugd->button_layout); @@ -422,10 +445,10 @@ static void _gl_peer_sel(void *data, Evas_Object *obj, void *event_info) if (ugd->disconnect_btn) { Evas_Object *content; - content = elm_object_part_content_unset(ugd->button_layout, "button.next"); + content = elm_object_part_content_unset(ugd->button_layout, WFD_UG_NEXT_BUTTON_EDC_PART); WFD_IF_DEL_OBJ(content); ugd->disconnect_btn = NULL; - elm_layout_content_set(ugd->button_layout, "button.big", ugd->scan_toolbar); + elm_layout_content_set(ugd->button_layout, WFD_UG_BIG_BUTTON_EDC_PART, ugd->scan_toolbar); } if (item) @@ -1310,10 +1333,10 @@ void wfd_ug_update_toolbar(struct ug_data *ugd) evas_object_smart_callback_add(btn, "clicked", _wfd_ug_cancel_connection_button_cb, (void *)ugd); /* Set button into "toolbar" swallow part */ - elm_object_part_content_set(ugd->button_layout, "button.next", btn); + elm_object_part_content_set(ugd->button_layout, WFD_UG_NEXT_BUTTON_EDC_PART, btn); ugd->disconnect_btn = btn; evas_object_show(ugd->disconnect_btn); - elm_object_part_content_set(ugd->button_layout, "button.prev", + elm_object_part_content_set(ugd->button_layout, WFD_UG_PREV_BUTTON_EDC_PART, ugd->scan_toolbar); wfd_ug_view_refresh_button(ugd->scan_toolbar, "IDS_WIFI_SK4_SCAN", FALSE); @@ -1337,12 +1360,12 @@ void wfd_ug_update_toolbar(struct ug_data *ugd) evas_object_smart_callback_add(btn, "clicked", _wfd_ug_disconnect_button_cb, (void *)ugd); /* Set button into "toolbar" swallow part */ - elm_object_part_content_set(ugd->button_layout, "button.next", btn); + elm_object_part_content_set(ugd->button_layout, WFD_UG_NEXT_BUTTON_EDC_PART, btn); ugd->disconnect_btn = btn; evas_object_show(ugd->disconnect_btn); DBG(LOG_INFO, "button: disconnect button added\n"); } - elm_object_part_content_set(ugd->button_layout, "button.prev", + elm_object_part_content_set(ugd->button_layout, WFD_UG_PREV_BUTTON_EDC_PART, ugd->scan_toolbar); wfd_ug_view_refresh_button(ugd->scan_toolbar, "IDS_WIFI_SK4_SCAN", TRUE); @@ -1352,10 +1375,10 @@ void wfd_ug_update_toolbar(struct ug_data *ugd) if (no_of_conn_dev == 0 && ugd->disconnect_btn != NULL) { DBG(LOG_INFO, "disconnect btn removed when conn failed\n"); Evas_Object *content; - content = elm_object_part_content_unset(ugd->button_layout, "button.next"); + content = elm_object_part_content_unset(ugd->button_layout, WFD_UG_NEXT_BUTTON_EDC_PART); WFD_IF_DEL_OBJ(content); ugd->disconnect_btn = NULL; - elm_layout_content_set(ugd->button_layout, "button.big", ugd->scan_toolbar); + elm_layout_content_set(ugd->button_layout, WFD_UG_BIG_BUTTON_EDC_PART, ugd->scan_toolbar); } wfd_ug_view_refresh_button(ugd->scan_toolbar, "IDS_WIFI_SK4_SCAN", TRUE); @@ -1842,11 +1865,11 @@ void _onoff_changed_cb(void *data, Evas_Object *obj, void *event_info) elm_object_disabled_set(ugd->on_off_check, TRUE); if (ugd->disconnect_btn) { Evas_Object *content; - content = elm_object_part_content_unset(ugd->button_layout, "button.next"); + content = elm_object_part_content_unset(ugd->button_layout, WFD_UG_NEXT_BUTTON_EDC_PART); WFD_IF_DEL_OBJ(content); ugd->disconnect_btn = NULL; } - elm_layout_content_set(ugd->button_layout, "button.big", ugd->scan_toolbar); + elm_layout_content_set(ugd->button_layout, WFD_UG_BIG_BUTTON_EDC_PART, ugd->scan_toolbar); /* turn on/off wfd */ if (!ugd->wfd_onoff) { diff --git a/ug-wifidirect/src/wfd_ug_multiconnect_view.c b/ug-wifidirect/src/wfd_ug_multiconnect_view.c index ca3a9ea..2b4585a 100644 --- a/ug-wifidirect/src/wfd_ug_multiconnect_view.c +++ b/ug-wifidirect/src/wfd_ug_multiconnect_view.c @@ -976,7 +976,7 @@ void wfd_create_multiconnect_view(struct ug_data *ugd) elm_object_domain_translatable_text_set(btn1, PACKAGE, "IDS_WIFI_SK_STOP"); } - elm_object_part_content_set(ugd->multiconn_layout, "button.prev", btn1); + elm_object_part_content_set(ugd->multiconn_layout, WFD_UG_PREV_BUTTON_EDC_PART, btn1); evas_object_smart_callback_add(btn1, "clicked", _multi_scan_btn_cb, (void *)ugd); evas_object_show(btn1); ugd->multiconn_scan_stop_btn = btn1; @@ -985,7 +985,7 @@ void wfd_create_multiconnect_view(struct ug_data *ugd) elm_object_style_set(btn2, "bottom"); elm_object_domain_translatable_text_set(btn2, PACKAGE, "IDS_WIFI_SK_CONNECT"); - elm_object_part_content_set(ugd->multiconn_layout, "button.next", btn2); + elm_object_part_content_set(ugd->multiconn_layout, WFD_UG_NEXT_BUTTON_EDC_PART, btn2); evas_object_smart_callback_add(btn2, "clicked", _connect_btn_cb, (void *)ugd); evas_object_show(btn2); ugd->multiconn_conn_btn = btn2; diff --git a/ug-wifidirect/src/wfd_ug_popup.c b/ug-wifidirect/src/wfd_ug_popup.c index d12786f..be0a70d 100755 --- a/ug-wifidirect/src/wfd_ug_popup.c +++ b/ug-wifidirect/src/wfd_ug_popup.c @@ -312,7 +312,7 @@ gboolean _wfd_disconnect_idle_cb(gpointer user_data) return FALSE; } Evas_Object *content; - content = elm_object_part_content_unset(ugd->button_layout, "button.next"); + content = elm_object_part_content_unset(ugd->button_layout, WFD_UG_NEXT_BUTTON_EDC_PART); WFD_IF_DEL_OBJ(content); wfd_ug_view_init_genlist(ugd, true); -- 2.7.4 From 45d3102ac298453ce85d0192a5993895ec69a57c Mon Sep 17 00:00:00 2001 From: Yu Date: Fri, 7 May 2021 13:22:30 +0900 Subject: [PATCH 16/16] Fix issues reported by static analyzer Change-Id: Ib90660769c946a2e6b5e43611fa50be5226f4052 --- packaging/ug-setting-wifidirect-efl.spec | 2 +- ug-wifidirect/src/wfd_ug.c | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/packaging/ug-setting-wifidirect-efl.spec b/packaging/ug-setting-wifidirect-efl.spec index 32588df..4e1b48b 100644 --- a/packaging/ug-setting-wifidirect-efl.spec +++ b/packaging/ug-setting-wifidirect-efl.spec @@ -1,6 +1,6 @@ Name: ug-setting-wifidirect-efl Summary: Wi-Fi Direct setting UI gadget -Version: 1.12.1 +Version: 1.12.2 Release: 1 Group: Applications/Network License: Flora-1.1 diff --git a/ug-wifidirect/src/wfd_ug.c b/ug-wifidirect/src/wfd_ug.c index cd21c29..cee643e 100644 --- a/ug-wifidirect/src/wfd_ug.c +++ b/ug-wifidirect/src/wfd_ug.c @@ -310,15 +310,15 @@ static void *on_create(ui_gadget_h ug, enum ug_mode mode, app_control_h control, if (ret == APP_CONTROL_ERROR_NONE && wfds) { DBG_SECURE(LOG_INFO, "Wfds name: %s", wfds); ugd->wfds = strdup(wfds); - WFD_IF_FREE_MEM(wfds); } + WFD_IF_FREE_MEM(wfds); ret = app_control_get_extra_data(control, "viewtype", &viewtype); if (ret == APP_CONTROL_ERROR_NONE && viewtype) { DBG(LOG_INFO, "viewtype: %s\n", viewtype); ugd->view_type = strdup(viewtype); - WFD_IF_FREE_MEM(viewtype); } + WFD_IF_FREE_MEM(viewtype); /* * get the device filter @@ -351,9 +351,8 @@ static void *on_create(ui_gadget_h ug, enum ug_mode mode, app_control_h control, ugd->device_filter = WFD_DEVICE_TYPE_AUDIO; else ugd->device_filter = WFD_DEVICE_TYPE_OTHER; - - WFD_IF_FREE_MEM(device_filter); } + WFD_IF_FREE_MEM(device_filter); /* * get whether support auto exit after connection @@ -366,9 +365,8 @@ static void *on_create(ui_gadget_h ug, enum ug_mode mode, app_control_h control, ugd->is_auto_exit = true; else ugd->is_auto_exit = false; - - WFD_IF_FREE_MEM(auto_exit); } + WFD_IF_FREE_MEM(auto_exit); /* * get whether support multi connection, @@ -381,9 +379,8 @@ static void *on_create(ui_gadget_h ug, enum ug_mode mode, app_control_h control, ugd->is_multi_connect = false; else ugd->is_multi_connect = true; - - WFD_IF_FREE_MEM(multi_connect); } + WFD_IF_FREE_MEM(multi_connect); /* * get the title of UG @@ -394,8 +391,8 @@ static void *on_create(ui_gadget_h ug, enum ug_mode mode, app_control_h control, DBG(LOG_INFO, "Title of UG: %s", title); WFD_IF_FREE_MEM(ugd->title); ugd->title = strdup(title); - WFD_IF_FREE_MEM(title); } + WFD_IF_FREE_MEM(title); } if (mode == UG_MODE_FULLVIEW) -- 2.7.4