Add view id in auth info 93/191593/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Fri, 19 Oct 2018 02:14:38 +0000 (11:14 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Fri, 19 Oct 2018 02:14:38 +0000 (11:14 +0900)
Change-Id: Iba9b55021bfee4fba3c932b9978b8329a2a63ed0
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
client/autofill.c
common/autofill_auth_info.c
include/autofill_common.h
server/main.c
service/service_main.c
service_lib/autofill_service.c
tidl/autofill.tidl
tidl/autofill_service.tidl

index d166c69..7ddefa4 100644 (file)
@@ -128,10 +128,12 @@ static void __auth_info_recv_cb(void *user_data, rpc_port_autofill_auth_info_h a
 
     bool exist_autofill_data;
     bool need_authentication;
+    char *view_id = NULL;
     char *service_name = NULL;
     char *service_logo_image_path = NULL;
     char *service_message = NULL;
 
+    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, &exist_autofill_data);
     rpc_port_autofill_auth_info_get_need_authentication(auth_info_h, &need_authentication);
     rpc_port_autofill_auth_info_get_service_name(auth_info_h, &service_name);
@@ -140,12 +142,16 @@ static void __auth_info_recv_cb(void *user_data, rpc_port_autofill_auth_info_h a
 
     LOGD("service name : %s", service_name);
 
+    autofill_auth_info_set_view_id(ah, view_id);
     autofill_auth_info_set_exist_autofill_data(ah, exist_autofill_data);
     autofill_auth_info_set_need_authentication(ah, need_authentication);
     autofill_auth_info_set_service_name(ah, service_name);
     autofill_auth_info_set_service_logo_image_path(ah, service_logo_image_path);
     autofill_auth_info_set_service_message(ah, service_message);
 
+    if (view_id)
+        free(view_id);
+
     if (service_name)
         free(service_name);
 
index 9f60532..74cf38a 100644 (file)
@@ -30,6 +30,7 @@
 
 struct autofill_auth_info_s {
     char *app_id;
+    char *view_id;
     bool exist_autofill_data; // autofill data 보유 여부
     bool need_authentication; // 인증 필요 여부
 
@@ -201,7 +202,36 @@ EXPORT_API int autofill_auth_info_get_app_id(autofill_auth_info_h vi, char **app
     if (!vi)
         return AUTOFILL_ERROR_INVALID_PARAMETER;
 
+    if (!vi->app_id)
+        return AUTOFILL_ERROR_OPERATION_FAILED;
+
     *app_id = strdup(vi->app_id);
 
     return AUTOFILL_ERROR_NONE;
 }
+
+EXPORT_API int autofill_auth_info_set_view_id(autofill_auth_info_h vi, const char *view_id)
+{
+    if (!vi || !view_id)
+        return AUTOFILL_ERROR_INVALID_PARAMETER;
+
+    if (vi->view_id)
+        free(vi->view_id);
+
+    vi->view_id = strdup(view_id);
+
+    return AUTOFILL_ERROR_NONE;
+}
+
+EXPORT_API int autofill_auth_info_get_view_id(autofill_auth_info_h vi, char **view_id)
+{
+    if (!vi)
+        return AUTOFILL_ERROR_INVALID_PARAMETER;
+
+    if (!vi->view_id)
+        return AUTOFILL_ERROR_OPERATION_FAILED;
+
+    *view_id = strdup(vi->view_id);
+
+    return AUTOFILL_ERROR_NONE;
+}
index b69a5bf..a8ffd29 100644 (file)
@@ -267,6 +267,30 @@ int autofill_auth_info_set_app_id(autofill_auth_info_h vi, const char *app_id);
 int autofill_auth_info_get_app_id(autofill_auth_info_h vi, char **app_id);
 
 /**
+ * @brief Set view id
+ *
+ * @since_tizen 5.5
+ *
+ * @privlevel public
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #AUTOFILL_ERROR_NONE No error
+ */
+int autofill_auth_info_set_view_id(autofill_auth_info_h vi, const char *view_id);
+
+/**
+ * @brief Get view id
+ *
+ * @since_tizen 5.5
+ *
+ * @privlevel public
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #AUTOFILL_ERROR_NONE No error
+ */
+int autofill_auth_info_get_view_id(autofill_auth_info_h vi, char **view_id);
+
+/**
  * @brief Set exist autofill data
  *
  * @since_tizen 5.5
index c1b5df1..5002159 100644 (file)
@@ -496,8 +496,10 @@ static void __auth_info_recv_cb(void *user_data, rpc_port_autofill_svc_auth_info
     char *service_logo_image_path = NULL;
     char *service_message = NULL;
     char *app_id = NULL;
+    char *view_id = NULL;
 
     rpc_port_autofill_svc_auth_info_get_app_id(svc_auth_info_h, &app_id);
+    rpc_port_autofill_svc_auth_info_get_view_id(svc_auth_info_h, &view_id);
     rpc_port_autofill_svc_auth_info_get_exist_autofill_data(svc_auth_info_h, &exist_autofill_data);
     rpc_port_autofill_svc_auth_info_get_need_authentication(svc_auth_info_h, &need_authentication);
     rpc_port_autofill_svc_auth_info_get_service_name(svc_auth_info_h, &service_name);
@@ -509,6 +511,7 @@ static void __auth_info_recv_cb(void *user_data, rpc_port_autofill_svc_auth_info
     /* transfer auth info */
     rpc_port_autofill_auth_info_h auth_info_h;
     rpc_port_autofill_auth_info_create(&auth_info_h);
+    rpc_port_autofill_auth_info_set_view_id(auth_info_h, view_id);
     rpc_port_autofill_auth_info_set_exist_autofill_data(auth_info_h, exist_autofill_data);
     rpc_port_autofill_auth_info_set_need_authentication(auth_info_h, need_authentication);
     rpc_port_autofill_auth_info_set_service_name(auth_info_h, service_name);
@@ -524,6 +527,9 @@ static void __auth_info_recv_cb(void *user_data, rpc_port_autofill_svc_auth_info
     if (app_id)
         free(app_id);
 
+    if (view_id)
+        free(view_id);
+
     if (service_name)
         free(service_name);
 
index 5ce3a55..471d4d4 100644 (file)
@@ -109,16 +109,11 @@ static void _auth_info_request_cb(autofill_view_info_h vi_h, void *user_data)
 
     autofill_view_info_foreach_items(vi_h, __view_info_item_cb, NULL);
 
-    if (view_id)
-        free(view_id);
-
     LOGD("send auth info");
     autofill_auth_info_h auth_info;
     autofill_auth_info_create(&auth_info);
     autofill_auth_info_set_app_id(auth_info, app_id);
-
-    if (app_id)
-        free(app_id);
+    autofill_auth_info_set_view_id(auth_info, view_id);
 
     autofill_auth_info_set_exist_autofill_data(auth_info, true);
     autofill_auth_info_set_need_authentication(auth_info, false);
@@ -129,6 +124,12 @@ static void _auth_info_request_cb(autofill_view_info_h vi_h, void *user_data)
     LOGD("send auth info");
     autofill_service_send_auth_info(auth_info);
 
+    if (app_id)
+        free(app_id);
+
+    if (view_id)
+        free(view_id);
+
     autofill_auth_info_destroy(auth_info);
 }
 
index c935264..7d41a96 100644 (file)
@@ -422,6 +422,7 @@ EXPORT_API int autofill_service_send_auth_info(autofill_auth_info_h h)
     bool exist_autofill_data;
     bool need_authentication;
     char *app_id = NULL;
+    char *view_id = NULL;
     char *service_name = NULL;
     char *service_logo_image_path = NULL;
     char *service_message = NULL;
@@ -432,6 +433,7 @@ EXPORT_API int autofill_service_send_auth_info(autofill_auth_info_h h)
     }
 
     autofill_auth_info_get_app_id(h, &app_id);
+    autofill_auth_info_get_view_id(h, &view_id);
     autofill_auth_info_get_exist_autofill_data(h, &exist_autofill_data);
     autofill_auth_info_get_need_authentication(h, &need_authentication);
     autofill_auth_info_get_service_name(h, &service_name);
@@ -444,6 +446,7 @@ EXPORT_API int autofill_service_send_auth_info(autofill_auth_info_h h)
     rpc_port_autofill_svc_auth_info_h auth_info_h;
     rpc_port_autofill_svc_auth_info_create(&auth_info_h);
     rpc_port_autofill_svc_auth_info_set_app_id(auth_info_h, app_id);
+    rpc_port_autofill_svc_auth_info_set_view_id(auth_info_h, view_id);
     rpc_port_autofill_svc_auth_info_set_exist_autofill_data(auth_info_h, exist_autofill_data);
     rpc_port_autofill_svc_auth_info_set_need_authentication(auth_info_h, need_authentication);
     rpc_port_autofill_svc_auth_info_set_service_name(auth_info_h, service_name);
@@ -455,6 +458,9 @@ EXPORT_API int autofill_service_send_auth_info(autofill_auth_info_h h)
     if (app_id)
         free(app_id);
 
+    if (view_id)
+        free(view_id);
+
     if (service_name)
         free(service_name);
 
index a571ba9..201802a 100644 (file)
@@ -25,6 +25,7 @@ struct autofill_save_view_info {
 }
 
 struct autofill_auth_info {
+    string view_id;
     bool exist_autofill_data;
     bool need_authentication;
 
index 2395354..7b3bd5e 100644 (file)
@@ -27,6 +27,7 @@ struct autofill_svc_save_view_info {
 
 struct autofill_svc_auth_info {
     string app_id;
+    string view_id;
     bool exist_autofill_data;
     bool need_authentication;