From 5a6d09cdec151e212436df797ae6f3e5748f93b7 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 7 Jan 2019 07:58:06 +0900 Subject: [PATCH 01/16] Set app id in fill response and authentication information Change-Id: I249a4ce5b574c980867f0b1fec7c429c35e4f595 Signed-off-by: Jihoon Kim --- client/autofill.c | 19 ++++++++++++++++--- tidl/autofill.tidl | 2 ++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/client/autofill.c b/client/autofill.c index 6318d3d..fdd0df9 100644 --- a/client/autofill.c +++ b/client/autofill.c @@ -92,18 +92,25 @@ static bool fill_response_group_cb(rpc_port_autofill_response_group_h response_g static void __fill_response_recv_cb(void *user_data, rpc_port_autofill_fill_response_h response_h) { + char *app_id = NULL; char *view_id = NULL; autofill_h ah = user_data; autofill_fill_response_h rh; autofill_fill_response_create(&rh); + rpc_port_autofill_fill_response_get_app_id(response_h, &app_id); rpc_port_autofill_fill_response_get_view_id(response_h, &view_id); + LOGD("app id : %s, view id : %s", app_id, view_id); + + if (app_id) { + autofill_fill_response_set_app_id(rh, app_id); + free(app_id); + } + if (view_id) { autofill_fill_response_set_view_id(rh, view_id); - - LOGD("view id : %s", view_id); free(view_id); } @@ -124,11 +131,13 @@ static void __auth_info_recv_cb(void *user_data, rpc_port_autofill_auth_info_h a bool autofill_data_present = false; bool authentication_needed = false; + char *app_id = NULL; char *view_id = NULL; char *service_name = NULL; char *service_logo_image_path = NULL; char *service_message = NULL; + rpc_port_autofill_auth_info_get_app_id(auth_info_h, &app_id); rpc_port_autofill_auth_info_get_view_id(auth_info_h, &view_id); rpc_port_autofill_auth_info_get_exist_autofill_data(auth_info_h, &autofill_data_present); rpc_port_autofill_auth_info_get_need_authentication(auth_info_h, &authentication_needed); @@ -136,8 +145,9 @@ static void __auth_info_recv_cb(void *user_data, rpc_port_autofill_auth_info_h a rpc_port_autofill_auth_info_get_service_logo_image_path(auth_info_h, &service_logo_image_path); rpc_port_autofill_auth_info_get_service_message(auth_info_h, &service_message); - LOGD("service name : %s", service_name); + LOGD("app id : %s, view id : %s, service name : %s", app_id, view_id, service_name); + autofill_auth_info_set_app_id(aih, app_id); autofill_auth_info_set_view_id(aih, view_id); autofill_auth_info_set_autofill_data_present(aih, autofill_data_present); autofill_auth_info_set_authentication_needed(aih, authentication_needed); @@ -145,6 +155,9 @@ static void __auth_info_recv_cb(void *user_data, rpc_port_autofill_auth_info_h a autofill_auth_info_set_service_logo_image_path(aih, service_logo_image_path); autofill_auth_info_set_service_message(aih, service_message); + if (app_id) + free(app_id); + if (view_id) free(view_id); diff --git a/tidl/autofill.tidl b/tidl/autofill.tidl index 8c3d185..6f4ccac 100644 --- a/tidl/autofill.tidl +++ b/tidl/autofill.tidl @@ -25,6 +25,7 @@ struct autofill_save_view_info { } struct autofill_auth_info { + string app_id; string view_id; bool exist_autofill_data; bool need_authentication; @@ -45,6 +46,7 @@ struct autofill_response_group { } struct autofill_fill_response { + string app_id; string view_id; list response_groups; } -- 2.7.4 From 5dac39d923f5371044e984762b50a3ae6ea5632e Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 7 Jan 2019 07:58:40 +0900 Subject: [PATCH 02/16] Update package version to 0.1.17 Change-Id: Ic160fa714e1f6dc444772842071d596b5630dbf5 Signed-off-by: Jihoon Kim --- packaging/capi-ui-autofill.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/capi-ui-autofill.spec b/packaging/capi-ui-autofill.spec index ca170ff..31f926c 100644 --- a/packaging/capi-ui-autofill.spec +++ b/packaging/capi-ui-autofill.spec @@ -1,6 +1,6 @@ Name: capi-ui-autofill Summary: Autofill Library -Version: 0.1.16 +Version: 0.1.17 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From 44a70e104dfe9581720f387bdfd3436ca7dfd5ad Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 8 Jan 2019 18:55:37 +0900 Subject: [PATCH 03/16] Add connection error message Change-Id: Ibf37850a6ee651b0f86465a630040592be697890 Signed-off-by: Jihoon Kim --- client/autofill.c | 9 +++++++++ client/autofill_auth.c | 5 +++++ client/autofill_fill_request.c | 5 +++++ include/autofill_private.h | 2 ++ 4 files changed, 21 insertions(+) diff --git a/client/autofill.c b/client/autofill.c index fdd0df9..b5220e0 100644 --- a/client/autofill.c +++ b/client/autofill.c @@ -190,6 +190,8 @@ static void __on_connected(rpc_port_proxy_AutofillAppPort_h h, void *user_data) return; } + ah->connected = true; + LOGI("connected"); rpc_port_AutofillAppPort_autofill_fill_response_received_cb_h fill_response_received_cb = rpc_port_AutofillAppPort_autofill_fill_response_received_cb_create(__fill_response_recv_cb, false, ah); rpc_port_AutofillAppPort_autofill_auth_info_received_cb_h auth_info_received_cb = rpc_port_AutofillAppPort_autofill_auth_info_received_cb_create(__auth_info_recv_cb, false, ah); @@ -209,6 +211,8 @@ static void __on_disconnected(rpc_port_proxy_AutofillAppPort_h h, void *user_dat autofill_h ah = user_data; if (ah) { + ah->connected = false; + if (ah && ah->connection_callback) ah->connection_callback(ah, AUTOFILL_CONNECTION_STATUS_DISCONNECTED, ah->connection_userdata); @@ -336,6 +340,11 @@ EXPORT_API int autofill_commit(autofill_h ah, autofill_save_view_info_h vi) return AUTOFILL_ERROR_OPERATION_FAILED; } + if (!ah->connected) { + LOGW("[ERROR] Not connected"); + return AUTOFILL_ERROR_OPERATION_FAILED; + } + rpc_port_autofill_save_view_info_create(&vih); rpc_port_autofill_save_view_info_set_view_id(vih, vi->view_id); diff --git a/client/autofill_auth.c b/client/autofill_auth.c index d238b63..9fdf7f9 100644 --- a/client/autofill_auth.c +++ b/client/autofill_auth.c @@ -49,6 +49,11 @@ EXPORT_API int autofill_auth_info_request(autofill_h ah, autofill_view_info_h vi return AUTOFILL_ERROR_OPERATION_FAILED; } + if (!ah->connected) { + LOGW("[ERROR] Not connected"); + return AUTOFILL_ERROR_OPERATION_FAILED; + } + LOGD("app id : %s, view id : %s", vi->app_id, vi->view_id); rpc_port_autofill_view_info_create(&vih); diff --git a/client/autofill_fill_request.c b/client/autofill_fill_request.c index 8dec709..8c8b091 100644 --- a/client/autofill_fill_request.c +++ b/client/autofill_fill_request.c @@ -47,6 +47,11 @@ EXPORT_API int autofill_fill_request(autofill_h ah, autofill_view_info_h vi) return AUTOFILL_ERROR_OPERATION_FAILED; } + if (!ah->connected) { + LOGW("[ERROR] Not connected"); + return AUTOFILL_ERROR_OPERATION_FAILED; + } + Eina_List *l; autofill_item_h it; diff --git a/include/autofill_private.h b/include/autofill_private.h index 3ca6f28..6a465cb 100644 --- a/include/autofill_private.h +++ b/include/autofill_private.h @@ -26,6 +26,8 @@ struct autofill_s { unsigned int context_id; + bool connected; + autofill_connection_status_changed_cb connection_callback; void *connection_userdata; -- 2.7.4 From 48f32584793d6cd2ea8ab6b135e7bd6050f3d562 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 8 Jan 2019 19:10:11 +0900 Subject: [PATCH 04/16] Fix issue detected by static analysis tool Change-Id: Icc95ff7e03a79c8e62731f849dfba5848bb8d2ff Signed-off-by: Jihoon Kim --- privilege_checker/privilege_checker.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/privilege_checker/privilege_checker.c b/privilege_checker/privilege_checker.c index e75a372..05f6c24 100644 --- a/privilege_checker/privilege_checker.c +++ b/privilege_checker/privilege_checker.c @@ -19,6 +19,7 @@ check_privilege(const char *privilege) char label_path[1024] = "/proc/self/attr/current"; char smack_label[1024] = {'\0', }; char uid[10] = {0,}; + int num; int ret = cynara_initialize(&p_cynara, NULL); if (ret != CYNARA_API_SUCCESS) { @@ -31,7 +32,8 @@ check_privilege(const char *privilege) fp = fopen(label_path, "r"); if (fp != NULL) { - if (fread(smack_label, 1, sizeof(smack_label) - 1, fp) <= 0) { + num = fread(smack_label, 1, sizeof(smack_label) - 1, fp); + if (num <= 0) { LOGW("[check_privilege] fail to fread"); } fclose(fp); -- 2.7.4 From 86af763eeaae8c1934553d7ec4b5ae9301999cb5 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 9 Jan 2019 11:21:45 +0900 Subject: [PATCH 05/16] Update package version to 0.1.18 Change-Id: I7304e915dbb6c22826778cc3eb3d2ea4a4ceadb7 Signed-off-by: Jihoon Kim --- packaging/capi-ui-autofill.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/capi-ui-autofill.spec b/packaging/capi-ui-autofill.spec index 31f926c..2088c66 100644 --- a/packaging/capi-ui-autofill.spec +++ b/packaging/capi-ui-autofill.spec @@ -1,6 +1,6 @@ Name: capi-ui-autofill Summary: Autofill Library -Version: 0.1.17 +Version: 0.1.18 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From 4721d434b981161447bc26923d78bc224ce2b0b2 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 10 Jan 2019 12:10:45 +0900 Subject: [PATCH 06/16] Fix documentation Change-Id: Icab8b9d2d6f310b08bcfa9fdbda3888b6475ccec Signed-off-by: Jihoon Kim --- doc/autofill_client_doc.h | 6 +++--- doc/autofill_common_doc.h | 2 +- doc/autofill_doc.h | 2 +- doc/autofill_manager_doc.h | 4 ++-- doc/autofill_service_doc.h | 2 +- include/autofill_service.h | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/autofill_client_doc.h b/doc/autofill_client_doc.h index d323a8e..52e4c42 100644 --- a/doc/autofill_client_doc.h +++ b/doc/autofill_client_doc.h @@ -21,13 +21,13 @@ /** * @ingroup CAPI_UIX_AUTOFILL_MODULE * @defgroup CAPI_UIX_AUTOFILL_CLIENT_MODULE Autofill client - * @brief The @ref CAPI_UIX_AUTOFILL_CLIENT_MODULE API provides the functions for sending data to the autofill service and receiving the commonly-entered data from the autofill service. + * @brief The @ref CAPI_UIX_AUTOFILL_CLIENT_MODULE API provides the functions for sending data to the autofill service and receiving the data previously entered by the user from the autofill service. * @section CAPI_UIX_AUTOFILL_MODULE_CLIENT_HEADER Required Header * * \#include * @section CAPI_UIX_AUTOFILL_CLIENT_MODULE_OVERVIEW Overview - * Autofill is a feature that allows you to fill out commonly-entered information such as email, account and address in a text input field. email, account and address in a text input field. - * The @ref CAPI_UIX_AUTOFILL_CLIENT_MODULE API provides the functions for sending data to the autofill service and receiving the commonly-entered data from the autofill service. + * Autofill is a feature that allows you to fill out the data previously entered by the user such as email, account and address in a text input field. email, account and address in a text input field. + * The @ref CAPI_UIX_AUTOFILL_CLIENT_MODULE API provides the functions for sending data to the autofill service and receiving the data previously entered by the user from the autofill service. */ diff --git a/doc/autofill_common_doc.h b/doc/autofill_common_doc.h index fd94dec..cc92d11 100644 --- a/doc/autofill_common_doc.h +++ b/doc/autofill_common_doc.h @@ -26,7 +26,7 @@ * \#include * * @section CAPI_UIX_AUTOFILL_COMMON_MODULE_OVERVIEW Overview - * Autofill is a feature that allows you to fill out commonly-entered information such as email, account and address in a text input field. email, account and address in a text input field. + * Autofill is a feature that allows you to fill out the data previously entered by the user such as email, account and address in a text input field. email, account and address in a text input field. * @ref CAPI_UIX_AUTOFILL_COMMON_MODULE functions are responsible for storing or retrieving autofill data in each autofill data structure. * The @ref CAPI_UIX_AUTOFILL_COMMON_MODULE functions can be used in an autofill client and an autofill service. */ diff --git a/doc/autofill_doc.h b/doc/autofill_doc.h index 940c2f5..d71c8af 100644 --- a/doc/autofill_doc.h +++ b/doc/autofill_doc.h @@ -24,7 +24,7 @@ * @brief The @ref CAPI_UIX_AUTOFILL_MODULE API provides the functions for supporting users to use autofill feature. * * @section CAPI_UIX_AUTOFILL_MODULE_OVERVIEW Overview - * Autofill is a feature that allows you to fill out commonly-entered information such as email, account and address in a text input field. email, account and address in a text input field. + * Autofill is a feature that allows you to fill out the data previously entered by the user such as email, account and address in a text input field. email, account and address in a text input field. */ diff --git a/doc/autofill_manager_doc.h b/doc/autofill_manager_doc.h index 70eeaf4..af82a0c 100644 --- a/doc/autofill_manager_doc.h +++ b/doc/autofill_manager_doc.h @@ -26,9 +26,9 @@ * \#include * * @section CAPI_UIX_AUTOFILL_MANAGER_MODULE_OVERVIEW Overview - * Autofill is a feature that allows you to fill out commonly-entered information such as email, account and address in a text input field. email, account and address in a text input field. + * Autofill is a feature that allows you to fill out the data previously entered by the user such as email, account and address in a text input field. email, account and address in a text input field. * Autofill manager is a module for managing the installed autofill services. Application developers can use this module to get the current autofill service and changing the autofill service. - * @ref CAPI_UIX_AUTOFILL_MANAGER_MODULE functions are responsible for sending data for supporting autofill to the autofill service and receiving the commonly-entered data from the autofill service. + * @ref CAPI_UIX_AUTOFILL_MANAGER_MODULE functions are responsible for sending data for supporting autofill to the autofill service and receiving the data previously entered by the user from the autofill service. */ diff --git a/doc/autofill_service_doc.h b/doc/autofill_service_doc.h index 36052d2..d312ecf 100644 --- a/doc/autofill_service_doc.h +++ b/doc/autofill_service_doc.h @@ -26,7 +26,7 @@ * \#include * * @section CAPI_UIX_AUTOFILL_SERVICE_MODULE_OVERVIEW Overview - * Autofill Service application is a service application to save the user input and provide the commonly-entered information. + * Autofill Service application is a service application to save the user input and provide the data previously entered by the user. * Using the @ref CAPI_UIX_AUTOFILL_SERVICE_MODULE functions, Autofill service application developers can implement their own autofill service to serve the autofill information. */ diff --git a/include/autofill_service.h b/include/autofill_service.h index 8bcdcac..c5283d7 100644 --- a/include/autofill_service.h +++ b/include/autofill_service.h @@ -19,7 +19,7 @@ /** * @file autofill_service.h - * @brief This file contains autofill APIs and related enumeration. + * @brief This file contains autofill service APIs and related enumeration. */ #include -- 2.7.4 From b7e41d1c93be4625d0a4e3d5ade9aa1a4d85763c Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 22 Jan 2019 17:48:49 +0900 Subject: [PATCH 07/16] Fix bug when getting app id in commit callback Change-Id: Icb759d36162d5253a5dce10bdcade05b6ea842f6 Signed-off-by: Jihoon Kim --- service_lib/autofill_service.c | 14 ++++++++++---- tidl/autofill_service.tidl | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/service_lib/autofill_service.c b/service_lib/autofill_service.c index a18ed44..b064dd9 100644 --- a/service_lib/autofill_service.c +++ b/service_lib/autofill_service.c @@ -223,14 +223,17 @@ static void __autofill_fill_request_cb(rpc_port_stub_AutofillSvcPort_context_h c static void __autofill_commit_cb(rpc_port_stub_AutofillSvcPort_context_h context, int context_id, rpc_port_autofill_svc_save_view_info_h vi, void *user_data) { + char *app_id = NULL; char *view_id = NULL; + + rpc_port_autofill_svc_save_view_info_get_app_id(vi, &app_id); rpc_port_autofill_svc_save_view_info_get_view_id(vi, &view_id); - if (view_id) { - LOGD("view id : %s", view_id); - } + + LOGD("app id : %s, view id : %s", app_id, view_id); autofill_save_view_info_h view_info; autofill_save_view_info_create(&view_info); + autofill_save_view_info_set_app_id(view_info, app_id); autofill_save_view_info_set_view_id(view_info, view_id); rpc_port_autofill_svc_save_view_info_foreach_items(vi, __save_item_cb, view_info); @@ -240,8 +243,11 @@ static void __autofill_commit_cb(rpc_port_stub_AutofillSvcPort_context_h context autofill_save_view_info_destroy(view_info); + if (app_id) { + free(app_id); + } + if (view_id) { - LOGD("view id : %s", view_id); free(view_id); } } diff --git a/tidl/autofill_service.tidl b/tidl/autofill_service.tidl index 43b9d9f..311a411 100644 --- a/tidl/autofill_service.tidl +++ b/tidl/autofill_service.tidl @@ -21,6 +21,7 @@ struct autofill_svc_save_item { } struct autofill_svc_save_view_info { + string app_id; string view_id; list items; } -- 2.7.4 From 4b46aff186487ded0415d46eecc494cb2ca12431 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 22 Jan 2019 17:49:24 +0900 Subject: [PATCH 08/16] Update package version to 0.1.19 Change-Id: I03b9aa4b0b6f06e0eac970c30a3baf078dcd1f42 Signed-off-by: Jihoon Kim --- packaging/capi-ui-autofill.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/capi-ui-autofill.spec b/packaging/capi-ui-autofill.spec index 2088c66..8d35eb1 100644 --- a/packaging/capi-ui-autofill.spec +++ b/packaging/capi-ui-autofill.spec @@ -1,6 +1,6 @@ Name: capi-ui-autofill Summary: Autofill Library -Version: 0.1.18 +Version: 0.1.19 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From 3e185cb2582915340b64bcb9d23b566d29765a38 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 22 Jan 2019 19:04:48 +0900 Subject: [PATCH 09/16] Fix bug auth info receive callback data issue Change-Id: Ie21b0c19ae68822eeeb9f687b582a17939315678 Signed-off-by: Jihoon Kim --- client/autofill.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/autofill.c b/client/autofill.c index b5220e0..e45baa4 100644 --- a/client/autofill.c +++ b/client/autofill.c @@ -172,7 +172,7 @@ static void __auth_info_recv_cb(void *user_data, rpc_port_autofill_auth_info_h a if (ah) { if (ah->autofill_auth_info_received_cb) - ah->autofill_auth_info_received_cb(ah, aih, ah->autofill_fill_response_data); + ah->autofill_auth_info_received_cb(ah, aih, ah->autofill_auth_info_data); } else { LOGW("no user data"); -- 2.7.4 From 94d9623829ca98f9d8ef03bbb386175cbd99fee5 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 22 Jan 2019 19:05:16 +0900 Subject: [PATCH 10/16] Update package version to 0.1.20 Change-Id: Ib344abd5d80de7e4da6c64bf60f7dd390e2fcdf4 Signed-off-by: Jihoon Kim --- packaging/capi-ui-autofill.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/capi-ui-autofill.spec b/packaging/capi-ui-autofill.spec index 8d35eb1..df0a8bd 100644 --- a/packaging/capi-ui-autofill.spec +++ b/packaging/capi-ui-autofill.spec @@ -1,6 +1,6 @@ Name: capi-ui-autofill Summary: Autofill Library -Version: 0.1.19 +Version: 0.1.20 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From 810ff6edb961d8b75637bce0559652bf0ce15a73 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 8 Mar 2019 11:00:28 +0900 Subject: [PATCH 11/16] Fix wrong documentation Change-Id: Ib934cecc37ceb9c02f926d69fdd39daf3f3291fd Signed-off-by: Jihoon Kim --- include/autofill.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/autofill.h b/include/autofill.h index c57a74b..ab05b07 100644 --- a/include/autofill.h +++ b/include/autofill.h @@ -80,7 +80,7 @@ typedef void (*autofill_fill_response_received_cb)(autofill_h ah, autofill_fill_ * @param[in] ah The autofill handle * @param[in] auth_info The autofill authentication information handle * @param[in] user_data The user data passed from the callback function - * @see autofill_fill_response_set_received_cb() + * @see autofill_auth_info_set_received_cb() */ typedef void (*autofill_auth_info_received_cb)(autofill_h ah, autofill_auth_info_h auth_info, void *user_data); -- 2.7.4 From dc8722115628bcbb11b4c90d10fbda304bf0f03a Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 8 Mar 2019 17:28:59 +0900 Subject: [PATCH 12/16] Add API to send autofill error Change-Id: Ic73ade01e57e8b2855c897c418103fde5c9571b9 Signed-off-by: Jihoon Kim --- client/autofill.c | 68 ++++++++++++++++++++++++++++- include/autofill.h | 36 ++++++++++++++++ include/autofill_common.h | 98 ++++++++++++++++++++++++++++++++++++++++++ include/autofill_error.h | 3 ++ include/autofill_private.h | 3 ++ include/autofill_service.h | 11 +++++ service_lib/autofill_service.c | 62 +++++++++++++++++++++++--- tidl/autofill.tidl | 9 +++- tidl/autofill_service.tidl | 9 +++- 9 files changed, 291 insertions(+), 8 deletions(-) diff --git a/client/autofill.c b/client/autofill.c index e45baa4..e8985d3 100644 --- a/client/autofill.c +++ b/client/autofill.c @@ -180,6 +180,44 @@ static void __auth_info_recv_cb(void *user_data, rpc_port_autofill_auth_info_h a autofill_auth_info_destroy(aih); } + +static void __error_info_recv_cb(void *user_data, rpc_port_autofill_error_info_h error_info_h) +{ + autofill_error_info_h eih = NULL; + autofill_h ah = user_data; + + int error_code = 0; + char *app_id = NULL; + char *error_message = NULL; + + autofill_error_info_create(&eih); + + rpc_port_autofill_error_info_get_app_id(error_info_h, &app_id); + rpc_port_autofill_error_info_get_error_code(error_info_h, &error_code); + rpc_port_autofill_error_info_get_error_message(error_info_h, &error_message); + + autofill_error_info_set_app_id(eih, app_id); + autofill_error_info_set_error_code(eih, error_code); + autofill_error_info_set_error_message(eih, error_message); + + LOGD("error code : %d, message : %s", error_code, error_message); + + if (app_id) + free(app_id); + + if (error_message) + free(error_message); + + if (ah) { + if (ah->autofill_error_info_received_cb) + ah->autofill_error_info_received_cb(ah, eih, ah->autofill_error_info_data); + } + else { + LOGW("no user data"); + } + + autofill_error_info_destroy(eih); +} //LCOV_EXCL_STOP static void __on_connected(rpc_port_proxy_AutofillAppPort_h h, void *user_data) @@ -195,8 +233,9 @@ static void __on_connected(rpc_port_proxy_AutofillAppPort_h h, void *user_data) LOGI("connected"); rpc_port_AutofillAppPort_autofill_fill_response_received_cb_h fill_response_received_cb = rpc_port_AutofillAppPort_autofill_fill_response_received_cb_create(__fill_response_recv_cb, false, ah); rpc_port_AutofillAppPort_autofill_auth_info_received_cb_h auth_info_received_cb = rpc_port_AutofillAppPort_autofill_auth_info_received_cb_create(__auth_info_recv_cb, false, ah); + rpc_port_AutofillAppPort_autofill_error_info_received_cb_h error_info_received_cb = rpc_port_AutofillAppPort_autofill_error_info_received_cb_create(__error_info_recv_cb, false, ah); - int r = rpc_port_proxy_AutofillAppPort_invoke_Register(h, ah->context_id, auth_info_received_cb, fill_response_received_cb); + int r = rpc_port_proxy_AutofillAppPort_invoke_Register(h, ah->context_id, auth_info_received_cb, fill_response_received_cb, error_info_received_cb); if (r != 0) LOGW("[ERROR] Failed to invoke Register"); @@ -269,6 +308,7 @@ EXPORT_API int autofill_destroy(autofill_h ah) ah->connection_callback = NULL; ah->autofill_fill_response_received_cb = NULL; ah->autofill_auth_info_received_cb = NULL; + ah->autofill_error_info_received_cb = NULL; if (ah->rpc_h) { rpc_port_proxy_AutofillAppPort_destroy(ah->rpc_h); @@ -401,3 +441,29 @@ EXPORT_API int autofill_commit(autofill_h ah, autofill_save_view_info_h vi) return AUTOFILL_ERROR_NONE; } } + +EXPORT_API int autofill_error_info_set_received_cb(autofill_h ah, autofill_error_info_received_cb callback, void *user_data) +{ + if (!ah || !callback) { + LOGW("[ERROR] Invalid parameter"); + return AUTOFILL_ERROR_INVALID_PARAMETER; + } + + ah->autofill_error_info_received_cb = callback; + ah->autofill_error_info_data = user_data; + + return AUTOFILL_ERROR_NONE; +} + +EXPORT_API int autofill_error_info_unset_received_cb(autofill_h ah) +{ + if (!ah) { + LOGW("[ERROR] Invalid parameter"); + return AUTOFILL_ERROR_INVALID_PARAMETER; + } + + ah->autofill_error_info_received_cb = NULL; + ah->autofill_error_info_data = NULL; + + return AUTOFILL_ERROR_NONE; +} \ No newline at end of file diff --git a/include/autofill.h b/include/autofill.h index ab05b07..0f6b920 100644 --- a/include/autofill.h +++ b/include/autofill.h @@ -85,6 +85,18 @@ typedef void (*autofill_fill_response_received_cb)(autofill_h ah, autofill_fill_ typedef void (*autofill_auth_info_received_cb)(autofill_h ah, autofill_auth_info_h auth_info, void *user_data); /** + * @brief Called when receiving the error information. + * @since_tizen 5.5 + * @remarks @a ah should not be freed and can be used only in the callback. + * @remarks @a error_info should not be freed and can be used only in the callback. + * @param[in] ah The autofill handle + * @param[in] error_info The autofill error information handle + * @param[in] user_data The user data passed from the callback function + * @see autofill_error_info_set_received_cb() + */ +typedef void (*autofill_error_info_received_cb)(autofill_h ah, autofill_error_info_h error_info, void *user_data); + +/** * @brief Creates a handle for autofill. * @since_tizen 5.5 * @remarks If the function succeeds, @a ah handle must be released with autofill_destroy(). @@ -205,6 +217,30 @@ int autofill_fill_response_unset_received_cb(autofill_h ah); int autofill_commit(autofill_h ah, autofill_save_view_info_h vi); /** + * @brief Sets the callback to receive the error information. + * @since_tizen 5.5 + * @param[in] ah The autofill handle + * @param[in] callback The callback function to register + * @param[in] user_data The user data to be passed to the callback function + * @return 0 on success, otherwise a negative error value + * @retval #AUTOFILL_ERROR_NONE No error + * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter + * @see autofill_error_info_unset_received_cb() + */ +int autofill_error_info_set_received_cb(autofill_h ah, autofill_error_info_received_cb callback, void *user_data); + +/** + * @brief Unsets the callback to receive the error information. + * @since_tizen 5.5 + * @param[in] ah The autofill handle + * @return 0 on success, otherwise a negative error value + * @retval #AUTOFILL_ERROR_NONE No error + * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter + * @see autofill_error_info_set_received_cb() + */ +int autofill_error_info_unset_received_cb(autofill_h ah); + +/** * @} */ diff --git a/include/autofill_common.h b/include/autofill_common.h index ae0601a..fb57863 100644 --- a/include/autofill_common.h +++ b/include/autofill_common.h @@ -105,6 +105,12 @@ typedef struct autofill_save_item_s *autofill_save_item_h; typedef struct autofill_save_view_info_s *autofill_save_view_info_h; /** + * @brief The autofill error information handle. + * @since_tizen 5.5 + */ +typedef struct autofill_error_info_s *autofill_error_info_h; + +/** * @brief Called for each autofill information in view info. * @since_tizen 5.5 * @remarks @a item should not be freed and can be used only in the callback. @@ -1100,6 +1106,98 @@ int autofill_save_item_set_value(autofill_save_item_h it, const char *value); int autofill_save_item_get_value(autofill_save_item_h it, char **value); /** + * @brief Creates autofill error information. + * @since_tizen 5.5 + * @remarks If the function succeeds, @a ei handle must be released with autofill_error_info_destroy(). + * @param[out] ei The autofill error information handle + * @return 0 on success, otherwise a negative error value + * @retval #AUTOFILL_ERROR_NONE No error + * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #AUTOFILL_ERROR_OUT_OF_MEMORY Out of memory + */ +int autofill_error_info_create(autofill_error_info_h *ei); + +/** + * @brief Destroys autofill error information. + * @since_tizen 5.5 + * @param[in] ei The autofill error information handle + * @return 0 on success, otherwise a negative error value + * @retval #AUTOFILL_ERROR_NONE No error + * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter + */ +int autofill_error_info_destroy(autofill_error_info_h ei); + +/** + * @brief Sets the app id in autofill error information. + * @since_tizen 5.5 + * @param[in] ei The autofill error information handle + * @param[in] app_id The app ID + * @return 0 on success, otherwise a negative error value + * @retval #AUTOFILL_ERROR_NONE No error + * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter + */ +int autofill_error_info_set_app_id(autofill_error_info_h ei, const char *app_id); + +/** + * @brief Gets the app id in autofill error information. + * @since_tizen 5.5 + * @remarks @a app_id must be released using free(). + * @param[in] ei The autofill error information handle + * @param[out] app_id The app ID + * @return 0 on success, otherwise a negative error value + * @retval #AUTOFILL_ERROR_NONE No error + * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #AUTOFILL_ERROR_OPERATION_FAILED Operation failure + */ +int autofill_error_info_get_app_id(autofill_error_info_h ei, char **app_id); + +/** + * @brief Sets the error code in autofill error information. + * @since_tizen 5.5 + * @param[in] ei The autofill error information handle + * @param[in] error_code The autofill error code + * @return 0 on success, otherwise a negative error value + * @retval #AUTOFILL_ERROR_NONE No error + * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter + */ +int autofill_error_info_set_error_code(autofill_error_info_h ei, autofill_error_e error_code); + +/** + * @brief Gets the error code in autofill error information. + * @since_tizen 5.5 + * @param[in] ei The autofill error information handle + * @param[out] error_code The autofill error code + * @return 0 on success, otherwise a negative error value + * @retval #AUTOFILL_ERROR_NONE No error + * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter + */ +int autofill_error_info_get_error_code(autofill_error_info_h ei, autofill_error_e *error_code); + +/** + * @brief Sets the error message in autofill error information. + * @since_tizen 5.5 + * @param[in] ei The autofill error information handle + * @param[in] error_message The autofill error message + * @return 0 on success, otherwise a negative error value + * @retval #AUTOFILL_ERROR_NONE No error + * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter + */ +int autofill_error_info_set_error_message(autofill_error_info_h ei, const char *error_message); + +/** + * @brief Gets the error message in autofill error information. + * @since_tizen 5.5 + * @remarks @a error_message must be released using free(). + * @param[in] ei The autofill error information handle + * @param[out] error_message The autofill error message + * @return 0 on success, otherwise a negative error value + * @retval #AUTOFILL_ERROR_NONE No error + * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #AUTOFILL_ERROR_OPERATION_FAILED Operation failure + */ +int autofill_error_info_get_error_message(autofill_error_info_h ei, char **error_message); + +/** * @} */ diff --git a/include/autofill_error.h b/include/autofill_error.h index 6ad20e4..676ed5e 100644 --- a/include/autofill_error.h +++ b/include/autofill_error.h @@ -43,6 +43,9 @@ typedef enum { AUTOFILL_ERROR_NOT_INITIALIZED = TIZEN_ERROR_AUTOFILL | 0x0001, /**< Not initialized */ AUTOFILL_ERROR_OPERATION_FAILED = TIZEN_ERROR_AUTOFILL | 0x0002, /**< Operation failed */ AUTOFILL_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */ + AUTOFILL_ERROR_AUTHENTICATION_FAILED = TIZEN_ERROR_AUTOFILL | 0x0003, /**< Authentication failed */ + AUTOFILL_ERROR_COMMIT_FAILED = TIZEN_ERROR_AUTOFILL | 0x0004, /**< Failed to save autofill data */ + AUTOFILL_ERROR_FILL_RESPONSE_FAILED = TIZEN_ERROR_AUTOFILL | 0x0005, /**< Failed to response fill request */ } autofill_error_e; /** diff --git a/include/autofill_private.h b/include/autofill_private.h index 6a465cb..363cf85 100644 --- a/include/autofill_private.h +++ b/include/autofill_private.h @@ -36,6 +36,9 @@ struct autofill_s { autofill_auth_info_received_cb autofill_auth_info_received_cb; void *autofill_auth_info_data; + + autofill_error_info_received_cb autofill_error_info_received_cb; + void *autofill_error_info_data; }; struct autofill_view_info_s { diff --git a/include/autofill_service.h b/include/autofill_service.h index c5283d7..8d7d36e 100644 --- a/include/autofill_service.h +++ b/include/autofill_service.h @@ -189,6 +189,17 @@ int autofill_service_set_terminate_received_cb(autofill_service_terminate_receiv int autofill_service_unset_terminate_received_cb(void); /** + * @brief Sends error to the autofill client. + * @since_tizen 5.5 + * @param[in] context_id The autofill context identification value of an associated autofill client handle + * @param[in] h The autofill error info handle + * @return 0 on success, otherwise a negative error value + * @retval #AUTOFILL_ERROR_NONE No error + * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter + */ +int autofill_service_send_error_info(int context_id, autofill_error_info_h h); + +/** * @} */ diff --git a/service_lib/autofill_service.c b/service_lib/autofill_service.c index b064dd9..8113909 100644 --- a/service_lib/autofill_service.c +++ b/service_lib/autofill_service.c @@ -48,12 +48,14 @@ static void *g_autofill_service_terminate_received_data = NULL; rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h g_auth_info_cb; rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h g_fill_response_received_cb; +rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_h g_send_error_cb; typedef struct { char *app_id; rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h auth_info_cb; rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h fill_response_received_cb; + rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_h send_error_cb; } autofill_svc_s; static GList *__client_list = NULL; @@ -264,7 +266,8 @@ static void __terminate_received_cb(rpc_port_stub_AutofillSvcPort_context_h cont static autofill_svc_s *__create_client(const char *app_id, rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h auth_info_cb, - rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h fill_response_received_cb) + rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h fill_response_received_cb, + rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_h send_error_cb) { LOGD(""); autofill_svc_s *handle; @@ -300,6 +303,14 @@ static autofill_svc_s *__create_client(const char *app_id, return NULL; } + rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_clone(send_error_cb, &handle->send_error_cb); + if (!handle->send_error_cb) { + LOGE("Out of memory"); + free(handle->app_id); + free(handle); + return NULL; + } + return handle; } @@ -317,6 +328,9 @@ static void __destroy_client(gpointer data) if (handle->fill_response_received_cb) rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_destroy(handle->fill_response_received_cb); + if (handle->send_error_cb) + rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_destroy(handle->send_error_cb); + if (handle->app_id) free(handle->app_id); @@ -351,7 +365,11 @@ static void __message_terminate(rpc_port_stub_AutofillSvcPort_context_h context, free(sender); } -static int __message_register(rpc_port_stub_AutofillSvcPort_context_h context, rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h auth_info_cb, rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h fill_response_received_cb, void *user_data) +static int __message_register(rpc_port_stub_AutofillSvcPort_context_h context, + rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h auth_info_cb, + rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h fill_response_received_cb, + rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_h send_error_cb, + void *user_data) { LOGD(""); char *sender = NULL; @@ -363,7 +381,7 @@ static int __message_register(rpc_port_stub_AutofillSvcPort_context_h context, r LOGD("sender(%s)", sender); autofill_svc_s *client; - client = __create_client(sender, auth_info_cb, fill_response_received_cb); + client = __create_client(sender, auth_info_cb, fill_response_received_cb, send_error_cb); free(sender); if (!client) @@ -371,8 +389,7 @@ static int __message_register(rpc_port_stub_AutofillSvcPort_context_h context, r rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_clone(auth_info_cb, &g_auth_info_cb); rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_clone(fill_response_received_cb, &g_fill_response_received_cb); - - LOGD("auth info : %p, fill response : %p", g_auth_info_cb, g_fill_response_received_cb); + rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_clone(send_error_cb, &g_send_error_cb); __client_list = g_list_append(__client_list, client); @@ -664,3 +681,38 @@ EXPORT_API int autofill_service_unset_terminate_received_cb(void) return AUTOFILL_ERROR_NONE; } + +EXPORT_API int autofill_service_send_error_info(int context_id, autofill_error_info_h h) +{ + char *app_id = NULL; + char *error_message = NULL; + autofill_error_e error_code; + rpc_port_autofill_svc_error_info_h error_info_h = NULL; + + if (!h) { + LOGW("[ERROR] Invalid parameter"); + return AUTOFILL_ERROR_INVALID_PARAMETER; + } + + autofill_error_info_get_app_id(h, &app_id); + autofill_error_info_get_error_code(h, &error_code); + autofill_error_info_get_error_message(h, &error_message); + + /* create error info */ + rpc_port_autofill_svc_error_info_create(&error_info_h); + rpc_port_autofill_svc_error_info_set_app_id(error_info_h, app_id); + rpc_port_autofill_svc_error_info_set_error_code(error_info_h, error_code); + rpc_port_autofill_svc_error_info_set_error_message(error_info_h, error_message); + + int ret = rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_invoke(g_send_error_cb, context_id, error_info_h); + + if (app_id) + free(app_id); + + if (error_message) + free(error_message); + + rpc_port_autofill_svc_error_info_destroy(error_info_h); + + return ret; +} \ No newline at end of file diff --git a/tidl/autofill.tidl b/tidl/autofill.tidl index 6f4ccac..c44c301 100644 --- a/tidl/autofill.tidl +++ b/tidl/autofill.tidl @@ -51,10 +51,17 @@ struct autofill_fill_response { list response_groups; } +struct autofill_error_info { + string app_id; + int error_code; + string error_message; +} + interface AutofillAppPort { void autofill_auth_info_received_cb(autofill_auth_info auth_info) delegate; void autofill_fill_response_received_cb(autofill_fill_response response) delegate; - int Register(int context_id, autofill_auth_info_received_cb auth_info_cb, autofill_fill_response_received_cb fill_response_cb); + void autofill_error_info_received_cb(autofill_error_info error_info) delegate; + int Register(int context_id, autofill_auth_info_received_cb auth_info_cb, autofill_fill_response_received_cb fill_response_cb, autofill_error_info_received_cb error_info_cb); void Unregister(int context_id) async; int request_auth_info(int context_id, autofill_view_info vi); diff --git a/tidl/autofill_service.tidl b/tidl/autofill_service.tidl index 311a411..bd89003 100644 --- a/tidl/autofill_service.tidl +++ b/tidl/autofill_service.tidl @@ -53,10 +53,17 @@ struct autofill_svc_fill_response { list response_groups; } +struct autofill_svc_error_info { + string app_id; + int error_code; + string error_message; +} + interface AutofillSvcPort { void autofill_svc_auth_info_cb(int context_id, autofill_svc_auth_info auth_info) delegate; void autofill_svc_fill_response_cb(int context_id, autofill_svc_fill_response response) delegate; - int Register(autofill_svc_auth_info_cb auth_info_cb, autofill_svc_fill_response_cb fill_response_cb); + void autofill_svc_send_error_cb(int context_id, autofill_svc_error_info error_info) delegate; + int Register(autofill_svc_auth_info_cb auth_info_cb, autofill_svc_fill_response_cb fill_response_cb, autofill_svc_send_error_cb send_error_cb); void Unregister() async; void request_auth_info(int context_id, autofill_svc_view_info vi) async; -- 2.7.4 From 61063435e239502a5b56398e845bc3e85d3c60f8 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 13 Mar 2019 14:56:10 +0900 Subject: [PATCH 13/16] Update package version to 0.1.21 Change-Id: Ib6c3cf1a25ff7af7549ee326ebd3706db9690c04 Signed-off-by: Jihoon Kim --- packaging/capi-ui-autofill.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/capi-ui-autofill.spec b/packaging/capi-ui-autofill.spec index df0a8bd..ecd39ec 100644 --- a/packaging/capi-ui-autofill.spec +++ b/packaging/capi-ui-autofill.spec @@ -1,6 +1,6 @@ Name: capi-ui-autofill Summary: Autofill Library -Version: 0.1.20 +Version: 0.1.21 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From 4ac7e09a1d49b62d4aa7658dc949f59d4866847f Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 18 Mar 2019 10:20:13 +0900 Subject: [PATCH 14/16] Fix memory leak issue Dynamic memory referenced by 'handle->auth_info_cb' was allocated at autofill_service_stub.c:4040 by calling function 'rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_clone' at autofill_service.c:288 and lost at autofill_service.c:311. Dynamic memory referenced by 'handle->fill_response_received_cb' was allocated at autofill_service_stub.c:4188 by calling function 'rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_clone' at autofill_service.c:296 and lost at autofill_service.c:311. Change-Id: Iede991ba41e6fd24de1297dadd1335f8e6a97977 Signed-off-by: Jihoon Kim --- service_lib/autofill_service.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/service_lib/autofill_service.c b/service_lib/autofill_service.c index 8113909..c8631bc 100644 --- a/service_lib/autofill_service.c +++ b/service_lib/autofill_service.c @@ -307,6 +307,8 @@ static autofill_svc_s *__create_client(const char *app_id, if (!handle->send_error_cb) { LOGE("Out of memory"); free(handle->app_id); + rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_destroy(handle->auth_info_cb); + rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_destroy(handle->fill_response_received_cb); free(handle); return NULL; } @@ -322,17 +324,25 @@ static void __destroy_client(gpointer data) if (!handle) return; - if (handle->auth_info_cb) + if (handle->auth_info_cb) { rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_destroy(handle->auth_info_cb); + handle->auth_info_cb = NULL; + } - if (handle->fill_response_received_cb) + if (handle->fill_response_received_cb) { rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_destroy(handle->fill_response_received_cb); + handle->fill_response_received_cb = NULL; + } - if (handle->send_error_cb) + if (handle->send_error_cb) { rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_destroy(handle->send_error_cb); + handle->send_error_cb = NULL; + } - if (handle->app_id) + if (handle->app_id) { free(handle->app_id); + handle->app_id = NULL; + } free(handle); } -- 2.7.4 From 8b2714a0e42b1c42d1482a188bf704c372e575d1 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 18 Mar 2019 10:46:10 +0900 Subject: [PATCH 15/16] Update package version to 0.1.22 Change-Id: If51e8ca03d755f07d88f39f9abc6e788a7e303c5 Signed-off-by: Jihoon Kim --- packaging/capi-ui-autofill.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/capi-ui-autofill.spec b/packaging/capi-ui-autofill.spec index ecd39ec..b7a40ff 100644 --- a/packaging/capi-ui-autofill.spec +++ b/packaging/capi-ui-autofill.spec @@ -1,6 +1,6 @@ Name: capi-ui-autofill Summary: Autofill Library -Version: 0.1.21 +Version: 0.1.22 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From c08b7e7b630496a762f78ebfe61fa9296978d64d Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 18 Mar 2019 14:10:20 +0900 Subject: [PATCH 16/16] Fix memory leak in destroy APIs Change-Id: I36aacc0eed5ccc4e1014b671e9783027120accd7 Signed-off-by: Jihoon Kim --- client/autofill.c | 4 +++- common/autofill_item.c | 1 - manager/autofill_manager.c | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/client/autofill.c b/client/autofill.c index e8985d3..e132663 100644 --- a/client/autofill.c +++ b/client/autofill.c @@ -315,6 +315,8 @@ EXPORT_API int autofill_destroy(autofill_h ah) ah->rpc_h = NULL; } + free(ah); + return AUTOFILL_ERROR_NONE; } @@ -466,4 +468,4 @@ EXPORT_API int autofill_error_info_unset_received_cb(autofill_h ah) ah->autofill_error_info_data = NULL; return AUTOFILL_ERROR_NONE; -} \ No newline at end of file +} diff --git a/common/autofill_item.c b/common/autofill_item.c index 8a20806..f90b9cc 100644 --- a/common/autofill_item.c +++ b/common/autofill_item.c @@ -51,7 +51,6 @@ EXPORT_API int autofill_item_create(autofill_item_h *it) return AUTOFILL_ERROR_NONE; } -// Destroy autofill info list item EXPORT_API int autofill_item_destroy(autofill_item_h it) { if (!it) diff --git a/manager/autofill_manager.c b/manager/autofill_manager.c index e2becfc..b452824 100644 --- a/manager/autofill_manager.c +++ b/manager/autofill_manager.c @@ -133,6 +133,8 @@ EXPORT_API int autofill_manager_destroy(autofill_manager_h amh) amh->rpc_h = NULL; } + free(amh); + return AUTOFILL_ERROR_NONE; } -- 2.7.4