Add new API for fixing typo in API 44/214344/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Fri, 20 Sep 2019 11:12:41 +0000 (20:12 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Fri, 20 Sep 2019 11:12:56 +0000 (20:12 +0900)
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 <jihoon48.kim@samsung.com>
include/autofill_service.h
service_lib/autofill_service.c

index d423df8..ca5f3bd 100644 (file)
@@ -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
index b867902..a9520b1 100644 (file)
@@ -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;