From: Jihoon Kim Date: Fri, 20 Sep 2019 11:12:41 +0000 (+0900) Subject: Add new API for fixing typo in API X-Git-Tag: accepted/tizen/unified/20190923.011220~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b33edadc3dcbbd677a9c8e48ea6f40539589c703;p=platform%2Fcore%2Fuifw%2Fautofill.git Add new API for fixing typo in API autofill_service_set_commited_cb() and autofill_service_unset_commited_cb() will be removed after being replaced in service app. Change-Id: I3b4c174de450395e31a02dce38e4c41d8c48b1cc Signed-off-by: Jihoon Kim --- diff --git a/include/autofill_service.h b/include/autofill_service.h index d423df8..ca5f3bd 100644 --- a/include/autofill_service.h +++ b/include/autofill_service.h @@ -73,9 +73,9 @@ typedef void (*autofill_service_cancel_fill_requested_cb)(int context_id, autofi * @param[in] context_id The autofill context identification value of an associated autofill client handle * @param[in] vi The autofill save view info handle * @param[in] user_data The user data passed from the callback function - * @see autofill_service_set_commited_cb() + * @see autofill_service_set_committed_cb() */ -typedef void (*autofill_service_commited_cb)(int context_id, autofill_save_view_info_h vi, void *user_data); +typedef void (*autofill_service_committed_cb)(int context_id, autofill_save_view_info_h vi, void *user_data); /** * @brief Called when receiving terminate request. @@ -189,7 +189,18 @@ int autofill_service_send_fill_response(int context_id, autofill_fill_response_h * @retval #AUTOFILL_ERROR_NONE No error * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter */ -int autofill_service_set_commited_cb(autofill_service_commited_cb callback, void *user_data); +int autofill_service_set_commited_cb(autofill_service_committed_cb callback, void *user_data); + +/** + * @brief Sets the callback to receive the commit request. + * @since_tizen 5.5 + * @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 + */ +int autofill_service_set_committed_cb(autofill_service_committed_cb callback, void *user_data); /** * @brief Unsets the callback to receive the commit request. @@ -200,6 +211,14 @@ int autofill_service_set_commited_cb(autofill_service_commited_cb callback, void int autofill_service_unset_commited_cb(void); /** + * @brief Unsets the callback to receive the commit request. + * @since_tizen 5.5 + * @return 0 on success, otherwise a negative error value + * @retval #AUTOFILL_ERROR_NONE No error + */ +int autofill_service_unset_committed_cb(void); + +/** * @brief Sets the callback to receive the terminate request. * @since_tizen 5.5 * @param[in] callback The callback function to register diff --git a/service_lib/autofill_service.c b/service_lib/autofill_service.c index b867902..a9520b1 100644 --- a/service_lib/autofill_service.c +++ b/service_lib/autofill_service.c @@ -43,7 +43,7 @@ static void *g_autofill_service_cancel_fill_request_data = NULL; static autofill_service_auth_info_requested_cb g_autofill_service_auth_info_requested_cb = NULL; static void *g_autofill_service_auth_info_request_data = NULL; -static autofill_service_commited_cb g_autofill_service_commited_cb = NULL; +static autofill_service_committed_cb g_autofill_service_committed_cb = NULL; static void *g_autofill_service_commit_data = NULL; static autofill_service_terminate_received_cb g_autofill_service_terminate_received_cb = NULL; @@ -275,8 +275,8 @@ static void __autofill_commit_cb(rpc_port_stub_AutofillSvcPort_context_h context rpc_port_autofill_svc_save_view_info_foreach_items(vi, __save_item_cb, view_info); - if (g_autofill_service_commited_cb) - g_autofill_service_commited_cb(context_id, view_info, g_autofill_service_commit_data); + if (g_autofill_service_committed_cb) + g_autofill_service_committed_cb(context_id, view_info, g_autofill_service_commit_data); autofill_save_view_info_destroy(view_info); @@ -686,14 +686,19 @@ EXPORT_API int autofill_service_send_fill_response(int context_id, autofill_fill return ret; } -EXPORT_API int autofill_service_set_commited_cb(autofill_service_commited_cb callback, void *user_data) +EXPORT_API int autofill_service_set_commited_cb(autofill_service_committed_cb callback, void *user_data) +{ + return autofill_service_set_committed_cb(callback, user_data); +} + +EXPORT_API int autofill_service_set_committed_cb(autofill_service_committed_cb callback, void *user_data) { if (!callback) { LOGW("[ERROR] Invalid parameter"); return AUTOFILL_ERROR_INVALID_PARAMETER; } - g_autofill_service_commited_cb = callback; + g_autofill_service_committed_cb = callback; g_autofill_service_commit_data = user_data; return AUTOFILL_ERROR_NONE; @@ -701,7 +706,12 @@ EXPORT_API int autofill_service_set_commited_cb(autofill_service_commited_cb cal EXPORT_API int autofill_service_unset_commited_cb(void) { - g_autofill_service_commited_cb = NULL; + return autofill_service_unset_committed_cb(); +} + +EXPORT_API int autofill_service_unset_committed_cb(void) +{ + g_autofill_service_committed_cb = NULL; g_autofill_service_commit_data = NULL; return AUTOFILL_ERROR_NONE;