From 810ff6edb961d8b75637bce0559652bf0ce15a73 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 8 Mar 2019 11:00:28 +0900 Subject: [PATCH 01/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 02/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 03/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 04/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 05/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 06/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 From 3c8e353c45d3d878fe93297f5a8fb9a8e3367466 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 18 Mar 2019 14:10:44 +0900 Subject: [PATCH 07/16] Update package version to 0.1.23 Change-Id: Ied93e37830597d6cfa5e55e8f23c33c62308653b 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 b7a40ff..90eb845 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.22 +Version: 0.1.23 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From 8996748b9818fc961abf9ba11acaa3d69660b546 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 19 Mar 2019 16:31:38 +0900 Subject: [PATCH 08/16] Remove error message API in error info Change-Id: I672aa58e0f81d25166ae72e1ea64b8f71af49706 Signed-off-by: Jihoon Kim --- client/autofill.c | 8 +-- common/autofill_error_info.c | 109 +++++++++++++++++++++++++++++++++++++++++ include/autofill_common.h | 24 --------- include/autofill_error.h | 4 ++ service_lib/autofill_service.c | 8 +-- tidl/autofill.tidl | 1 - tidl/autofill_service.tidl | 1 - 7 files changed, 115 insertions(+), 40 deletions(-) create mode 100644 common/autofill_error_info.c diff --git a/client/autofill.c b/client/autofill.c index e132663..768392b 100644 --- a/client/autofill.c +++ b/client/autofill.c @@ -188,26 +188,20 @@ static void __error_info_recv_cb(void *user_data, rpc_port_autofill_error_info_h 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); + LOGD("error code : %x", error_code); 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); diff --git a/common/autofill_error_info.c b/common/autofill_error_info.c new file mode 100644 index 0000000..cc74991 --- /dev/null +++ b/common/autofill_error_info.c @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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. + */ + +#include +#include +#include +#include +#include + +#include "autofill_private.h" +#include + +#ifdef LOG_TAG +#undef LOG_TAG +#endif +#define LOG_TAG "AUTOFILL" + +struct autofill_error_info_s { + char *app_id; + autofill_error_e error_code; +}; + +EXPORT_API int autofill_error_info_create(autofill_error_info_h *ei) +{ + if (!ei) + return AUTOFILL_ERROR_INVALID_PARAMETER; + + struct autofill_error_info_s *eis = (autofill_error_info_h)calloc(1, sizeof(struct autofill_error_info_s)); + if (!eis) + return AUTOFILL_ERROR_OUT_OF_MEMORY; + + *ei = (autofill_error_info_h)eis; + + return AUTOFILL_ERROR_NONE; +} + +EXPORT_API int autofill_error_info_destroy(autofill_error_info_h ei) +{ + if (!ei) + return AUTOFILL_ERROR_INVALID_PARAMETER; + + if (ei->app_id) { + free(ei->app_id); + ei->app_id = NULL; + } + + free(ei); + + return AUTOFILL_ERROR_NONE; +} + +EXPORT_API int autofill_error_info_set_error_code(autofill_error_info_h ei, autofill_error_e error_code) +{ + if (!ei) + return AUTOFILL_ERROR_INVALID_PARAMETER; + + ei->error_code = error_code; + + return AUTOFILL_ERROR_NONE; +} + +EXPORT_API int autofill_error_info_get_error_code(autofill_error_info_h ei, autofill_error_e *error_code) +{ + if (!ei || !error_code) + return AUTOFILL_ERROR_INVALID_PARAMETER; + + *error_code = ei->error_code; + + return AUTOFILL_ERROR_NONE; +} + +EXPORT_API int autofill_error_info_set_app_id(autofill_error_info_h ei, const char *app_id) +{ + if (!ei || !app_id) + return AUTOFILL_ERROR_INVALID_PARAMETER; + + if (ei->app_id) + free(ei->app_id); + + ei->app_id = strdup(app_id); + + return AUTOFILL_ERROR_NONE; +} + +EXPORT_API int autofill_error_info_get_app_id(autofill_error_info_h ei, char **app_id) +{ + if (!ei || !app_id) + return AUTOFILL_ERROR_INVALID_PARAMETER; + + if (!ei->app_id) + return AUTOFILL_ERROR_OPERATION_FAILED; + + *app_id = strdup(ei->app_id); + + return AUTOFILL_ERROR_NONE; +} diff --git a/include/autofill_common.h b/include/autofill_common.h index fb57863..8ab7ed6 100644 --- a/include/autofill_common.h +++ b/include/autofill_common.h @@ -1174,30 +1174,6 @@ int autofill_error_info_set_error_code(autofill_error_info_h ei, autofill_error_ 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 676ed5e..0132094 100644 --- a/include/autofill_error.h +++ b/include/autofill_error.h @@ -46,6 +46,10 @@ typedef enum { 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_SERVICE_NOT_CONNECTED = TIZEN_ERROR_AUTOFILL | 0x0006, /**< Unable to connect to Autofill Service */ + AUTOFILL_ERROR_SERVICE_NOT_ALLOWED = TIZEN_ERROR_AUTOFILL | 0x0007, /**< Autofill Service is not allowed */ + AUTOFILL_ERROR_SERVICE_NOT_ACTIVATED = TIZEN_ERROR_AUTOFILL | 0x0008, /**< Autofill Service is not activated */ + AUTOFILL_ERROR_SAVED_VALUES_NOT_FOUND = TIZEN_ERROR_AUTOFILL | 0x0009, /**< Could not find saved values */ } autofill_error_e; /** diff --git a/service_lib/autofill_service.c b/service_lib/autofill_service.c index c8631bc..4c7654d 100644 --- a/service_lib/autofill_service.c +++ b/service_lib/autofill_service.c @@ -695,7 +695,6 @@ EXPORT_API int autofill_service_unset_terminate_received_cb(void) 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; @@ -706,23 +705,18 @@ EXPORT_API int autofill_service_send_error_info(int context_id, autofill_error_i 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 c44c301..fbf53b4 100644 --- a/tidl/autofill.tidl +++ b/tidl/autofill.tidl @@ -54,7 +54,6 @@ struct autofill_fill_response { struct autofill_error_info { string app_id; int error_code; - string error_message; } interface AutofillAppPort { diff --git a/tidl/autofill_service.tidl b/tidl/autofill_service.tidl index bd89003..31a4809 100644 --- a/tidl/autofill_service.tidl +++ b/tidl/autofill_service.tidl @@ -56,7 +56,6 @@ struct autofill_svc_fill_response { struct autofill_svc_error_info { string app_id; int error_code; - string error_message; } interface AutofillSvcPort { -- 2.7.4 From 0b54948185d1f29a053402be5f044473358c4217 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 19 Mar 2019 19:06:14 +0900 Subject: [PATCH 09/16] Update package version to 0.1.24 Change-Id: Id6736a14d4d81559e580cddcb47cf581c6233677 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 90eb845..6a3656d 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.23 +Version: 0.1.24 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From 4b68e75a9392e00eab4cbf14ad01e672aead1ad6 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 21 Mar 2019 10:05:08 +0900 Subject: [PATCH 10/16] Fix documentation Change-Id: I7f4cd293d0c98e61a539f1885e3e9e40f27e4025 Signed-off-by: Jihoon Kim --- include/autofill_common.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/autofill_common.h b/include/autofill_common.h index 8ab7ed6..dbf44d3 100644 --- a/include/autofill_common.h +++ b/include/autofill_common.h @@ -825,7 +825,7 @@ int autofill_fill_response_group_destroy(autofill_fill_response_group_h h); int autofill_fill_response_group_clone(autofill_fill_response_group_h h, autofill_fill_response_group_h *clone); /** - * @brief Adds autofill item in an autofill fil response group. + * @brief Adds autofill item in an autofill fill response group. * @since_tizen 5.5 * @param[in] h The autofill fill response group handle * @param[in] it The autofill fill response item handle @@ -1170,6 +1170,7 @@ int autofill_error_info_set_error_code(autofill_error_info_h ei, autofill_error_ * @return 0 on success, otherwise a negative error value * @retval #AUTOFILL_ERROR_NONE No error * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter + * @see get_error_message() */ int autofill_error_info_get_error_code(autofill_error_info_h ei, autofill_error_e *error_code); -- 2.7.4 From 6b98da4a96ef15efa93ef70214cf76a6bc892519 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 22 Mar 2019 15:45:28 +0900 Subject: [PATCH 11/16] Update package version to 0.1.25 Change-Id: Iba75ed39d94ea8f3e5e175b835ad41ff374645d1 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 6a3656d..e0031e4 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.24 +Version: 0.1.25 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From d76b22c8295d11649848077b410d4286f8ef8389 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 5 Apr 2019 15:23:38 +0900 Subject: [PATCH 12/16] Fix coding style Change-Id: I71ac295aa1ae3eda54a59d0d977eda9c83db7e60 Signed-off-by: Jihoon Kim --- include/autofill_common.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/autofill_common.h b/include/autofill_common.h index dbf44d3..c8f7512 100644 --- a/include/autofill_common.h +++ b/include/autofill_common.h @@ -39,8 +39,7 @@ extern "C" { * * @since_tizen 5.5 */ -typedef enum -{ +typedef enum { AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE, /**< Autofill hint for a credit card expiration date */ AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY, /**< Autofill hint for a credit card expiration day */ AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH, /**< Autofill hint for a credit card expiration month */ -- 2.7.4 From 0748052932b20355db6c901b3cbe2631aaf38765 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 8 Apr 2019 14:15:25 +0900 Subject: [PATCH 13/16] Remove unnecessary codes Change-Id: I39bde0053bdb138ddfbf72505e71bb938c22e3ea Signed-off-by: Jihoon Kim --- service_lib/autofill_service.c | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/service_lib/autofill_service.c b/service_lib/autofill_service.c index 4c7654d..5307ff3 100644 --- a/service_lib/autofill_service.c +++ b/service_lib/autofill_service.c @@ -347,34 +347,6 @@ static void __destroy_client(gpointer data) free(handle); } -static void __message_create(rpc_port_stub_AutofillSvcPort_context_h context, - void *user_data) -{ - LOGD(""); - char *sender = NULL; - - rpc_port_stub_AutofillSvcPort_context_get_sender(context, &sender); - if (!sender) - return; - - LOGD("sender(%s)", sender); - free(sender); -} - -static void __message_terminate(rpc_port_stub_AutofillSvcPort_context_h context, - void *user_data) -{ - LOGD(""); - char *sender = NULL; - - rpc_port_stub_AutofillSvcPort_context_get_sender(context, &sender); - if (!sender) - return; - - LOGD("sender(%s)", sender); - 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, @@ -388,8 +360,6 @@ static int __message_register(rpc_port_stub_AutofillSvcPort_context_h context, if (!sender) return -1; - LOGD("sender(%s)", sender); - autofill_svc_s *client; client = __create_client(sender, auth_info_cb, fill_response_received_cb, send_error_cb); free(sender); @@ -430,8 +400,8 @@ EXPORT_API int autofill_service_initialize(void) int ret; rpc_port_stub_AutofillSvcPort_callback_s callback = { - __message_create, - __message_terminate, + NULL, + NULL, __message_register, __message_unregister, __auth_info_request_cb, -- 2.7.4 From 7b286ed05c78bdcc860d811bc68f85cb5a384103 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 15 Apr 2019 19:04:26 +0900 Subject: [PATCH 14/16] Change as appropriate log level Change-Id: I21e941be996a0ae99f8f73e9fa1f2f3fdb56ca1c Signed-off-by: Jihoon Kim --- client/autofill.c | 6 +++--- manager/autofill_manager.c | 6 +++--- service_lib/autofill_service.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/client/autofill.c b/client/autofill.c index 768392b..a3706eb 100644 --- a/client/autofill.c +++ b/client/autofill.c @@ -197,7 +197,7 @@ static void __error_info_recv_cb(void *user_data, rpc_port_autofill_error_info_h autofill_error_info_set_app_id(eih, app_id); autofill_error_info_set_error_code(eih, error_code); - LOGD("error code : %x", error_code); + LOGI("error code : %x", error_code); if (app_id) free(app_id); @@ -240,7 +240,7 @@ static void __on_connected(rpc_port_proxy_AutofillAppPort_h h, void *user_data) //LCOV_EXCL_START static void __on_disconnected(rpc_port_proxy_AutofillAppPort_h h, void *user_data) { - LOGD("disconnected"); + LOGI("disconnected"); autofill_h ah = user_data; if (ah) { @@ -255,7 +255,7 @@ static void __on_disconnected(rpc_port_proxy_AutofillAppPort_h h, void *user_dat static void __on_rejected(rpc_port_proxy_AutofillAppPort_h h, void *user_data) { - LOGD("rejected"); + LOGI("rejected"); autofill_h ah = user_data; diff --git a/manager/autofill_manager.c b/manager/autofill_manager.c index b452824..4998d0e 100644 --- a/manager/autofill_manager.c +++ b/manager/autofill_manager.c @@ -40,7 +40,7 @@ struct autofill_manager_s { static void __on_connected(rpc_port_proxy_AutofillManagerPort_h h, void *user_data) { autofill_manager_h amh = user_data; - LOGI("[__RPC_PORT__] connected"); + LOGI("connected"); if (amh->connection_callback) amh->connection_callback(amh, AUTOFILL_MANAGER_CONNECTION_STATUS_CONNECTED, amh->connection_userdata); @@ -50,7 +50,7 @@ static void __on_connected(rpc_port_proxy_AutofillManagerPort_h h, void *user_da static void __on_disconnected(rpc_port_proxy_AutofillManagerPort_h h, void *user_data) { autofill_manager_h amh = user_data; - LOGD("disconnected"); + LOGI("disconnected"); if (amh->connection_callback) amh->connection_callback(amh, AUTOFILL_MANAGER_CONNECTION_STATUS_DISCONNECTED, amh->connection_userdata); @@ -61,7 +61,7 @@ static void __on_disconnected(rpc_port_proxy_AutofillManagerPort_h h, void *user static void __on_rejected(rpc_port_proxy_AutofillManagerPort_h h, void *user_data) { autofill_manager_h amh = user_data; - LOGD("rejected"); + LOGI("rejected"); if (amh->connection_callback) amh->connection_callback(amh, AUTOFILL_MANAGER_CONNECTION_STATUS_REJECTED, amh->connection_userdata); diff --git a/service_lib/autofill_service.c b/service_lib/autofill_service.c index 5307ff3..590f2d5 100644 --- a/service_lib/autofill_service.c +++ b/service_lib/autofill_service.c @@ -412,7 +412,7 @@ EXPORT_API int autofill_service_initialize(void) ret = rpc_port_stub_AutofillSvcPort_register(&callback, NULL); if (ret != 0) - LOGI("Failed to register message"); + LOGW("Failed to register message"); else LOGI("Succeeded to register message"); -- 2.7.4 From 82ccaf8ced5f02ad1329af0363c0b3718bc8372e Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 18 Apr 2019 17:24:02 +0900 Subject: [PATCH 15/16] Update package version to 0.1.26 Change-Id: I429cf5b3ef11035c30d312e7976527b5b425a78a 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 e0031e4..508dbd5 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.25 +Version: 0.1.26 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From 669bbb5dfc78d7d8fec6af3d8157d967263d1de8 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 3 May 2019 11:32:52 +0900 Subject: [PATCH 16/16] Add view title information in save view info Change-Id: I07bb03eec89059c0a54ea90855d56ae581bd8e85 Signed-off-by: Jihoon Kim --- client/autofill.c | 3 ++- common/autofill_save_view_info.c | 31 +++++++++++++++++++++++++++++++ include/autofill_common.h | 24 ++++++++++++++++++++++++ include/autofill_private.h | 1 + service_lib/autofill_service.c | 7 +++++++ tidl/autofill.tidl | 1 + tidl/autofill_service.tidl | 1 + 7 files changed, 67 insertions(+), 1 deletion(-) diff --git a/client/autofill.c b/client/autofill.c index a3706eb..c53c86e 100644 --- a/client/autofill.c +++ b/client/autofill.c @@ -383,6 +383,7 @@ EXPORT_API int autofill_commit(autofill_h ah, autofill_save_view_info_h vi) rpc_port_autofill_save_view_info_create(&vih); rpc_port_autofill_save_view_info_set_view_id(vih, vi->view_id); + rpc_port_autofill_save_view_info_set_view_title(vih, vi->view_title); Eina_List *l; autofill_save_item_h it; @@ -423,7 +424,7 @@ EXPORT_API int autofill_commit(autofill_h ah, autofill_save_view_info_h vi) rpc_port_autofill_save_item_destroy(aih); } - LOGD("app id : %s, view id : %s", vi->app_id, vi->view_id); + LOGD("app id : %s, view id : '%s', view title : '%s'", vi->app_id, vi->view_id, vi->view_title); int ret = rpc_port_proxy_AutofillAppPort_invoke_commit(ah->rpc_h, ah->context_id, vih); diff --git a/common/autofill_save_view_info.c b/common/autofill_save_view_info.c index 5185e1e..2fadfee 100644 --- a/common/autofill_save_view_info.c +++ b/common/autofill_save_view_info.c @@ -58,6 +58,11 @@ EXPORT_API int autofill_save_view_info_destroy(autofill_save_view_info_h vi) vi->view_id = NULL; } + if (vi->view_title) { + free(vi->view_title); + vi->view_title = NULL; + } + // release memory autofill item list autofill_save_item_h it_h; EINA_LIST_FREE(vi->autofill_save_item_list, it_h) @@ -121,6 +126,32 @@ EXPORT_API int autofill_save_view_info_get_view_id(autofill_save_view_info_h vi, return AUTOFILL_ERROR_NONE; } +EXPORT_API int autofill_save_view_info_set_view_title(autofill_save_view_info_h vi, const char *view_title) +{ + if (!vi || !view_title) + return AUTOFILL_ERROR_INVALID_PARAMETER; + + if (vi->view_title) + free(vi->view_title); + + vi->view_title = strdup(view_title); + + return AUTOFILL_ERROR_NONE; +} + +EXPORT_API int autofill_save_view_info_get_view_title(autofill_save_view_info_h vi, char **view_title) +{ + if (!vi || !view_title) + return AUTOFILL_ERROR_INVALID_PARAMETER; + + if (!vi->view_title) + return AUTOFILL_ERROR_OPERATION_FAILED; + + *view_title = strdup(vi->view_title); + + return AUTOFILL_ERROR_NONE; +} + EXPORT_API int autofill_save_view_info_add_item(autofill_save_view_info_h vi, autofill_save_item_h it) { if (!vi || !it) diff --git a/include/autofill_common.h b/include/autofill_common.h index c8f7512..6d8d1da 100644 --- a/include/autofill_common.h +++ b/include/autofill_common.h @@ -662,6 +662,30 @@ int autofill_save_view_info_set_view_id(autofill_save_view_info_h vi, const char int autofill_save_view_info_get_view_id(autofill_save_view_info_h vi, char **view_id); /** + * @brief Sets the view title in autofill save view information. + * @since_tizen 5.5 + * @param[in] vi The autofill view info handle + * @param[in] view_title The view title + * @return 0 on success, otherwise a negative error value + * @retval #AUTOFILL_ERROR_NONE No error + * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter + */ +int autofill_save_view_info_set_view_title(autofill_save_view_info_h vi, const char *view_title); + +/** + * @brief Gets the view title in autofill save view information. + * @since_tizen 5.5 + * @remarks @a view_title must be released using free(). + * @param[in] vi The autofill view info handle + * @param[out] view_title The view title + * @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_save_view_info_get_view_title(autofill_save_view_info_h vi, char **view_title); + +/** * @brief Adds autofill save item in autofill save view information. * @since_tizen 5.5 * @param[in] vi The autofill save view info handle diff --git a/include/autofill_private.h b/include/autofill_private.h index 363cf85..31012b2 100644 --- a/include/autofill_private.h +++ b/include/autofill_private.h @@ -50,6 +50,7 @@ struct autofill_view_info_s { struct autofill_save_view_info_s { char *app_id; // app ID char *view_id; // view unique ID or web page URL (URL started with http:// or https://) + char *view_title; // view title Eina_List *autofill_save_item_list; // autofill_save_item_h list }; diff --git a/service_lib/autofill_service.c b/service_lib/autofill_service.c index 590f2d5..ebca4b5 100644 --- a/service_lib/autofill_service.c +++ b/service_lib/autofill_service.c @@ -227,9 +227,11 @@ static void __autofill_commit_cb(rpc_port_stub_AutofillSvcPort_context_h context { char *app_id = NULL; char *view_id = NULL; + char *view_title = 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); + rpc_port_autofill_svc_save_view_info_get_view_title(vi, &view_title); LOGD("app id : %s, view id : %s", app_id, view_id); @@ -237,6 +239,7 @@ static void __autofill_commit_cb(rpc_port_stub_AutofillSvcPort_context_h context 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); + autofill_save_view_info_set_view_title(view_info, view_title); rpc_port_autofill_svc_save_view_info_foreach_items(vi, __save_item_cb, view_info); @@ -252,6 +255,10 @@ static void __autofill_commit_cb(rpc_port_stub_AutofillSvcPort_context_h context if (view_id) { free(view_id); } + + if (view_title) { + free(view_title); + } } static void __terminate_received_cb(rpc_port_stub_AutofillSvcPort_context_h context, void *user_data) diff --git a/tidl/autofill.tidl b/tidl/autofill.tidl index fbf53b4..bfac23d 100644 --- a/tidl/autofill.tidl +++ b/tidl/autofill.tidl @@ -21,6 +21,7 @@ struct autofill_save_item { struct autofill_save_view_info { string view_id; + string view_title; list items; } diff --git a/tidl/autofill_service.tidl b/tidl/autofill_service.tidl index 31a4809..ffe3dc1 100644 --- a/tidl/autofill_service.tidl +++ b/tidl/autofill_service.tidl @@ -23,6 +23,7 @@ struct autofill_svc_save_item { struct autofill_svc_save_view_info { string app_id; string view_id; + string view_title; list items; } -- 2.7.4