From 2bea274dea97cff9cf0a07787147b9f54fb88247 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 3 Jul 2019 16:10:38 +0900 Subject: [PATCH 01/16] Change log level Change-Id: I8c92125befbe304089af06c244197606823cbb01 Signed-off-by: Jihoon Kim --- client/autofill.c | 6 +++--- manager/autofill_manager.c | 14 +++++++------- service_lib/autofill_service.c | 12 ++++++------ 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/client/autofill.c b/client/autofill.c index c53c86e..17edcdd 100644 --- a/client/autofill.c +++ b/client/autofill.c @@ -49,7 +49,7 @@ static bool fill_response_item_cb(rpc_port_autofill_response_item_h response_ite rpc_port_autofill_response_item_get_presentation_text(response_items, &presentation_text); rpc_port_autofill_response_item_get_value(response_items, &value); - LOGD("id : %s, presentation text : %s, value : %s", id, presentation_text, value); + SECURE_LOGD("id : %s, presentation text : %s, value : %s", id, presentation_text, value); autofill_fill_response_item_h ritem; @@ -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) { - LOGI("rejected"); + LOGW("Connection rejected"); autofill_h ah = user_data; @@ -316,7 +316,7 @@ EXPORT_API int autofill_destroy(autofill_h ah) EXPORT_API int autofill_connect(autofill_h ah, autofill_connection_status_changed_cb callback, void *user_data) { - LOGD("autofill connect. handle : %p", ah); + LOGI("autofill connect. handle : %p", ah); int ret; diff --git a/manager/autofill_manager.c b/manager/autofill_manager.c index 4998d0e..9baadc8 100644 --- a/manager/autofill_manager.c +++ b/manager/autofill_manager.c @@ -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; - LOGI("rejected"); + LOGW("rejected"); if (amh->connection_callback) amh->connection_callback(amh, AUTOFILL_MANAGER_CONNECTION_STATUS_REJECTED, amh->connection_userdata); @@ -72,7 +72,7 @@ EXPORT_API int autofill_manager_create(autofill_manager_h *amh) { int ret; - LOGD("autofill manager initialize"); + LOGI("autofill manager initialize"); if (!amh) { LOGW("[ERROR] Invalid paramater"); @@ -111,7 +111,7 @@ EXPORT_API int autofill_manager_create(autofill_manager_h *amh) EXPORT_API int autofill_manager_destroy(autofill_manager_h amh) { - LOGD("autofill manager deinitialize"); + LOGI("autofill manager deinitialize"); if (!amh) { LOGW("[ERROR] Invalid paramater"); @@ -140,7 +140,7 @@ EXPORT_API int autofill_manager_destroy(autofill_manager_h amh) EXPORT_API int autofill_manager_connect(autofill_manager_h amh, autofill_manager_connection_status_changed_cb callback, void *user_data) { - LOGD("autofill manager connect"); + LOGI("autofill manager connect"); int ret; @@ -179,7 +179,7 @@ EXPORT_API int autofill_manager_connect(autofill_manager_h amh, autofill_manager EXPORT_API int autofill_manager_set_autofill_service(autofill_manager_h amh, const char *app_id) { - LOGD("autofill manager set autofill service"); + LOGI("autofill manager set autofill service. app id : %s", app_id); if (!amh || !app_id) { LOGW("[ERROR] parameter is NULL"); @@ -206,7 +206,7 @@ EXPORT_API int autofill_manager_set_autofill_service(autofill_manager_h amh, con EXPORT_API int autofill_manager_get_autofill_service(autofill_manager_h amh, char **service_app_id) { - LOGD("autofill manager get autofill service"); + LOGI("autofill manager get autofill service"); if (!amh || !service_app_id) { LOGW("[ERROR] parameter is NULL"); @@ -225,7 +225,7 @@ EXPORT_API int autofill_manager_get_autofill_service(autofill_manager_h amh, cha char *app_id = rpc_port_proxy_AutofillManagerPort_invoke_get_autofill_service(amh->rpc_h); if (app_id) { - LOGD("service id : %s", app_id); + LOGI("service id : %s", app_id); *service_app_id = strdup(app_id); free(app_id); return AUTOFILL_ERROR_NONE; diff --git a/service_lib/autofill_service.c b/service_lib/autofill_service.c index ebca4b5..3ddaf7c 100644 --- a/service_lib/autofill_service.c +++ b/service_lib/autofill_service.c @@ -91,7 +91,7 @@ bool __autofill_item_cb(rpc_port_autofill_svc_item_h items, void *user_data) rpc_port_autofill_svc_item_get_value(items, &value); autofill_item_set_value(ai, value); if (value) { - LOGD("value : %s", value); + SECURE_LOGD("value : %s", value); free(value); } @@ -140,7 +140,7 @@ bool __save_item_cb(rpc_port_autofill_svc_save_item_h items, void *user_data) rpc_port_autofill_svc_save_item_get_value(items, &value); autofill_save_item_set_value(ai, value); if (value) { - LOGD("value : %s", value); + SECURE_LOGD("value : %s", value); free(value); } @@ -263,7 +263,7 @@ static void __autofill_commit_cb(rpc_port_stub_AutofillSvcPort_context_h context static void __terminate_received_cb(rpc_port_stub_AutofillSvcPort_context_h context, void *user_data) { - LOGD(""); + LOGI("Receive terminate request"); if (g_autofill_service_terminate_received_cb) g_autofill_service_terminate_received_cb(g_autofill_service_terminate_received_data); @@ -402,7 +402,7 @@ static void __message_unregister(rpc_port_stub_AutofillSvcPort_context_h context EXPORT_API int autofill_service_initialize(void) { - LOGD("autofill service initialize"); + LOGI("autofill service initialize"); int ret; @@ -428,7 +428,7 @@ EXPORT_API int autofill_service_initialize(void) EXPORT_API int autofill_service_deinitialize(void) { - LOGD("autofill service deinitialize"); + LOGI("autofill service deinitialize"); if (__client_list) { g_list_free_full(__client_list, __destroy_client); @@ -556,7 +556,7 @@ bool __fill_response_item_cb(autofill_fill_response_item_h it, void * user_data) autofill_fill_response_item_get_value(it, &value); autofill_fill_response_item_get_presentation_text(it, &presentation_text); - LOGD("it : %p, id : %s, value : %s, presentation text : %s", it, id, value, presentation_text); + SECURE_LOGD("it : %p, id : %s, value : %s, presentation text : %s", it, id, value, presentation_text); rpc_port_autofill_svc_response_item_create(&ritem_h); rpc_port_autofill_svc_response_item_set_id(ritem_h, id); -- 2.7.4 From d686b81ede113826ad42ea29240820877307dd14 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 5 Jul 2019 14:02:48 +0900 Subject: [PATCH 02/16] Make a gcov package Change-Id: I6c64bc5f95aa26548c28b5ad4e53d3e5698df67a Signed-off-by: Jihoon Kim --- packaging/capi-ui-autofill.spec | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/packaging/capi-ui-autofill.spec b/packaging/capi-ui-autofill.spec index c87118c..ff3b174 100644 --- a/packaging/capi-ui-autofill.spec +++ b/packaging/capi-ui-autofill.spec @@ -35,6 +35,14 @@ Requires: %{name} = %{version}-%{release} %description devel Autofill Library (Development) +%if 0%{?gcov:1} +%package gcov +Summary: Autofill Library (gcov) +Group: Graphics & UI Framework/Input +%description gcov +Autofill gcov objects +%endif + %package -n capi-ui-autofill-common Summary: Autofill Common Library Group: Graphics & UI Framework/Input @@ -105,6 +113,12 @@ mv autofill_manager_proxy.c ./manager/ %build +%if 0%{?gcov:1} +export CFLAGS+=" -fprofile-arcs -ftest-coverage" +export CXXFLAGS+=" -fprofile-arcs -ftest-coverage" +export FFLAGS+=" -fprofile-arcs -ftest-coverage" +export LDFLAGS+=" -lgcov" +%endif export CFLAGS+=" -DTIZEN_DEBUG_ENABLE -fvisibility=hidden -Werror" export CXXFLAGS+=" -DTIZEN_DEBUG_ENABLE -fvisibility=hidden -Werror" @@ -116,10 +130,20 @@ MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` %cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} make %{?jobs:-j%jobs} +%if 0%{?gcov:1} +mkdir -p gcov-obj +find . -name '*.gcno' -exec cp '{}' gcov-obj ';' +%endif + %install rm -rf %{buildroot} %make_install +%if 0%{?gcov:1} +mkdir -p %{buildroot}%{_datadir}/gcov/obj +install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj +%endif + %post /sbin/ldconfig @@ -167,3 +191,8 @@ rm -rf %{buildroot} %{_includedir}/autofill_manager*.h %{_libdir}/pkgconfig/capi-ui-autofill-manager.pc %{_libdir}/libcapi-ui-autofill-manager.so + +%if 0%{?gcov:1} +%files gcov +%{_datadir}/gcov/obj/* +%endif -- 2.7.4 From 6cfd809f417633f19b6d17972f440b72f4f1d9ff Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 5 Jul 2019 14:05:13 +0900 Subject: [PATCH 03/16] Update package version to 0.1.29 Change-Id: I8c1620cf901a8e606f4c142878156e31225f4696 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 ff3b174..22fc449 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.28 +Version: 0.1.29 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From 264e689e75c5e1917d3c70f065f2975c8c8e8b02 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 9 Jul 2019 16:01:31 +0900 Subject: [PATCH 04/16] Add APIs to set and get autofill hint in fill response item Change-Id: Ic4420969b9a966d4cc0096311a9f931ddce6cf68 Signed-off-by: Jihoon Kim --- client/autofill.c | 5 ++++- common/autofill_fill_response_item.c | 23 +++++++++++++++++++++++ include/autofill_common.h | 23 +++++++++++++++++++++++ service_lib/autofill_service.c | 5 ++++- tidl/autofill.tidl | 1 + tidl/autofill_service.tidl | 1 + 6 files changed, 56 insertions(+), 2 deletions(-) diff --git a/client/autofill.c b/client/autofill.c index 17edcdd..f78b1be 100644 --- a/client/autofill.c +++ b/client/autofill.c @@ -40,6 +40,7 @@ static bool fill_response_item_cb(rpc_port_autofill_response_item_h response_ite char *id = NULL; char *presentation_text = NULL; char *value = NULL; + int autofill_hint; autofill_fill_response_group_h res_group = (autofill_fill_response_group_h)user_data; if (!res_group) @@ -48,8 +49,9 @@ static bool fill_response_item_cb(rpc_port_autofill_response_item_h response_ite rpc_port_autofill_response_item_get_id(response_items, &id); rpc_port_autofill_response_item_get_presentation_text(response_items, &presentation_text); rpc_port_autofill_response_item_get_value(response_items, &value); + rpc_port_autofill_response_item_get_autofill_hint(response_items, &autofill_hint); - SECURE_LOGD("id : %s, presentation text : %s, value : %s", id, presentation_text, value); + SECURE_LOGD("id : %s, presentation text : %s, value : %s, autofill hint : %d", id, presentation_text, value, autofill_hint); autofill_fill_response_item_h ritem; @@ -57,6 +59,7 @@ static bool fill_response_item_cb(rpc_port_autofill_response_item_h response_ite autofill_fill_response_item_set_id(ritem, id); autofill_fill_response_item_set_presentation_text(ritem, presentation_text); autofill_fill_response_item_set_value(ritem, value); + autofill_fill_response_item_set_autofill_hint(ritem, autofill_hint); autofill_fill_response_group_add_item(res_group, ritem); diff --git a/common/autofill_fill_response_item.c b/common/autofill_fill_response_item.c index ef60672..f7595a3 100644 --- a/common/autofill_fill_response_item.c +++ b/common/autofill_fill_response_item.c @@ -31,6 +31,7 @@ struct autofill_response_item_s { char *id; char *presentation_text; char *value; + autofill_hint_e autofill_hint; }; EXPORT_API int autofill_fill_response_item_create(autofill_fill_response_item_h *it) @@ -118,6 +119,8 @@ EXPORT_API int autofill_fill_response_item_clone(autofill_fill_response_item_h i } } + handle->autofill_hint = it->autofill_hint; + *clone = handle; return AUTOFILL_ERROR_NONE; @@ -203,3 +206,23 @@ EXPORT_API int autofill_fill_response_item_get_presentation_text(autofill_fill_r return AUTOFILL_ERROR_NONE; } + +EXPORT_API int autofill_fill_response_item_set_autofill_hint(autofill_fill_response_item_h it, autofill_hint_e hint) +{ + if (!it) + return AUTOFILL_ERROR_INVALID_PARAMETER; + + it->autofill_hint = hint; + + return AUTOFILL_ERROR_NONE; +} + +EXPORT_API int autofill_fill_response_item_get_autofill_hint(autofill_fill_response_item_h it, autofill_hint_e *hint) +{ + if (!it || !hint) + return AUTOFILL_ERROR_INVALID_PARAMETER; + + *hint = it->autofill_hint; + + return AUTOFILL_ERROR_NONE; +} diff --git a/include/autofill_common.h b/include/autofill_common.h index 1ce7fca..26e7d17 100644 --- a/include/autofill_common.h +++ b/include/autofill_common.h @@ -980,6 +980,29 @@ int autofill_fill_response_item_set_presentation_text(autofill_fill_response_ite int autofill_fill_response_item_get_presentation_text(autofill_fill_response_item_h it, char **presentation_text); /** + * @brief Sets the autofill hint in an autofill fill response item. + * @since_tizen 5.5 + * @param[in] it The autofill fill response item handle + * @param[in] hint The autofill hint + * @return 0 on success, otherwise a negative error value + * @retval #AUTOFILL_ERROR_NONE No error + * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter + */ +int autofill_fill_response_item_set_autofill_hint(autofill_fill_response_item_h it, autofill_hint_e hint); + +/** + * @brief Gets the autofill hint from an autofill fill response item. + * @since_tizen 5.5 + * @param[in] it The autofill fill response item handle + * @param[out] hint The autofill hint + * @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_fill_response_item_get_autofill_hint(autofill_fill_response_item_h it, autofill_hint_e *hint); + +/** * @brief Creates autofill save item. * @since_tizen 5.5 * @remarks If the function succeeds, @a it handle must be released with autofill_save_item_destroy(). diff --git a/service_lib/autofill_service.c b/service_lib/autofill_service.c index 3ddaf7c..2ee461c 100644 --- a/service_lib/autofill_service.c +++ b/service_lib/autofill_service.c @@ -547,6 +547,7 @@ bool __fill_response_item_cb(autofill_fill_response_item_h it, void * user_data) char *id = NULL; char *value = NULL; char *presentation_text = NULL; + autofill_hint_e autofill_hint; rpc_port_autofill_svc_response_group_h res_group_h = (rpc_port_autofill_svc_response_group_h)user_data; @@ -555,13 +556,15 @@ bool __fill_response_item_cb(autofill_fill_response_item_h it, void * user_data) autofill_fill_response_item_get_id(it, &id); autofill_fill_response_item_get_value(it, &value); autofill_fill_response_item_get_presentation_text(it, &presentation_text); + autofill_fill_response_item_get_autofill_hint(it, &autofill_hint); - SECURE_LOGD("it : %p, id : %s, value : %s, presentation text : %s", it, id, value, presentation_text); + SECURE_LOGD("it : %p, id : %s, value : %s, presentation text : %s, autofill hint : %d", it, id, value, presentation_text, autofill_hint); rpc_port_autofill_svc_response_item_create(&ritem_h); rpc_port_autofill_svc_response_item_set_id(ritem_h, id); rpc_port_autofill_svc_response_item_set_presentation_text(ritem_h, presentation_text); rpc_port_autofill_svc_response_item_set_value(ritem_h, value); + rpc_port_autofill_svc_response_item_set_autofill_hint(ritem_h, autofill_hint); rpc_port_autofill_svc_response_group_add_response_items(res_group_h, ritem_h); diff --git a/tidl/autofill.tidl b/tidl/autofill.tidl index bfac23d..803697e 100644 --- a/tidl/autofill.tidl +++ b/tidl/autofill.tidl @@ -40,6 +40,7 @@ struct autofill_response_item { string id; string presentation_text; string value; + int autofill_hint; } struct autofill_response_group { diff --git a/tidl/autofill_service.tidl b/tidl/autofill_service.tidl index ffe3dc1..06d1aa3 100644 --- a/tidl/autofill_service.tidl +++ b/tidl/autofill_service.tidl @@ -42,6 +42,7 @@ struct autofill_svc_response_item { string id; string presentation_text; string value; + int autofill_hint; } struct autofill_svc_response_group { -- 2.7.4 From 5b387520d90817f23425c404a86413f632ea47b8 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 10 Jul 2019 19:10:35 +0900 Subject: [PATCH 05/16] Update package version to 0.1.30 Change-Id: I15f0cb01e43a731979cc828aafa87e519a8cca5b 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 22fc449..1a778e5 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.29 +Version: 0.1.30 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From aa84a73ba33a363a94cad7a45cbb5dd914222f27 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 11 Jul 2019 11:46:30 +0900 Subject: [PATCH 06/16] Fix crash issue in case ID or label is not given in fill request Change-Id: I5899f6abe67b2cedb36a0abc903c6cc0b981b4c6 Signed-off-by: Jihoon Kim --- client/autofill_fill_request.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/autofill_fill_request.c b/client/autofill_fill_request.c index 8c8b091..2c034ae 100644 --- a/client/autofill_fill_request.c +++ b/client/autofill_fill_request.c @@ -33,8 +33,8 @@ EXPORT_API int autofill_fill_request(autofill_h ah, autofill_view_info_h vi) { int ret = AUTOFILL_ERROR_NONE; rpc_port_autofill_view_info_h vih; - char *id; - char *label; + char *id = NULL; + char *label = NULL; autofill_hint_e autofill_hint; bool sensitive_data; -- 2.7.4 From ef55c0e2356abf188ba9b631154f328164ea9af6 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 11 Jul 2019 11:46:56 +0900 Subject: [PATCH 07/16] Update package version to 0.1.31 Change-Id: I068814acd7f4df4ba208cb761eff5183d7fb72db 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 1a778e5..7abeec4 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.30 +Version: 0.1.31 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From de548a9ad5ed440cbb3e6e425fc38f7822d8c825 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 17 Jul 2019 15:02:25 +0900 Subject: [PATCH 08/16] Remove unused return value in autofill manager doxygen Change-Id: I34d6d30b83016d3a76a48a76959e52767e63284b Signed-off-by: Jihoon Kim --- include/autofill_manager.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/include/autofill_manager.h b/include/autofill_manager.h index 2850cc2..57a41d7 100644 --- a/include/autofill_manager.h +++ b/include/autofill_manager.h @@ -102,7 +102,6 @@ int autofill_manager_create(autofill_manager_h *amh); * @retval #AUTOFILL_ERROR_NONE No error * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter * @retval #AUTOFILL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function - * @retval #AUTOFILL_ERROR_NOT_INITIALIZED Not initialized * @see autofill_manager_create() */ int autofill_manager_destroy(autofill_manager_h amh); @@ -120,7 +119,6 @@ int autofill_manager_destroy(autofill_manager_h amh); * @retval #AUTOFILL_ERROR_NONE No error * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter * @retval #AUTOFILL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function - * @retval #AUTOFILL_ERROR_NOT_INITIALIZED Not initialized * @retval #AUTOFILL_ERROR_OPERATION_FAILED Operation failure */ int autofill_manager_connect(autofill_manager_h amh, autofill_manager_connection_status_changed_cb callback, void *user_data); @@ -137,7 +135,6 @@ int autofill_manager_connect(autofill_manager_h amh, autofill_manager_connection * @retval #AUTOFILL_ERROR_NONE No error * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter * @retval #AUTOFILL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function - * @retval #AUTOFILL_ERROR_NOT_INITIALIZED Not initialized * @see autofill_manager_get_autofill_service() */ int autofill_manager_set_autofill_service(autofill_manager_h amh, const char *app_id); @@ -155,7 +152,6 @@ int autofill_manager_set_autofill_service(autofill_manager_h amh, const char *ap * @retval #AUTOFILL_ERROR_NONE No error * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter * @retval #AUTOFILL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function - * @retval #AUTOFILL_ERROR_NOT_INITIALIZED Not initialized * @see autofill_manager_set_autofill_service() */ int autofill_manager_get_autofill_service(autofill_manager_h amh, char **service_app_id); @@ -173,7 +169,6 @@ int autofill_manager_get_autofill_service(autofill_manager_h amh, char **service * @retval #AUTOFILL_ERROR_NONE No error * @retval #AUTOFILL_ERROR_PERMISSION_DENIED The application does not have the privilege to call this function * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #AUTOFILL_ERROR_NOT_INITIALIZED Not initialized * @retval #AUTOFILL_ERROR_OPERATION_FAILED Operation failure */ int autofill_manager_foreach_autofill_service(autofill_manager_h amh, autofill_manager_autofill_service_cb callback, void* user_data); -- 2.7.4 From 65e1fa600b7d17787fc2ca5e76f4538833242571 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 19 Jul 2019 15:34:34 +0900 Subject: [PATCH 09/16] Check the existence of save items before requesting to save Change-Id: Idc4dd09273bb7fe626eb9f4a7bf50462c7052988 Signed-off-by: Jihoon Kim --- client/autofill.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/autofill.c b/client/autofill.c index f78b1be..4a744f0 100644 --- a/client/autofill.c +++ b/client/autofill.c @@ -369,6 +369,7 @@ EXPORT_API int autofill_commit(autofill_h ah, autofill_save_view_info_h vi) char *value = NULL; autofill_hint_e autofill_hint; bool sensitive_data; + unsigned int save_item_count = 0; if (!ah || !vi) { LOGW("[ERROR] Invalid parameter"); @@ -384,6 +385,13 @@ EXPORT_API int autofill_commit(autofill_h ah, autofill_save_view_info_h vi) return AUTOFILL_ERROR_OPERATION_FAILED; } + save_item_count = eina_list_count(vi->autofill_save_item_list); + + if (save_item_count == 0) { + LOGE("[ERROR] No save item in save view. Please check whether adding save item by calling autofill_save_view_info_add_item() or not"); + 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); rpc_port_autofill_save_view_info_set_view_title(vih, vi->view_title); -- 2.7.4 From 800781899c20a784d02afed3c62a6de2f5178210 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 19 Jul 2019 15:35:02 +0900 Subject: [PATCH 10/16] Update package version to 0.1.32 Change-Id: I357377cef9c166c71691381a548891d7a06058bc 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 7abeec4..de1eaa6 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.31 +Version: 0.1.32 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From 4d79316e9e3b10c6a329d195ad593fb0cc9c0aa6 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 22 Jul 2019 16:35:57 +0900 Subject: [PATCH 11/16] Fix wrong return value in autofill_item_clone() Change-Id: I07c18117760d710562d7a0e9220863a4eaec2c74 Signed-off-by: Jihoon Kim --- common/autofill_item.c | 2 +- include/autofill_common.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/common/autofill_item.c b/common/autofill_item.c index f90b9cc..8d157af 100644 --- a/common/autofill_item.c +++ b/common/autofill_item.c @@ -88,7 +88,7 @@ EXPORT_API int autofill_item_clone(autofill_item_h h, autofill_item_h *clone) autofill_item_create(&handle); if (!handle) { LOGW("[ERROR] Failed to create autofill_item handle"); - return AUTOFILL_ERROR_OPERATION_FAILED; + return AUTOFILL_ERROR_OUT_OF_MEMORY; } if (h->id) { diff --git a/include/autofill_common.h b/include/autofill_common.h index 26e7d17..4d0cae2 100644 --- a/include/autofill_common.h +++ b/include/autofill_common.h @@ -193,6 +193,7 @@ int autofill_item_destroy(autofill_item_h it); * @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_item_clone(autofill_item_h it, autofill_item_h *clone); -- 2.7.4 From 7d0a0ee9bb0b372788ad4d056d6af00419d733ee Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 26 Jul 2019 14:17:03 +0900 Subject: [PATCH 12/16] Update package version to 0.1.33 Change-Id: I8909791dc601404dc14847bd5dd37ba9a4671d44 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 de1eaa6..0701e8d 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.32 +Version: 0.1.33 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From 3815900c82990d908f0e7f11de70286abcfe80f4 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 11 Sep 2019 15:53:28 +0900 Subject: [PATCH 13/16] Fix wrong reference API in doxygen Change-Id: Ie8606735e5e87f224d6a9b78e1957229b29ebba2 Signed-off-by: Jihoon Kim --- include/autofill_service.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/autofill_service.h b/include/autofill_service.h index 8d7d36e..7ccb1fe 100644 --- a/include/autofill_service.h +++ b/include/autofill_service.h @@ -51,7 +51,7 @@ typedef void (*autofill_service_auth_info_requested_cb)(int context_id, autofill * @param[in] context_id The autofill context identification value of an associated autofill client handle * @param[in] vi The autofill view info handle * @param[in] user_data The user data passed from the callback function - * @see autofill_service_set_auth_info_requested_cb() + * @see autofill_service_set_fill_requested_cb() */ typedef void (*autofill_service_fill_requested_cb)(int context_id, autofill_view_info_h vi, void *user_data); -- 2.7.4 From bbc33faba1b161c95ae55c5ce8cd30b95c3f6dbe Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 11 Sep 2019 16:19:25 +0900 Subject: [PATCH 14/16] Fix wrong callback data when receiving fill request Change-Id: I419cd37df626d93419a63f4bf6d6901151821993 Signed-off-by: Jihoon Kim --- service_lib/autofill_service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service_lib/autofill_service.c b/service_lib/autofill_service.c index 2ee461c..7775916 100644 --- a/service_lib/autofill_service.c +++ b/service_lib/autofill_service.c @@ -212,7 +212,7 @@ static void __autofill_fill_request_cb(rpc_port_stub_AutofillSvcPort_context_h c rpc_port_autofill_svc_view_info_foreach_items(vi, __autofill_item_cb, view_info); if (g_autofill_service_fill_requested_cb) - g_autofill_service_fill_requested_cb(context_id, view_info, g_autofill_service_auth_info_request_data); + g_autofill_service_fill_requested_cb(context_id, view_info, g_autofill_service_fill_request_data); autofill_view_info_destroy(view_info); -- 2.7.4 From 5e98a74ec1af8303a12a2c7717f8cef7c38781e0 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 11 Sep 2019 18:42:25 +0900 Subject: [PATCH 15/16] Initialize callback functions Change-Id: Ife4eaddfc3b8dbcd8d70efe8d83194c74b77e8e5 Signed-off-by: Jihoon Kim --- service_lib/autofill_service.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/service_lib/autofill_service.c b/service_lib/autofill_service.c index 7775916..1ecad76 100644 --- a/service_lib/autofill_service.c +++ b/service_lib/autofill_service.c @@ -34,21 +34,21 @@ #endif #define LOG_TAG "AUTOFILL_SERVICE" -static autofill_service_fill_requested_cb g_autofill_service_fill_requested_cb; +static autofill_service_fill_requested_cb g_autofill_service_fill_requested_cb = NULL; static void *g_autofill_service_fill_request_data = NULL; -static autofill_service_auth_info_requested_cb g_autofill_service_auth_info_requested_cb; +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; +static autofill_service_commited_cb g_autofill_service_commited_cb = NULL; static void *g_autofill_service_commit_data = NULL; -static autofill_service_terminate_received_cb g_autofill_service_terminate_received_cb; +static autofill_service_terminate_received_cb g_autofill_service_terminate_received_cb = NULL; 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; +static rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h g_auth_info_cb = NULL; +static rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h g_fill_response_received_cb = NULL; +static rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_h g_send_error_cb = NULL; typedef struct { char *app_id; -- 2.7.4 From 74e71423434b4de3c424afed479a203a528903e1 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 11 Sep 2019 19:20:25 +0900 Subject: [PATCH 16/16] Add interfaces for canceling fill request Change-Id: I613017fbd0a5a0a7efb37ec59fade2d6a3559f6e Signed-off-by: Jihoon Kim --- client/autofill_fill_request.c | 75 +++++++++++++++++++++++++++++++++++++++++- include/autofill.h | 14 ++++++++ include/autofill_service.h | 30 +++++++++++++++++ service_lib/autofill_service.c | 57 +++++++++++++++++++++++++++++++- tidl/autofill.tidl | 1 + tidl/autofill_service.tidl | 1 + 6 files changed, 176 insertions(+), 2 deletions(-) diff --git a/client/autofill_fill_request.c b/client/autofill_fill_request.c index 2c034ae..1ae6954 100644 --- a/client/autofill_fill_request.c +++ b/client/autofill_fill_request.c @@ -102,6 +102,79 @@ EXPORT_API int autofill_fill_request(autofill_h ah, autofill_view_info_h vi) return AUTOFILL_ERROR_NONE; } +EXPORT_API int autofill_cancel_fill_request(autofill_h ah, autofill_view_info_h vi) +{ + int ret = AUTOFILL_ERROR_NONE; + rpc_port_autofill_view_info_h vih = NULL; + char *id = NULL; + char *label = NULL; + autofill_hint_e autofill_hint; + bool sensitive_data = false; + Eina_List *l = NULL; + autofill_item_h it = NULL; + + if (!ah || !vi) { + LOGW("[ERROR] Invalid parameter"); + return AUTOFILL_ERROR_INVALID_PARAMETER; + } + + if (!ah->rpc_h) { + return AUTOFILL_ERROR_OPERATION_FAILED; + } + + if (!ah->connected) { + LOGW("[ERROR] Not connected"); + return AUTOFILL_ERROR_OPERATION_FAILED; + } + + rpc_port_autofill_view_info_create(&vih); + rpc_port_autofill_view_info_set_view_id(vih, vi->view_id); + + EINA_LIST_FOREACH(vi->autofill_item_list, l, it) + { + autofill_item_get_id(it, &id); + autofill_item_get_label(it, &label); + autofill_item_get_autofill_hint(it, &autofill_hint); + autofill_item_get_sensitive_data(it, &sensitive_data); + + LOGD("it : %p, id : %s, label : %s, hint : %d, sensitive : %d", it, id, label, autofill_hint, sensitive_data); + + rpc_port_autofill_item_h aih; + rpc_port_autofill_item_create(&aih); + rpc_port_autofill_item_set_id(aih, id); + rpc_port_autofill_item_set_label(aih, label); + rpc_port_autofill_item_set_autofill_hint(aih, (int)autofill_hint); + rpc_port_autofill_item_set_is_sensitive_data(aih, sensitive_data); + + rpc_port_autofill_view_info_add_items(vih, aih); + + if (id) { + free(id); + id = NULL; + } + + if (label) { + free(label); + label = NULL; + } + + rpc_port_autofill_item_destroy(aih); + } + + LOGD("app id : %s, view id : %s, context id : %d", vi->app_id, vi->view_id, ah->context_id); + + ret = rpc_port_proxy_AutofillAppPort_invoke_cancel_fill_request(ah->rpc_h, ah->context_id, vih); + + rpc_port_autofill_view_info_destroy(vih); + + if (ret != RPC_PORT_ERROR_NONE) { + LOGW("[ERROR] Failed to cancel fill request. rpc err = %d", ret); + return AUTOFILL_ERROR_OPERATION_FAILED; + } + else + return AUTOFILL_ERROR_NONE; +} + EXPORT_API int autofill_fill_response_set_received_cb(autofill_h ah, autofill_fill_response_received_cb callback, void *user_data) { if (!ah || !callback) { @@ -126,4 +199,4 @@ EXPORT_API int autofill_fill_response_unset_received_cb(autofill_h ah) ah->autofill_fill_response_data = NULL; return AUTOFILL_ERROR_NONE; -} +} \ No newline at end of file diff --git a/include/autofill.h b/include/autofill.h index 0f6b920..eb8bba2 100644 --- a/include/autofill.h +++ b/include/autofill.h @@ -178,10 +178,24 @@ int autofill_auth_info_unset_received_cb(autofill_h ah); * @retval #AUTOFILL_ERROR_NONE No error * @retval #AUTOFILL_ERROR_INVALID_PARAMETER Invalid parameter * @retval #AUTOFILL_ERROR_OPERATION_FAILED Operation failure + * @see autofill_cancel_fill_request() */ int autofill_fill_request(autofill_h ah, autofill_view_info_h vi); /** + * @brief Cancels fill request to fill out each input form. + * @since_tizen 5.5 + * @param[in] ah The autofill handle + * @param[in] vi The autofill view info 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_OPERATION_FAILED Operation failure + * @see autofill_fill_request() + */ +int autofill_cancel_fill_request(autofill_h ah, autofill_view_info_h vi); + +/** * @brief Sets the callback to receive autofill fill response. * @since_tizen 5.5 * @param[in] ah The autofill handle diff --git a/include/autofill_service.h b/include/autofill_service.h index 7ccb1fe..d423df8 100644 --- a/include/autofill_service.h +++ b/include/autofill_service.h @@ -56,6 +56,17 @@ typedef void (*autofill_service_auth_info_requested_cb)(int context_id, autofill typedef void (*autofill_service_fill_requested_cb)(int context_id, autofill_view_info_h vi, void *user_data); /** + * @brief Called when receiving the cancellation of fill request. + * @since_tizen 5.5 + * @remarks @a vi should not be freed and can be used only in the callback. + * @param[in] context_id The autofill context identification value of an associated autofill client handle + * @param[in] vi The autofill view info handle + * @param[in] user_data The user data passed from the callback function + * @see autofill_service_set_cancel_fill_requested_cb() + */ +typedef void (*autofill_service_cancel_fill_requested_cb)(int context_id, autofill_view_info_h vi, void *user_data); + +/** * @brief Called when receiving commit request. * @since_tizen 5.5 * @remarks @a vi should not be freed and can be used only in the callback. @@ -140,6 +151,25 @@ int autofill_service_set_fill_requested_cb(autofill_service_fill_requested_cb ca int autofill_service_unset_fill_requested_cb(void); /** + * @brief Sets the callback to receive the cancellation of fill 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_cancel_fill_requested_cb(autofill_service_cancel_fill_requested_cb callback, void *user_data); + +/** + * @brief Unsets the callback to receive the cancellation of fill request. + * @since_tizen 5.5 + * @return 0 on success, otherwise a negative error value + * @retval #AUTOFILL_ERROR_NONE No error + */ +int autofill_service_unset_cancel_fill_requested_cb(void); + +/** * @brief Sends the fill response. * @since_tizen 5.5 * @param[in] context_id The autofill context identification value of an associated autofill client handle diff --git a/service_lib/autofill_service.c b/service_lib/autofill_service.c index 1ecad76..b867902 100644 --- a/service_lib/autofill_service.c +++ b/service_lib/autofill_service.c @@ -37,6 +37,9 @@ static autofill_service_fill_requested_cb g_autofill_service_fill_requested_cb = NULL; static void *g_autofill_service_fill_request_data = NULL; +static autofill_service_cancel_fill_requested_cb g_autofill_service_cancel_fill_requested_cb = NULL; +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; @@ -223,6 +226,35 @@ static void __autofill_fill_request_cb(rpc_port_stub_AutofillSvcPort_context_h c free(view_id); } +static void __autofill_cancel_fill_request_cb(rpc_port_stub_AutofillSvcPort_context_h context, int context_id, rpc_port_autofill_svc_view_info_h vi, void *user_data) +{ + char *app_id = NULL; + char *view_id = NULL; + + rpc_port_autofill_svc_view_info_get_app_id(vi, &app_id); + rpc_port_autofill_svc_view_info_get_view_id(vi, &view_id); + + LOGD("app id : %s, view id : %s", app_id, view_id); + + autofill_view_info_h view_info; + autofill_view_info_create(&view_info); + autofill_view_info_set_app_id(view_info, app_id); + autofill_view_info_set_view_id(view_info, view_id); + + rpc_port_autofill_svc_view_info_foreach_items(vi, __autofill_item_cb, view_info); + + if (g_autofill_service_cancel_fill_requested_cb) + g_autofill_service_cancel_fill_requested_cb(context_id, view_info, g_autofill_service_cancel_fill_request_data); + + autofill_view_info_destroy(view_info); + + if (app_id) + free(app_id); + + if (view_id) + free(view_id); +} + 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; @@ -414,7 +446,8 @@ EXPORT_API int autofill_service_initialize(void) __auth_info_request_cb, __autofill_fill_request_cb, __autofill_commit_cb, - __terminate_received_cb + __terminate_received_cb, + __autofill_cancel_fill_request_cb, }; ret = rpc_port_stub_AutofillSvcPort_register(&callback, NULL); @@ -542,6 +575,28 @@ EXPORT_API int autofill_service_unset_fill_requested_cb() return AUTOFILL_ERROR_NONE; } +// cancel fill request +EXPORT_API int autofill_service_set_cancel_fill_requested_cb(autofill_service_cancel_fill_requested_cb callback, void *user_data) +{ + if (!callback) { + LOGW("[ERROR] Invalid parameter"); + return AUTOFILL_ERROR_INVALID_PARAMETER; + } + + g_autofill_service_cancel_fill_requested_cb = callback; + g_autofill_service_cancel_fill_request_data = user_data; + + return AUTOFILL_ERROR_NONE; +} + +EXPORT_API int autofill_service_unset_cancel_fill_requested_cb() +{ + g_autofill_service_cancel_fill_requested_cb = NULL; + g_autofill_service_cancel_fill_request_data = NULL; + + return AUTOFILL_ERROR_NONE; +} + bool __fill_response_item_cb(autofill_fill_response_item_h it, void * user_data) { char *id = NULL; diff --git a/tidl/autofill.tidl b/tidl/autofill.tidl index 803697e..58020d4 100644 --- a/tidl/autofill.tidl +++ b/tidl/autofill.tidl @@ -68,4 +68,5 @@ interface AutofillAppPort { int request_auth_info(int context_id, autofill_view_info vi); int send_fill_request(int context_id, autofill_view_info vi); int commit(int context_id, autofill_save_view_info vi); + int cancel_fill_request(int context_id, autofill_view_info vi); } diff --git a/tidl/autofill_service.tidl b/tidl/autofill_service.tidl index 06d1aa3..78241ad 100644 --- a/tidl/autofill_service.tidl +++ b/tidl/autofill_service.tidl @@ -71,4 +71,5 @@ interface AutofillSvcPort { void send_fill_request(int context_id, autofill_svc_view_info vi) async; void commit(int context_id, autofill_svc_save_view_info si) async; void request_terminate() async; + void cancel_fill_request(int context_id, autofill_svc_view_info vi) async; } -- 2.7.4