From f00aee65a640055aa6dd759c34a8708c9f205a44 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 12 Dec 2018 20:32:59 +0900 Subject: [PATCH 01/16] Add missing code to check NULL in autofill_service_set_terminate_received_cb Change-Id: Iba703e80ac0da84b4bcdf64f372766ae0aeef8e5 Signed-off-by: Jihoon Kim --- service_lib/autofill_service.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/service_lib/autofill_service.c b/service_lib/autofill_service.c index f81e778..f8106d4 100644 --- a/service_lib/autofill_service.c +++ b/service_lib/autofill_service.c @@ -636,6 +636,10 @@ EXPORT_API int autofill_service_unset_commited_cb(void) EXPORT_API int autofill_service_set_terminate_received_cb(autofill_service_terminate_received_cb callback, void *user_data) { + if (!callback) { + LOGW("[ERROR] Invalid parameter"); + return AUTOFILL_ERROR_INVALID_PARAMETER; + } g_autofill_service_terminate_received_cb = callback; g_autofill_service_terminate_received_data = user_data; -- 2.7.4 From a244c2567e6d3dfc7397c4437eed3d5a99856e91 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 13 Dec 2018 09:38:11 +0900 Subject: [PATCH 02/16] Add exclude section of coverage Change-Id: I9d1a67947ece2740046d925d6544cceb97362f5b Signed-off-by: Jihoon Kim --- client/autofill.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/autofill.c b/client/autofill.c index 3255989..2d68c31 100644 --- a/client/autofill.c +++ b/client/autofill.c @@ -34,6 +34,7 @@ static int _autofill_context_count = 0; +//LCOV_EXCL_START static bool fill_response_item_cb(rpc_port_autofill_response_item_h response_items, void *user_data) { char *id = NULL; @@ -168,6 +169,7 @@ static void __auth_info_recv_cb(void *user_data, rpc_port_autofill_auth_info_h a autofill_auth_info_destroy(aih); } +//LCOV_EXCL_STOP static void __on_connected(rpc_port_proxy_AutofillAppPort_h h, void *user_data) { -- 2.7.4 From 5c883dadb71a199d2a062c953dcd7dba0ef87000 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 13 Dec 2018 09:41:26 +0900 Subject: [PATCH 03/16] Initialize variables for fixing crash Change-Id: I8119c8a25314c7097d0bb43bfc7e1c46ca757974 Signed-off-by: Jihoon Kim --- client/autofill.c | 6 +++--- client/autofill_auth.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/autofill.c b/client/autofill.c index 2d68c31..9469a51 100644 --- a/client/autofill.c +++ b/client/autofill.c @@ -294,9 +294,9 @@ EXPORT_API int autofill_connect(autofill_h ah, autofill_connection_status_change EXPORT_API int autofill_commit(autofill_h ah, autofill_save_view_info_h vi) { rpc_port_autofill_save_view_info_h vih; - char *id; - char *label; - char *value; + char *id = NULL; + char *label = NULL; + char *value = NULL; autofill_hint_e autofill_hint; bool sensitive_data; diff --git a/client/autofill_auth.c b/client/autofill_auth.c index 2585e64..815b358 100644 --- a/client/autofill_auth.c +++ b/client/autofill_auth.c @@ -35,8 +35,8 @@ EXPORT_API int autofill_auth_info_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 6d83a9f75a5c0014e5d6bbc9fcce994746362215 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 13 Dec 2018 10:23:35 +0900 Subject: [PATCH 04/16] Fix error log format Change-Id: I11751316bdae33a7479b5c25407236a18893009c Signed-off-by: Jihoon Kim --- client/autofill.c | 10 ++++----- client/autofill_auth.c | 2 +- client/autofill_fill_request.c | 2 +- common/autofill_fill_response.c | 2 +- common/autofill_fill_response_group.c | 8 +++---- common/autofill_fill_response_item.c | 10 ++++----- common/autofill_item.c | 16 ++++++------- common/autofill_save_item.c | 16 ++++++------- common/autofill_save_view_info.c | 2 +- common/autofill_view_info.c | 2 +- manager/autofill_manager.c | 42 +++++++++++++++++------------------ 11 files changed, 55 insertions(+), 57 deletions(-) diff --git a/client/autofill.c b/client/autofill.c index 9469a51..28824ec 100644 --- a/client/autofill.c +++ b/client/autofill.c @@ -79,8 +79,6 @@ static bool fill_response_group_cb(rpc_port_autofill_response_group_h response_g autofill_fill_response_h rh = (autofill_fill_response_h)user_data; autofill_fill_response_group_h res_group; - LOGD(""); - autofill_fill_response_group_create(&res_group); rpc_port_autofill_response_group_foreach_response_items(response_groups, fill_response_item_cb, res_group); @@ -185,7 +183,7 @@ static void __on_connected(rpc_port_proxy_AutofillAppPort_h h, void *user_data) int r = rpc_port_proxy_AutofillAppPort_invoke_Register(h, ah->context_id, auth_info_received_cb, fill_response_received_cb); if (r != 0) - LOGD("Failed to invoke Register"); + LOGW("[ERROR] Failed to invoke Register"); if (ah->connection_callback) ah->connection_callback(ah, AUTOFILL_CONNECTION_STATUS_CONNECTED, ah->connection_userdata); @@ -235,7 +233,7 @@ EXPORT_API int autofill_create(autofill_h *ah) ret = rpc_port_proxy_AutofillAppPort_create(AUTOFILL_DAEMON_APP_ID, &rpc_callback, as, &as->rpc_h); if (ret != RPC_PORT_ERROR_NONE) { - LOGW("Failed to create rpc port. err = %d", ret); + LOGW("[ERROR] Failed to create rpc port. err = %d", ret); free(as); return AUTOFILL_ERROR_OUT_OF_MEMORY; } @@ -283,7 +281,7 @@ EXPORT_API int autofill_connect(autofill_h ah, autofill_connection_status_change ret = rpc_port_proxy_AutofillAppPort_connect(ah->rpc_h); if (ret != RPC_PORT_ERROR_NONE) { - LOGW("Failed to connect rpc port. err = %d", ret); + LOGW("[ERROR] Failed to connect rpc port. err = %d", ret); return AUTOFILL_ERROR_OPERATION_FAILED; } else { @@ -358,7 +356,7 @@ EXPORT_API int autofill_commit(autofill_h ah, autofill_save_view_info_h vi) rpc_port_autofill_save_view_info_destroy(vih); if (ret != RPC_PORT_ERROR_NONE) { - LOGW("Failed to commit. rpc err = %d", ret); + LOGW("[ERROR] Failed to commit. rpc err = %d", ret); return AUTOFILL_ERROR_OPERATION_FAILED; } else { diff --git a/client/autofill_auth.c b/client/autofill_auth.c index 815b358..d238b63 100644 --- a/client/autofill_auth.c +++ b/client/autofill_auth.c @@ -94,7 +94,7 @@ EXPORT_API int autofill_auth_info_request(autofill_h ah, autofill_view_info_h vi rpc_port_autofill_view_info_destroy(vih); if (ret != RPC_PORT_ERROR_NONE) { - LOGW("Failed to send auth request. rpc err = %d", ret); + LOGW("[ERROR] Failed to send auth request. rpc err = %d", ret); return AUTOFILL_ERROR_OPERATION_FAILED; } else diff --git a/client/autofill_fill_request.c b/client/autofill_fill_request.c index 50ca370..8dec709 100644 --- a/client/autofill_fill_request.c +++ b/client/autofill_fill_request.c @@ -90,7 +90,7 @@ EXPORT_API int autofill_fill_request(autofill_h ah, autofill_view_info_h vi) rpc_port_autofill_view_info_destroy(vih); if (ret != RPC_PORT_ERROR_NONE) { - LOGW("Failed to send fill request. rpc err = %d", ret); + LOGW("[ERROR] Failed to send fill request. rpc err = %d", ret); return AUTOFILL_ERROR_OPERATION_FAILED; } else diff --git a/common/autofill_fill_response.c b/common/autofill_fill_response.c index 8639e34..34179b9 100644 --- a/common/autofill_fill_response.c +++ b/common/autofill_fill_response.c @@ -124,7 +124,7 @@ EXPORT_API int autofill_fill_response_add_group(autofill_fill_response_h h, auto autofill_fill_response_group_h clone; autofill_fill_response_group_clone(it, &clone); if (!clone) { - LOGW("Out of memory"); + LOGW("[ERROR] Out of memory"); return AUTOFILL_ERROR_OUT_OF_MEMORY; } diff --git a/common/autofill_fill_response_group.c b/common/autofill_fill_response_group.c index 7013cee..0e11114 100644 --- a/common/autofill_fill_response_group.c +++ b/common/autofill_fill_response_group.c @@ -61,13 +61,13 @@ EXPORT_API int autofill_fill_response_group_clone(autofill_fill_response_group_h autofill_fill_response_group_h handle = NULL; if (!h || !clone) { - LOGW("Invalid parameter"); + LOGW("[ERROR] Invalid parameter"); return AUTOFILL_ERROR_INVALID_PARAMETER; } autofill_fill_response_group_create(&handle); if (!handle) { - LOGW("Failed to create autofill_item handle"); + LOGW("[ERROR] Failed to create autofill_item handle"); return AUTOFILL_ERROR_OUT_OF_MEMORY; } @@ -77,14 +77,14 @@ EXPORT_API int autofill_fill_response_group_clone(autofill_fill_response_group_h EINA_LIST_FOREACH(h->autofill_fill_response_item_list, l, it_h) { if (!it_h) { - LOGW("Can't get response item"); + LOGW("[ERROR] Failed to get response item"); autofill_fill_response_group_destroy(handle); return AUTOFILL_ERROR_OPERATION_FAILED; } autofill_fill_response_item_clone(it_h, &new_it_h); if (!new_it_h) { - LOGW("Failed to duplicate reponse item"); + LOGW("[ERROR] Failed to duplicate reponse item"); autofill_fill_response_group_destroy(handle); return AUTOFILL_ERROR_OPERATION_FAILED; } diff --git a/common/autofill_fill_response_item.c b/common/autofill_fill_response_item.c index e9088d4..ef60672 100644 --- a/common/autofill_fill_response_item.c +++ b/common/autofill_fill_response_item.c @@ -78,7 +78,7 @@ EXPORT_API int autofill_fill_response_item_clone(autofill_fill_response_item_h i int ret; if (!it || !clone) { - LOGW("Invalid parameter"); + LOGW("[ERROR] Invalid parameter"); return AUTOFILL_ERROR_INVALID_PARAMETER; } @@ -87,14 +87,14 @@ EXPORT_API int autofill_fill_response_item_clone(autofill_fill_response_item_h i return AUTOFILL_ERROR_OUT_OF_MEMORY; if (!handle) { - LOGW("Failed to create autofill_item handle"); + LOGW("[ERROR] Failed to create autofill_item handle"); return AUTOFILL_ERROR_OUT_OF_MEMORY; } if (it->id) { handle->id = strdup(it->id); if (!handle->id) { - LOGW("Failed to duplicate it->id"); + LOGW("[ERROR] Failed to duplicate it->id"); autofill_fill_response_item_destroy(handle); return AUTOFILL_ERROR_OUT_OF_MEMORY; } @@ -103,7 +103,7 @@ EXPORT_API int autofill_fill_response_item_clone(autofill_fill_response_item_h i if (it->presentation_text) { handle->presentation_text = strdup(it->presentation_text); if (!handle->presentation_text) { - LOGW("Failed to duplicate it->presentation_text"); + LOGW("[ERROR] Failed to duplicate it->presentation_text"); autofill_fill_response_item_destroy(handle); return AUTOFILL_ERROR_OUT_OF_MEMORY; } @@ -112,7 +112,7 @@ EXPORT_API int autofill_fill_response_item_clone(autofill_fill_response_item_h i if (it->value) { handle->value = strdup(it->value); if (!handle->value) { - LOGW("Failed to duplicate it->value"); + LOGW("[ERROR] Failed to duplicate it->value"); autofill_fill_response_item_destroy(handle); return AUTOFILL_ERROR_OUT_OF_MEMORY; } diff --git a/common/autofill_item.c b/common/autofill_item.c index 450443a..8a20806 100644 --- a/common/autofill_item.c +++ b/common/autofill_item.c @@ -82,20 +82,20 @@ EXPORT_API int autofill_item_clone(autofill_item_h h, autofill_item_h *clone) autofill_item_h handle; if (!h || !clone) { - LOGW("Invalid parameter"); + LOGW("[ERROR] Invalid parameter"); return AUTOFILL_ERROR_INVALID_PARAMETER; } autofill_item_create(&handle); if (!handle) { - LOGW("Failed to create autofill_item handle"); + LOGW("[ERROR] Failed to create autofill_item handle"); return AUTOFILL_ERROR_OPERATION_FAILED; } if (h->id) { handle->id = strdup(h->id); if (!handle->id) { - LOGW("Failed to duplicate h->id"); + LOGW("[ERROR] Failed to duplicate h->id"); autofill_item_destroy(handle); return AUTOFILL_ERROR_OUT_OF_MEMORY; } @@ -104,7 +104,7 @@ EXPORT_API int autofill_item_clone(autofill_item_h h, autofill_item_h *clone) if (h->label) { handle->label = strdup(h->label); if (!handle->label) { - LOGW("Failed to duplicate h->label"); + LOGW("[ERROR] Failed to duplicate h->label"); autofill_item_destroy(handle); return AUTOFILL_ERROR_OUT_OF_MEMORY; } @@ -113,7 +113,7 @@ EXPORT_API int autofill_item_clone(autofill_item_h h, autofill_item_h *clone) if (h->value) { handle->value = strdup(h->value); if (!handle->value) { - LOGW("Failed to duplicate h->value"); + LOGW("[ERROR] Failed to duplicate h->value"); autofill_item_destroy(handle); return AUTOFILL_ERROR_OUT_OF_MEMORY; } @@ -216,7 +216,7 @@ EXPORT_API int autofill_item_set_sensitive_data(autofill_item_h it, bool sensiti EXPORT_API int autofill_item_get_sensitive_data(autofill_item_h it, bool *sensitive) { if (!it || !sensitive) { - LOGW("AUTOFILL_ERROR_INVALID_PARAMETER"); + LOGW("[ERROR] AUTOFILL_ERROR_INVALID_PARAMETER"); return AUTOFILL_ERROR_INVALID_PARAMETER; } @@ -228,7 +228,7 @@ EXPORT_API int autofill_item_get_sensitive_data(autofill_item_h it, bool *sensit EXPORT_API int autofill_item_set_value(autofill_item_h it, const char *value) { if (!it || !value) { - LOGW("AUTOFILL_ERROR_INVALID_PARAMETER"); + LOGW("[ERROR] AUTOFILL_ERROR_INVALID_PARAMETER"); return AUTOFILL_ERROR_INVALID_PARAMETER; } @@ -244,7 +244,7 @@ EXPORT_API int autofill_item_set_value(autofill_item_h it, const char *value) EXPORT_API int autofill_item_get_value(autofill_item_h it, char **value) { if (!it || !value) { - LOGW("AUTOFILL_ERROR_INVALID_PARAMETER"); + LOGW("[ERROR] AUTOFILL_ERROR_INVALID_PARAMETER"); return AUTOFILL_ERROR_INVALID_PARAMETER; } diff --git a/common/autofill_save_item.c b/common/autofill_save_item.c index 4fa8e9c..dcae2c0 100644 --- a/common/autofill_save_item.c +++ b/common/autofill_save_item.c @@ -82,7 +82,7 @@ EXPORT_API int autofill_save_item_clone(autofill_save_item_h it, autofill_save_i int ret; if (!it || !clone) { - LOGW("Invalid parameter"); + LOGW("[ERROR] Invalid parameter"); return AUTOFILL_ERROR_INVALID_PARAMETER; } @@ -91,14 +91,14 @@ EXPORT_API int autofill_save_item_clone(autofill_save_item_h it, autofill_save_i return AUTOFILL_ERROR_OUT_OF_MEMORY; if (!handle) { - LOGW("Failed to create autofill_save_item handle"); + LOGW("[ERROR] Failed to create autofill_save_item handle"); return AUTOFILL_ERROR_OUT_OF_MEMORY; } if (it->id) { handle->id = strdup(it->id); if (!handle->id) { - LOGW("Failed to duplicate it->id"); + LOGW("[ERROR] Failed to duplicate it->id"); autofill_save_item_destroy(handle); return AUTOFILL_ERROR_OUT_OF_MEMORY; } @@ -107,7 +107,7 @@ EXPORT_API int autofill_save_item_clone(autofill_save_item_h it, autofill_save_i if (it->label) { handle->label = strdup(it->label); if (!handle->label) { - LOGW("Failed to duplicate it->label"); + LOGW("[ERROR] Failed to duplicate it->label"); autofill_save_item_destroy(handle); return AUTOFILL_ERROR_OUT_OF_MEMORY; } @@ -116,7 +116,7 @@ EXPORT_API int autofill_save_item_clone(autofill_save_item_h it, autofill_save_i if (it->value) { handle->value = strdup(it->value); if (!handle->value) { - LOGW("Failed to duplicate it->value"); + LOGW("[ERROR] Failed to duplicate it->value"); autofill_save_item_destroy(handle); return AUTOFILL_ERROR_OUT_OF_MEMORY; } @@ -219,7 +219,7 @@ EXPORT_API int autofill_save_item_set_sensitive_data(autofill_save_item_h it, bo EXPORT_API int autofill_save_item_get_sensitive_data(autofill_save_item_h it, bool *sensitive) { if (!it || !sensitive) { - LOGW("AUTOFILL_ERROR_INVALID_PARAMETER"); + LOGW("[ERROR] AUTOFILL_ERROR_INVALID_PARAMETER"); return AUTOFILL_ERROR_INVALID_PARAMETER; } @@ -231,7 +231,7 @@ EXPORT_API int autofill_save_item_get_sensitive_data(autofill_save_item_h it, bo EXPORT_API int autofill_save_item_set_value(autofill_save_item_h it, const char *value) { if (!it || !value) { - LOGW("AUTOFILL_ERROR_INVALID_PARAMETER"); + LOGW("[ERROR] AUTOFILL_ERROR_INVALID_PARAMETER"); return AUTOFILL_ERROR_INVALID_PARAMETER; } @@ -247,7 +247,7 @@ EXPORT_API int autofill_save_item_set_value(autofill_save_item_h it, const char EXPORT_API int autofill_save_item_get_value(autofill_save_item_h it, char **value) { if (!it || !value) { - LOGW("AUTOFILL_ERROR_INVALID_PARAMETER"); + LOGW("[ERROR] AUTOFILL_ERROR_INVALID_PARAMETER"); return AUTOFILL_ERROR_INVALID_PARAMETER; } diff --git a/common/autofill_save_view_info.c b/common/autofill_save_view_info.c index 30e4a74..5185e1e 100644 --- a/common/autofill_save_view_info.c +++ b/common/autofill_save_view_info.c @@ -130,7 +130,7 @@ EXPORT_API int autofill_save_view_info_add_item(autofill_save_view_info_h vi, au autofill_save_item_clone(it, &clone); if (!clone) { - LOGW("Out of memory"); + LOGW("[ERROR] Out of memory"); return AUTOFILL_ERROR_OUT_OF_MEMORY; } diff --git a/common/autofill_view_info.c b/common/autofill_view_info.c index 1ba1d66..9d773df 100644 --- a/common/autofill_view_info.c +++ b/common/autofill_view_info.c @@ -128,7 +128,7 @@ EXPORT_API int autofill_view_info_add_item(autofill_view_info_h vi, autofill_ite autofill_item_clone(it, &clone); if (!clone) { - LOGW("Out of memory"); + LOGW("[ERROR] Out of memory"); return AUTOFILL_ERROR_OUT_OF_MEMORY; } diff --git a/manager/autofill_manager.c b/manager/autofill_manager.c index d7fbf77..10064c9 100644 --- a/manager/autofill_manager.c +++ b/manager/autofill_manager.c @@ -75,12 +75,12 @@ EXPORT_API int autofill_manager_create(autofill_manager_h *amh) LOGD("autofill manager initialize"); if (!amh) { - LOGW("Invalid paramater"); + LOGW("[ERROR] Invalid paramater"); return AUTOFILL_ERROR_INVALID_PARAMETER; } if (!check_privilege(AUTOFILL_MANAGER_PRIVILEGE)) { - LOGW("Permission denied"); + LOGW("[ERROR] Permission denied"); return AUTOFILL_ERROR_PERMISSION_DENIED; } else { @@ -99,7 +99,7 @@ EXPORT_API int autofill_manager_create(autofill_manager_h *amh) ret = rpc_port_proxy_AutofillManagerPort_create(AUTOFILL_DAEMON_APP_ID, &rpc_callback, ams, &ams->rpc_h); if (ret != RPC_PORT_ERROR_NONE) { - LOGW("Failed to create rpc port. err = %d", ret); + LOGW("[ERROR] Failed to create rpc port. err = %d", ret); free(ams); return AUTOFILL_ERROR_OUT_OF_MEMORY; } @@ -114,14 +114,14 @@ EXPORT_API int autofill_manager_destroy(autofill_manager_h amh) LOGD("autofill manager deinitialize"); if (!amh) { - LOGW("Invalid paramater"); + LOGW("[ERROR] Invalid paramater"); return AUTOFILL_ERROR_INVALID_PARAMETER; } amh->connection_callback = NULL; if (!check_privilege(AUTOFILL_MANAGER_PRIVILEGE)) { - LOGW("Permission denied"); + LOGW("[ERROR] Permission denied"); return AUTOFILL_ERROR_PERMISSION_DENIED; } else { @@ -143,17 +143,17 @@ EXPORT_API int autofill_manager_connect(autofill_manager_h amh, autofill_manager int ret; if (!amh || !callback) { - LOGW("parameter is NULL\n"); + LOGW("[ERROR] parameter is NULL\n"); return AUTOFILL_ERROR_INVALID_PARAMETER; } if (!check_privilege(AUTOFILL_MANAGER_PRIVILEGE)) { - LOGW("Permission denied"); + LOGW("[ERROR] Permission denied"); return AUTOFILL_ERROR_PERMISSION_DENIED; } if (!amh->rpc_h) { - LOGW("rpc handle is NULL"); + LOGW("[ERROR] rpc handle is NULL"); return AUTOFILL_ERROR_OPERATION_FAILED; } @@ -163,12 +163,12 @@ EXPORT_API int autofill_manager_connect(autofill_manager_h amh, autofill_manager ret = rpc_port_proxy_AutofillManagerPort_connect(amh->rpc_h); switch (ret) { case RPC_PORT_ERROR_PERMISSION_DENIED: - LOGW("permission error"); + LOGW("[ERROR] permission error"); break; } if (ret != RPC_PORT_ERROR_NONE) { - LOGW("Failed to connect rpc port. err = %d", ret); + LOGW("[ERROR] Failed to connect rpc port. err = %d", ret); return AUTOFILL_ERROR_OPERATION_FAILED; } @@ -180,23 +180,23 @@ EXPORT_API int autofill_manager_set_autofill_service(autofill_manager_h amh, con LOGD("autofill manager set autofill service"); if (!amh || !app_id) { - LOGW("parameter is NULL"); + LOGW("[ERROR] parameter is NULL"); return AUTOFILL_ERROR_INVALID_PARAMETER; } if (!check_privilege(AUTOFILL_MANAGER_PRIVILEGE)) { - LOGW("Permission denied"); + LOGW("[ERROR] Permission denied"); return AUTOFILL_ERROR_PERMISSION_DENIED; } if (!amh->rpc_h) { - LOGW("rpc handle is NULL"); + LOGW("[ERROR] rpc handle is NULL"); return AUTOFILL_ERROR_OPERATION_FAILED; } bool ret = rpc_port_proxy_AutofillManagerPort_invoke_set_autofill_service(amh->rpc_h, app_id); if (ret == false) { - LOGW("Failed to send rpc port. err = %d", ret); + LOGW("[ERROR] Failed to send rpc port. err = %d", ret); return AUTOFILL_ERROR_OPERATION_FAILED; } return AUTOFILL_ERROR_NONE; @@ -207,17 +207,17 @@ EXPORT_API int autofill_manager_get_autofill_service(autofill_manager_h amh, cha LOGD("autofill manager get autofill service"); if (!amh || !service_app_id) { - LOGW("parameter is NULL"); + LOGW("[ERROR] parameter is NULL"); return AUTOFILL_ERROR_INVALID_PARAMETER; } if (!check_privilege(AUTOFILL_MANAGER_PRIVILEGE)) { - LOGW("Permission denied"); + LOGW("[ERROR] Permission denied"); return AUTOFILL_ERROR_PERMISSION_DENIED; } if (!amh->rpc_h) { - LOGW("Not initialized"); + LOGW("[ERROR] Not initialized"); return AUTOFILL_ERROR_OPERATION_FAILED; } @@ -237,17 +237,17 @@ EXPORT_API int autofill_manager_foreach_autofill_service(autofill_manager_h amh, int ret; if (!amh || !callback) { - LOGW("parameter is NULL"); + LOGW("[ERROR] parameter is NULL"); return AUTOFILL_ERROR_INVALID_PARAMETER; } if (!check_privilege(AUTOFILL_MANAGER_PRIVILEGE)) { - LOGW("Permission denied"); + LOGW("[ERROR] Permission denied"); return AUTOFILL_ERROR_PERMISSION_DENIED; } if (!amh->rpc_h) { - LOGW("rpc handle is NULL\n"); + LOGW("[ERROR] rpc handle is NULL\n"); return AUTOFILL_ERROR_OPERATION_FAILED; } @@ -255,7 +255,7 @@ EXPORT_API int autofill_manager_foreach_autofill_service(autofill_manager_h amh, rpc_port_list_string_create(&app_id_list); ret = rpc_port_proxy_AutofillManagerPort_invoke_get_autofill_service_list(amh->rpc_h, &app_id_list); if (ret == false) { - LOGW("Failed to send rpc port. err = %d", ret); + LOGW("[ERROR] Failed to send rpc port. err = %d", ret); return AUTOFILL_ERROR_OPERATION_FAILED; } rpc_port_list_string_foreach_list_strings(app_id_list, callback, user_data); -- 2.7.4 From 45e518829294dea59835587af870f0939571b7d4 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 13 Dec 2018 10:34:17 +0900 Subject: [PATCH 05/16] Update package version to 0.1.10 Change-Id: I7f44d16207f2986ba2368dfdc4f0703de585b5fc 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 0c44f42..99804b1 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.9 +Version: 0.1.10 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From e5caef222b4fdc04f447db529d6ccb837f415f15 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 13 Dec 2018 16:32:50 +0900 Subject: [PATCH 06/16] Add exclude section of coverage in service library Change-Id: I0b0d5972fff6e82ff41655f447a99f8e4a36d9dd Signed-off-by: Jihoon Kim --- service_lib/autofill_service.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/service_lib/autofill_service.c b/service_lib/autofill_service.c index f8106d4..14bbc28 100644 --- a/service_lib/autofill_service.c +++ b/service_lib/autofill_service.c @@ -58,6 +58,7 @@ typedef struct { static GList *__client_list = NULL; +//LCOV_EXCL_START bool __autofill_item_cb(rpc_port_autofill_svc_item_h items, void *user_data) { char *id = NULL; @@ -385,6 +386,7 @@ static void __message_unregister(rpc_port_stub_AutofillSvcPort_context_h context __client_list = g_list_remove(__client_list, client); __destroy_client(client); } +//LCOV_EXCL_STOP EXPORT_API int autofill_service_initialize(void) { -- 2.7.4 From ab13c732183272920b2262072ce6088fce3bf6cf Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 13 Dec 2018 16:39:47 +0900 Subject: [PATCH 07/16] Fix TC fail issue in case of no service app Change-Id: I26663c1fd78fb617455666644280fe96bab26773 Signed-off-by: Jihoon Kim --- server/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/main.c b/server/main.c index dd03fc0..d1ac10a 100644 --- a/server/main.c +++ b/server/main.c @@ -336,7 +336,7 @@ static int __auth_info_request_cb(rpc_port_stub_AutofillAppPort_context_h contex if (!svc_rpc_h) { LOGW("Not initialized"); - return -1; + return 0; } rpc_port_stub_AutofillAppPort_context_get_sender(context, &sender); @@ -377,7 +377,7 @@ static int __autofill_fill_request_cb(rpc_port_stub_AutofillAppPort_context_h co if (!svc_rpc_h) { LOGW("Not initialized"); - return -1; + return 0; } rpc_port_stub_AutofillAppPort_context_get_sender(context, &sender); @@ -412,7 +412,7 @@ static int __commit_cb(rpc_port_stub_AutofillAppPort_context_h context, int cont if (!svc_rpc_h) { LOGW("Not initialized"); - return -1; + return 0; } rpc_port_stub_AutofillAppPort_context_get_sender(context, &sender); -- 2.7.4 From add7bfd009eb98c494515b230b661561565640c8 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 13 Dec 2018 17:39:48 +0900 Subject: [PATCH 08/16] Update package version to 0.1.11 Change-Id: Iddbffb2f392b6e9d58537417c84f6476bf4aa8c4 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 99804b1..049084d 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.10 +Version: 0.1.11 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From 95412b2c7c7efbde57427258532221b117359fe7 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 19 Dec 2018 19:27:07 +0900 Subject: [PATCH 09/16] Enable to check privilege Change-Id: I2cf5544b1a393794a1cbe552d8743fb8b46230d6 Signed-off-by: Jihoon Kim --- privilege_checker/privilege_checker.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/privilege_checker/privilege_checker.c b/privilege_checker/privilege_checker.c index bf13bf3..e75a372 100644 --- a/privilege_checker/privilege_checker.c +++ b/privilege_checker/privilege_checker.c @@ -20,8 +20,6 @@ check_privilege(const char *privilege) char smack_label[1024] = {'\0', }; char uid[10] = {0,}; - return true; //FIXME - int ret = cynara_initialize(&p_cynara, NULL); if (ret != CYNARA_API_SUCCESS) { return false; -- 2.7.4 From 872a7fdd8c73a1d5587aa39c8982916462426dde Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 20 Dec 2018 15:23:21 +0900 Subject: [PATCH 10/16] Display connection error reason Change-Id: Ic1ae30a065a61c1f83504d72f3ec9ceb84e49da2 Signed-off-by: Jihoon Kim --- client/autofill.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/client/autofill.c b/client/autofill.c index 28824ec..52cfeb0 100644 --- a/client/autofill.c +++ b/client/autofill.c @@ -281,7 +281,23 @@ EXPORT_API int autofill_connect(autofill_h ah, autofill_connection_status_change ret = rpc_port_proxy_AutofillAppPort_connect(ah->rpc_h); if (ret != RPC_PORT_ERROR_NONE) { - LOGW("[ERROR] Failed to connect rpc port. err = %d", ret); + switch(ret) { + case RPC_PORT_ERROR_IO_ERROR: + LOGW("[ERROR] Failed to connect rpc port. I/O Error"); + break; + case RPC_PORT_ERROR_OUT_OF_MEMORY: + LOGW("[ERROR] Failed to connect rpc port. Out of memory"); + break; + case RPC_PORT_ERROR_INVALID_PARAMETER: + LOGW("[ERROR] Failed to connect rpc port. Invalid parameter"); + break; + case RPC_PORT_ERROR_PERMISSION_DENIED: + LOGW("[ERROR] Failed to connect rpc port. Permission denied"); + break; + default: + LOGW("[ERROR] Failed to connect rpc port. errcode = %d", ret); + break; + } return AUTOFILL_ERROR_OPERATION_FAILED; } else { -- 2.7.4 From 747bc44a4ddc1b40ff497ee0ed877a2935d6c872 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 20 Dec 2018 19:57:47 +0900 Subject: [PATCH 11/16] Fix memory leak Change-Id: I9d70a1d130e0ef0d526bce3ffb08944b183e2310 Signed-off-by: Jihoon Kim --- manager/autofill_manager.c | 1 + service_lib/autofill_service.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/manager/autofill_manager.c b/manager/autofill_manager.c index 10064c9..a047ba1 100644 --- a/manager/autofill_manager.c +++ b/manager/autofill_manager.c @@ -256,6 +256,7 @@ EXPORT_API int autofill_manager_foreach_autofill_service(autofill_manager_h amh, ret = rpc_port_proxy_AutofillManagerPort_invoke_get_autofill_service_list(amh->rpc_h, &app_id_list); if (ret == false) { LOGW("[ERROR] Failed to send rpc port. err = %d", ret); + rpc_port_list_string_destroy(app_id_list); return AUTOFILL_ERROR_OPERATION_FAILED; } rpc_port_list_string_foreach_list_strings(app_id_list, callback, user_data); diff --git a/service_lib/autofill_service.c b/service_lib/autofill_service.c index 14bbc28..72bd9b6 100644 --- a/service_lib/autofill_service.c +++ b/service_lib/autofill_service.c @@ -152,6 +152,8 @@ bool __save_item_cb(rpc_port_autofill_svc_save_item_h items, void *user_data) autofill_save_view_info_add_item(vi, ai); + autofill_save_item_destroy(ai); + return true; } -- 2.7.4 From f04d3161770f4f94faf5bff55c8d60aa9bc30959 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 21 Dec 2018 14:23:58 +0900 Subject: [PATCH 12/16] Initialize variable before using If rpc_port_autofill_svc_response_group_create() failed, res_group_h has wrong value that already freed. Change-Id: Ic0a74d7a5b1d6c259149761424908db30e68a9cd Signed-off-by: Jihoon Kim --- service_lib/autofill_service.c | 1 + 1 file changed, 1 insertion(+) diff --git a/service_lib/autofill_service.c b/service_lib/autofill_service.c index 72bd9b6..a18ed44 100644 --- a/service_lib/autofill_service.c +++ b/service_lib/autofill_service.c @@ -601,6 +601,7 @@ EXPORT_API int autofill_service_send_fill_response(int context_id, autofill_fill EINA_LIST_FOREACH(h->autofill_fill_response_group_list, l, it) { + res_group_h = NULL; rpc_port_autofill_svc_response_group_create(&res_group_h); autofill_fill_response_group_foreach_item(it, __fill_response_item_cb, res_group_h); -- 2.7.4 From 25752f066a4c59969839c1163823e12571751729 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 19 Nov 2018 15:58:45 +0900 Subject: [PATCH 13/16] Change daemon from org.tizen.autofill-daemon to org.tizen.autofilld org.tizen.autofilld is located in other git repository for ABS build. autofill-daemon is moved into other repository. Change-Id: I2fae45317dea4c5af24dd06a0860e943366da91a Signed-off-by: Jihoon Kim --- CMakeLists.txt | 8 ------ client/autofill.c | 2 +- manager/autofill_manager.c | 2 +- packaging/capi-ui-autofill.spec | 29 +-------------------- server/CMakeLists.txt | 43 ------------------------------- server/org.tizen.autofill-daemon.manifest | 5 ---- server/org.tizen.autofill-daemon.xml | 14 ---------- 7 files changed, 3 insertions(+), 100 deletions(-) delete mode 100644 server/CMakeLists.txt delete mode 100644 server/org.tizen.autofill-daemon.manifest delete mode 100644 server/org.tizen.autofill-daemon.xml diff --git a/CMakeLists.txt b/CMakeLists.txt index ce0756d..71a1b45 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,11 +32,3 @@ ADD_SUBDIRECTORY(service_lib) ## Manager library ## ADD_SUBDIRECTORY(manager) - -## Server daemon ## -ADD_SUBDIRECTORY(server) - -## Config ## -#INSTALL(FILES ${CMAKE_SOURCE_DIR}/autofill-config.xml DESTINATION ${TZ_SYS_RO_SHARE}/voice/autofill/1.0) - -#INSTALL(FILES ${CMAKE_SOURCE_DIR}/autofill-server.conf DESTINATION /etc/dbus-1/session.d) diff --git a/client/autofill.c b/client/autofill.c index 52cfeb0..6318d3d 100644 --- a/client/autofill.c +++ b/client/autofill.c @@ -25,7 +25,7 @@ #include "autofill_private.h" #include "autofill_proxy.h" -#define AUTOFILL_DAEMON_APP_ID "org.tizen.autofill-daemon" +#define AUTOFILL_DAEMON_APP_ID "org.tizen.autofilld" #ifdef LOG_TAG #undef LOG_TAG diff --git a/manager/autofill_manager.c b/manager/autofill_manager.c index a047ba1..e2becfc 100644 --- a/manager/autofill_manager.c +++ b/manager/autofill_manager.c @@ -24,7 +24,7 @@ #include "autofill_manager_proxy.h" #include "../privilege_checker/privilege_checker_private.h" -#define AUTOFILL_DAEMON_APP_ID "org.tizen.autofill-daemon" +#define AUTOFILL_DAEMON_APP_ID "org.tizen.autofilld" #ifdef LOG_TAG #undef LOG_TAG diff --git a/packaging/capi-ui-autofill.spec b/packaging/capi-ui-autofill.spec index 049084d..aabba06 100644 --- a/packaging/capi-ui-autofill.spec +++ b/packaging/capi-ui-autofill.spec @@ -87,15 +87,6 @@ Requires: %{name} = %{version}-%{release} Autofill Manager Library (Development) -%package -n org.tizen.autofill-daemon -Summary: Autofill Daemon application -Group: Graphics & UI Framework/Input -Requires: %{name} = %{version}-%{release} - -%description -n org.tizen.autofill-daemon -Autofill Daemon application - - %prep %setup -q @@ -103,14 +94,6 @@ tidlc -p -l C -i tidl/autofill.tidl -o autofill_proxy mv autofill_proxy.h ./client/ mv autofill_proxy.c ./client/ -tidlc -s -l C -i tidl/autofill.tidl -o autofill_stub -mv autofill_stub.h ./server/ -mv autofill_stub.c ./server/ - -tidlc -p -l C -i tidl/autofill_service.tidl -o autofill_service_proxy -mv autofill_service_proxy.h ./server/ -mv autofill_service_proxy.c ./server/ - tidlc -s -l C -i tidl/autofill_service.tidl -o autofill_service_stub mv autofill_service_stub.h ./service_lib/ mv autofill_service_stub.c ./service_lib/ @@ -133,9 +116,7 @@ export FFLAGS+=" -DTIZEN_DEBUG_ENABLE -fvisibility=hidden" rm -rf CMakeFiles rm -rf CMakeCache.txt MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` -%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} \ - -DTZ_SYS_RO_APP=%TZ_SYS_RO_APP -DTZ_SYS_RO_PACKAGES=%TZ_SYS_RO_PACKAGES - +%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} make %{?jobs:-j%jobs} %install @@ -145,9 +126,6 @@ rm -rf %{buildroot} %post /sbin/ldconfig -%post -n org.tizen.autofill-daemon -mkdir -p %{TZ_SYS_RO_APP}/org.tizen.autofill-daemon - %postun -p /sbin/ldconfig @@ -192,8 +170,3 @@ mkdir -p %{TZ_SYS_RO_APP}/org.tizen.autofill-daemon %{_includedir}/autofill_manager*.h %{_libdir}/pkgconfig/capi-ui-autofill-manager.pc %{_libdir}/libcapi-ui-autofill-manager.so - -%files -n org.tizen.autofill-daemon -%manifest server/org.tizen.autofill-daemon.manifest -%{TZ_SYS_RO_PACKAGES}/org.tizen.autofill-daemon.xml -%{TZ_SYS_RO_APP}/org.tizen.autofill-daemon/* diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt deleted file mode 100644 index aba710e..0000000 --- a/server/CMakeLists.txt +++ /dev/null @@ -1,43 +0,0 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -PROJECT(autofill-daemon C) - -SET(SRCS - main.c - autofill_config.c - autofill_stub.c - autofill_manager_stub.c - autofill_service_proxy.c -) - -pkg_check_modules(pkgs_daemon REQUIRED - dlog - capi-appfw-service-application - rpc-port - glib-2.0 - capi-appfw-app-manager - capi-appfw-preference - eina -) - -INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/include) - -FOREACH(flag ${pkgs_daemon_CFLAGS}) - SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") -ENDFOREACH(flag) - -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE") -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie") - -FIND_PROGRAM(UNAME NAMES uname) -EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH") -IF("${ARCH}" STREQUAL "arm") - ADD_DEFINITIONS("-DTARGET") - MESSAGE("add -DTARGET") -ENDIF("${ARCH}" STREQUAL "arm") - -ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS}) - -TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_daemon_LDFLAGS}) - -INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${TZ_SYS_RO_APP}/org.tizen.${PROJECT_NAME}/bin/) -INSTALL(FILES ${CMAKE_BINARY_DIR}/server/org.tizen.${PROJECT_NAME}.xml DESTINATION ${TZ_SYS_RO_PACKAGES}) diff --git a/server/org.tizen.autofill-daemon.manifest b/server/org.tizen.autofill-daemon.manifest deleted file mode 100644 index 017d22d..0000000 --- a/server/org.tizen.autofill-daemon.manifest +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/server/org.tizen.autofill-daemon.xml b/server/org.tizen.autofill-daemon.xml deleted file mode 100644 index 36ad5ac..0000000 --- a/server/org.tizen.autofill-daemon.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - Jihoon Kim - autofill-daemon - - - - - - http://tizen.org/privilege/appmanager.launch - http://tizen.org/privilege/datasharing - - -- 2.7.4 From 05e690633d82342359aea24f2bdfade010a10120 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 24 Dec 2018 11:33:23 +0900 Subject: [PATCH 14/16] Update package version to 0.1.12 Change-Id: Ic635d2c4ff67ad783f503d24079f979e93e9350f 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 aabba06..caf6e4e 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.11 +Version: 0.1.12 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From b6eeb37e6d43873e079fa4f9f205fc27bf59ccce Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 24 Dec 2018 11:48:35 +0900 Subject: [PATCH 15/16] Revert "Change daemon from org.tizen.autofill-daemon to org.tizen.autofilld" This reverts commit 25752f066a4c59969839c1163823e12571751729. Change-Id: Id26395297daae1e0101b9340aa853f653aa130a5 --- CMakeLists.txt | 8 ++++++ client/autofill.c | 2 +- manager/autofill_manager.c | 2 +- packaging/capi-ui-autofill.spec | 29 ++++++++++++++++++++- server/CMakeLists.txt | 43 +++++++++++++++++++++++++++++++ server/org.tizen.autofill-daemon.manifest | 5 ++++ server/org.tizen.autofill-daemon.xml | 14 ++++++++++ 7 files changed, 100 insertions(+), 3 deletions(-) create mode 100644 server/CMakeLists.txt create mode 100644 server/org.tizen.autofill-daemon.manifest create mode 100644 server/org.tizen.autofill-daemon.xml diff --git a/CMakeLists.txt b/CMakeLists.txt index 71a1b45..ce0756d 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,3 +32,11 @@ ADD_SUBDIRECTORY(service_lib) ## Manager library ## ADD_SUBDIRECTORY(manager) + +## Server daemon ## +ADD_SUBDIRECTORY(server) + +## Config ## +#INSTALL(FILES ${CMAKE_SOURCE_DIR}/autofill-config.xml DESTINATION ${TZ_SYS_RO_SHARE}/voice/autofill/1.0) + +#INSTALL(FILES ${CMAKE_SOURCE_DIR}/autofill-server.conf DESTINATION /etc/dbus-1/session.d) diff --git a/client/autofill.c b/client/autofill.c index 6318d3d..52cfeb0 100644 --- a/client/autofill.c +++ b/client/autofill.c @@ -25,7 +25,7 @@ #include "autofill_private.h" #include "autofill_proxy.h" -#define AUTOFILL_DAEMON_APP_ID "org.tizen.autofilld" +#define AUTOFILL_DAEMON_APP_ID "org.tizen.autofill-daemon" #ifdef LOG_TAG #undef LOG_TAG diff --git a/manager/autofill_manager.c b/manager/autofill_manager.c index e2becfc..a047ba1 100644 --- a/manager/autofill_manager.c +++ b/manager/autofill_manager.c @@ -24,7 +24,7 @@ #include "autofill_manager_proxy.h" #include "../privilege_checker/privilege_checker_private.h" -#define AUTOFILL_DAEMON_APP_ID "org.tizen.autofilld" +#define AUTOFILL_DAEMON_APP_ID "org.tizen.autofill-daemon" #ifdef LOG_TAG #undef LOG_TAG diff --git a/packaging/capi-ui-autofill.spec b/packaging/capi-ui-autofill.spec index caf6e4e..009e7d7 100644 --- a/packaging/capi-ui-autofill.spec +++ b/packaging/capi-ui-autofill.spec @@ -87,6 +87,15 @@ Requires: %{name} = %{version}-%{release} Autofill Manager Library (Development) +%package -n org.tizen.autofill-daemon +Summary: Autofill Daemon application +Group: Graphics & UI Framework/Input +Requires: %{name} = %{version}-%{release} + +%description -n org.tizen.autofill-daemon +Autofill Daemon application + + %prep %setup -q @@ -94,6 +103,14 @@ tidlc -p -l C -i tidl/autofill.tidl -o autofill_proxy mv autofill_proxy.h ./client/ mv autofill_proxy.c ./client/ +tidlc -s -l C -i tidl/autofill.tidl -o autofill_stub +mv autofill_stub.h ./server/ +mv autofill_stub.c ./server/ + +tidlc -p -l C -i tidl/autofill_service.tidl -o autofill_service_proxy +mv autofill_service_proxy.h ./server/ +mv autofill_service_proxy.c ./server/ + tidlc -s -l C -i tidl/autofill_service.tidl -o autofill_service_stub mv autofill_service_stub.h ./service_lib/ mv autofill_service_stub.c ./service_lib/ @@ -116,7 +133,9 @@ export FFLAGS+=" -DTIZEN_DEBUG_ENABLE -fvisibility=hidden" rm -rf CMakeFiles rm -rf CMakeCache.txt MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` -%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} +%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} \ + -DTZ_SYS_RO_APP=%TZ_SYS_RO_APP -DTZ_SYS_RO_PACKAGES=%TZ_SYS_RO_PACKAGES + make %{?jobs:-j%jobs} %install @@ -126,6 +145,9 @@ rm -rf %{buildroot} %post /sbin/ldconfig +%post -n org.tizen.autofill-daemon +mkdir -p %{TZ_SYS_RO_APP}/org.tizen.autofill-daemon + %postun -p /sbin/ldconfig @@ -170,3 +192,8 @@ rm -rf %{buildroot} %{_includedir}/autofill_manager*.h %{_libdir}/pkgconfig/capi-ui-autofill-manager.pc %{_libdir}/libcapi-ui-autofill-manager.so + +%files -n org.tizen.autofill-daemon +%manifest server/org.tizen.autofill-daemon.manifest +%{TZ_SYS_RO_PACKAGES}/org.tizen.autofill-daemon.xml +%{TZ_SYS_RO_APP}/org.tizen.autofill-daemon/* diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt new file mode 100644 index 0000000..aba710e --- /dev/null +++ b/server/CMakeLists.txt @@ -0,0 +1,43 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +PROJECT(autofill-daemon C) + +SET(SRCS + main.c + autofill_config.c + autofill_stub.c + autofill_manager_stub.c + autofill_service_proxy.c +) + +pkg_check_modules(pkgs_daemon REQUIRED + dlog + capi-appfw-service-application + rpc-port + glib-2.0 + capi-appfw-app-manager + capi-appfw-preference + eina +) + +INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/include) + +FOREACH(flag ${pkgs_daemon_CFLAGS}) + SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") +ENDFOREACH(flag) + +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE") +SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie") + +FIND_PROGRAM(UNAME NAMES uname) +EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH") +IF("${ARCH}" STREQUAL "arm") + ADD_DEFINITIONS("-DTARGET") + MESSAGE("add -DTARGET") +ENDIF("${ARCH}" STREQUAL "arm") + +ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS}) + +TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_daemon_LDFLAGS}) + +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${TZ_SYS_RO_APP}/org.tizen.${PROJECT_NAME}/bin/) +INSTALL(FILES ${CMAKE_BINARY_DIR}/server/org.tizen.${PROJECT_NAME}.xml DESTINATION ${TZ_SYS_RO_PACKAGES}) diff --git a/server/org.tizen.autofill-daemon.manifest b/server/org.tizen.autofill-daemon.manifest new file mode 100644 index 0000000..017d22d --- /dev/null +++ b/server/org.tizen.autofill-daemon.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/server/org.tizen.autofill-daemon.xml b/server/org.tizen.autofill-daemon.xml new file mode 100644 index 0000000..36ad5ac --- /dev/null +++ b/server/org.tizen.autofill-daemon.xml @@ -0,0 +1,14 @@ + + + + Jihoon Kim + autofill-daemon + + + + + + http://tizen.org/privilege/appmanager.launch + http://tizen.org/privilege/datasharing + + -- 2.7.4 From a1d4d652f6cc94f0084e0a91bebde9dbc0988c3d Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 24 Dec 2018 11:49:51 +0900 Subject: [PATCH 16/16] Change autofill-daemon appid Change-Id: I2a7078a73e2da1f21dfdb2c953e97d59e6b83f6e Signed-off-by: Jihoon Kim --- client/autofill.c | 2 +- manager/autofill_manager.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/autofill.c b/client/autofill.c index 52cfeb0..6318d3d 100644 --- a/client/autofill.c +++ b/client/autofill.c @@ -25,7 +25,7 @@ #include "autofill_private.h" #include "autofill_proxy.h" -#define AUTOFILL_DAEMON_APP_ID "org.tizen.autofill-daemon" +#define AUTOFILL_DAEMON_APP_ID "org.tizen.autofilld" #ifdef LOG_TAG #undef LOG_TAG diff --git a/manager/autofill_manager.c b/manager/autofill_manager.c index a047ba1..e2becfc 100644 --- a/manager/autofill_manager.c +++ b/manager/autofill_manager.c @@ -24,7 +24,7 @@ #include "autofill_manager_proxy.h" #include "../privilege_checker/privilege_checker_private.h" -#define AUTOFILL_DAEMON_APP_ID "org.tizen.autofill-daemon" +#define AUTOFILL_DAEMON_APP_ID "org.tizen.autofilld" #ifdef LOG_TAG #undef LOG_TAG -- 2.7.4