From 967179cba251e19e19fbe78d1febaff26ad5258b Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 18 Jan 2019 15:54:23 +0900 Subject: [PATCH 01/16] Update package version to 1.0.8 Change-Id: I686b7f41a2dc9813b46ac6e1ae2f3f9fff8d9822 Signed-off-by: Jihoon Kim --- org.tizen.autofilld.xml | 2 +- packaging/org.tizen.autofilld.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.tizen.autofilld.xml b/org.tizen.autofilld.xml index 0972cfc..d976f25 100644 --- a/org.tizen.autofilld.xml +++ b/org.tizen.autofilld.xml @@ -1,5 +1,5 @@ - + Jihoon Kim autofilld diff --git a/packaging/org.tizen.autofilld.spec b/packaging/org.tizen.autofilld.spec index 3d32df8..5e2de85 100644 --- a/packaging/org.tizen.autofilld.spec +++ b/packaging/org.tizen.autofilld.spec @@ -1,6 +1,6 @@ Name: org.tizen.autofilld Summary: Autofill Daemon -Version: 1.0.7 +Version: 1.0.8 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From 0c6c8176810bd31c6b3d62320578f3007f598fb0 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 21 Jan 2019 19:21:32 +0900 Subject: [PATCH 02/16] Fix memory leak Change-Id: Ib930c35f9455682056b17b49d6709bb6dbf071e1 Signed-off-by: Jihoon Kim --- src/autofill-daemon.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/autofill-daemon.c b/src/autofill-daemon.c index 6bfb347..55e8298 100644 --- a/src/autofill-daemon.c +++ b/src/autofill-daemon.c @@ -29,6 +29,8 @@ #include "autofill_config.h" static rpc_port_proxy_AutofillSvcPort_h svc_rpc_h = NULL; +static rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h fill_response_received_cb_h = NULL; +static rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h auth_info_cb_h = NULL; static int connect_service(); @@ -585,8 +587,16 @@ static void __on_connected(rpc_port_proxy_AutofillSvcPort_h h, void *user_data) { LOGI("[__RPC_PORT__] connected"); - rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h fill_response_received_cb_h = rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_create(__fill_response_recv_cb, false, NULL); - rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h auth_info_cb_h = rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_create(__auth_info_recv_cb, false, NULL); + if (fill_response_received_cb_h) { + free(fill_response_received_cb_h); + } + + if (auth_info_cb_h) { + free(auth_info_cb_h); + } + + fill_response_received_cb_h = rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_create(__fill_response_recv_cb, false, NULL); + auth_info_cb_h = rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_create(__auth_info_recv_cb, false, NULL); int r = rpc_port_proxy_AutofillSvcPort_invoke_Register(h, auth_info_cb_h, fill_response_received_cb_h); if (r != 0) @@ -599,6 +609,16 @@ static void __on_disconnected(rpc_port_proxy_AutofillSvcPort_h h, void *user_dat LOGD("disconnected"); svc_rpc_h = NULL; + + if (fill_response_received_cb_h) { + free(fill_response_received_cb_h); + fill_response_received_cb_h = NULL; + } + + if (auth_info_cb_h) { + free(auth_info_cb_h); + auth_info_cb_h = NULL; + } } static void __on_rejected(rpc_port_proxy_AutofillSvcPort_h h, void *user_data) -- 2.7.4 From 2ec7975f4fb68c4f79a7f91347a5f1a438d8dad8 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 22 Jan 2019 17:50:32 +0900 Subject: [PATCH 03/16] Fix bug when getting app id in commit callback Change-Id: I35e6f1e2102515047a4509b6ef3f4c330a8a2c8f Signed-off-by: Jihoon Kim --- src/autofill-daemon.c | 10 ++++++---- tidl/autofill_service.tidl | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/autofill-daemon.c b/src/autofill-daemon.c index 55e8298..804cad4 100644 --- a/src/autofill-daemon.c +++ b/src/autofill-daemon.c @@ -414,16 +414,18 @@ static int __commit_cb(rpc_port_stub_AutofillAppPort_context_h context, int cont } rpc_port_stub_AutofillAppPort_context_get_sender(context, &sender); - if (sender) { - LOGD("sender(%s)", sender); - free(sender); - } rpc_port_autofill_svc_save_view_info_h svi = NULL; if (rpc_port_autofill_svc_save_view_info_create(&svi) != 0) { return 0; } + if (sender) { + rpc_port_autofill_svc_save_view_info_set_app_id(svi, sender); + LOGD("sender(%s)", sender); + free(sender); + } + rpc_port_autofill_save_view_info_get_view_id(vi, &view_id); if (view_id) { LOGD("view id : %s", view_id); diff --git a/tidl/autofill_service.tidl b/tidl/autofill_service.tidl index 43b9d9f..311a411 100644 --- a/tidl/autofill_service.tidl +++ b/tidl/autofill_service.tidl @@ -21,6 +21,7 @@ struct autofill_svc_save_item { } struct autofill_svc_save_view_info { + string app_id; string view_id; list items; } -- 2.7.4 From 471651edcbec9374fc3f71e18e72fb7a451cb5d7 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 22 Jan 2019 17:59:15 +0900 Subject: [PATCH 04/16] Update package version to 1.0.9 Change-Id: Ia916168422a9a016ce38139ae83a9e2e6193d1dc Signed-off-by: Jihoon Kim --- org.tizen.autofilld.xml | 2 +- packaging/org.tizen.autofilld.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.tizen.autofilld.xml b/org.tizen.autofilld.xml index d976f25..4bad5f9 100644 --- a/org.tizen.autofilld.xml +++ b/org.tizen.autofilld.xml @@ -1,5 +1,5 @@ - + Jihoon Kim autofilld diff --git a/packaging/org.tizen.autofilld.spec b/packaging/org.tizen.autofilld.spec index 5e2de85..092399d 100644 --- a/packaging/org.tizen.autofilld.spec +++ b/packaging/org.tizen.autofilld.spec @@ -1,6 +1,6 @@ Name: org.tizen.autofilld Summary: Autofill Daemon -Version: 1.0.8 +Version: 1.0.9 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From e7dc4ea5eadc4ac9f66160b6ad7b8150a4ce8370 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 6 Mar 2019 19:07:38 +0900 Subject: [PATCH 05/16] Remove unused flags Change-Id: I8f78197dc9889d973554ef50391f1b7250aee522 Signed-off-by: Jihoon Kim --- packaging/org.tizen.autofilld.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/org.tizen.autofilld.spec b/packaging/org.tizen.autofilld.spec index 092399d..b7aa945 100644 --- a/packaging/org.tizen.autofilld.spec +++ b/packaging/org.tizen.autofilld.spec @@ -47,7 +47,7 @@ export FFLAGS+=" -DTIZEN_DEBUG_ENABLE -fvisibility=hidden" rm -rf CMakeFiles rm -rf CMakeCache.txt MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` -cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DLIB_INSTALL_DIR:PATH=%{_libdir} \ +cmake . -DCMAKE_INSTALL_PREFIX=/usr \ -DTZ_SYS_RO_APP=%TZ_SYS_RO_APP -DTZ_SYS_RO_PACKAGES=%TZ_SYS_RO_PACKAGES make %{?jobs:-j%jobs} -- 2.7.4 From d16ac0723cb9c949aacc33baa713d46533c87ac3 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 14 Mar 2019 09:56:29 +0900 Subject: [PATCH 06/16] API to send autofill error Change-Id: Id7ed03b3465761660a328ee56136ff76e8681ac5 Signed-off-by: Jihoon Kim --- src/autofill-daemon.c | 69 +++++++++++++++++++++++++++++++++++++++++++--- tidl/autofill.tidl | 9 +++++- tidl/autofill_service.tidl | 9 +++++- 3 files changed, 81 insertions(+), 6 deletions(-) diff --git a/src/autofill-daemon.c b/src/autofill-daemon.c index 804cad4..7466701 100644 --- a/src/autofill-daemon.c +++ b/src/autofill-daemon.c @@ -31,6 +31,7 @@ static rpc_port_proxy_AutofillSvcPort_h svc_rpc_h = NULL; static rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h fill_response_received_cb_h = NULL; static rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h auth_info_cb_h = NULL; +static rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_h error_info_cb_h = NULL; static int connect_service(); @@ -40,6 +41,7 @@ typedef struct { rpc_port_AutofillAppPort_autofill_auth_info_received_cb_h auth_info_cb; rpc_port_AutofillAppPort_autofill_fill_response_received_cb_h fill_response_received_cb; + rpc_port_AutofillAppPort_autofill_error_info_received_cb_h error_info_cb; } autofill_client_s; static GList *__client_list = NULL; @@ -72,7 +74,8 @@ get_autofill_client(const char *app_id, int context_id) static autofill_client_s *__create_client(const char *app_id, int context_id, rpc_port_AutofillAppPort_autofill_auth_info_received_cb_h auth_info_cb, - rpc_port_AutofillAppPort_autofill_fill_response_received_cb_h fill_response_received_cb) + rpc_port_AutofillAppPort_autofill_fill_response_received_cb_h fill_response_received_cb, + rpc_port_AutofillAppPort_autofill_error_info_received_cb_h error_info_cb) { LOGD(""); autofill_client_s *handle; @@ -110,6 +113,14 @@ static autofill_client_s *__create_client(const char *app_id, int context_id, return NULL; } + rpc_port_AutofillAppPort_autofill_error_info_received_cb_clone(error_info_cb, &handle->error_info_cb); + if (!handle->error_info_cb) { + LOGE("Out of memory"); + free(handle->app_id); + free(handle); + return NULL; + } + return handle; } @@ -131,6 +142,11 @@ static void __destroy_client(gpointer data) handle->fill_response_received_cb = NULL; } + if (handle->error_info_cb) { + rpc_port_AutofillAppPort_autofill_error_info_received_cb_destroy(handle->error_info_cb); + handle->error_info_cb = NULL; + } + if (handle->app_id) { free(handle->app_id); handle->app_id = NULL; @@ -184,7 +200,12 @@ static void __message_terminate(rpc_port_stub_AutofillAppPort_context_h context, __remove_client(context); } -static int __message_register(rpc_port_stub_AutofillAppPort_context_h context, int context_id, rpc_port_AutofillAppPort_autofill_auth_info_received_cb_h auth_info_cb, rpc_port_AutofillAppPort_autofill_fill_response_received_cb_h fill_response_received_cb, void *user_data) +static int __message_register(rpc_port_stub_AutofillAppPort_context_h context, + int context_id, + rpc_port_AutofillAppPort_autofill_auth_info_received_cb_h auth_info_cb, + rpc_port_AutofillAppPort_autofill_fill_response_received_cb_h fill_response_received_cb, + rpc_port_AutofillAppPort_autofill_error_info_received_cb_h error_info_cb, + void *user_data) { LOGD(""); char *sender = NULL; @@ -196,7 +217,7 @@ static int __message_register(rpc_port_stub_AutofillAppPort_context_h context, i LOGD("sender(%s)", sender); - client = __create_client(sender, context_id, auth_info_cb, fill_response_received_cb); + client = __create_client(sender, context_id, auth_info_cb, fill_response_received_cb, error_info_cb); free(sender); if (!client) @@ -585,6 +606,36 @@ static void __auth_info_recv_cb(void *user_data, int context_id, rpc_port_autofi free(service_message); } +static void __error_info_recv_cb(void *user_data, int context_id, rpc_port_autofill_svc_error_info_h svc_error_info_h) +{ + char *app_id = NULL; + char *error_message = NULL; + int error_code = 0; + + rpc_port_autofill_svc_error_info_get_app_id(svc_error_info_h, &app_id); + rpc_port_autofill_svc_error_info_get_error_code(svc_error_info_h, &error_code); + rpc_port_autofill_svc_error_info_get_error_message(svc_error_info_h, &error_message); + + /* transfer error info */ + rpc_port_autofill_error_info_h error_info_h = NULL; + rpc_port_autofill_error_info_create(&error_info_h); + rpc_port_autofill_error_info_set_app_id(error_info_h, app_id); + rpc_port_autofill_error_info_set_error_code(error_info_h, error_code); + rpc_port_autofill_error_info_set_error_message(error_info_h, error_message); + + autofill_client_s *sender_client = get_autofill_client(app_id, context_id); + if (sender_client) + rpc_port_AutofillAppPort_autofill_error_info_received_cb_invoke(sender_client->error_info_cb, error_info_h); + + LOGD("error code : %d, message : %s", error_code, error_message); + + if (app_id) + free(app_id); + + if (error_message) + free(error_message); +} + static void __on_connected(rpc_port_proxy_AutofillSvcPort_h h, void *user_data) { LOGI("[__RPC_PORT__] connected"); @@ -597,10 +648,15 @@ static void __on_connected(rpc_port_proxy_AutofillSvcPort_h h, void *user_data) free(auth_info_cb_h); } + if (error_info_cb_h) { + free(error_info_cb_h); + } + fill_response_received_cb_h = rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_create(__fill_response_recv_cb, false, NULL); auth_info_cb_h = rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_create(__auth_info_recv_cb, false, NULL); + error_info_cb_h = rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_create(__error_info_recv_cb, false, NULL); - int r = rpc_port_proxy_AutofillSvcPort_invoke_Register(h, auth_info_cb_h, fill_response_received_cb_h); + int r = rpc_port_proxy_AutofillSvcPort_invoke_Register(h, auth_info_cb_h, fill_response_received_cb_h, error_info_cb_h); if (r != 0) LOGD("Failed to invoke Register"); } @@ -621,6 +677,11 @@ static void __on_disconnected(rpc_port_proxy_AutofillSvcPort_h h, void *user_dat free(auth_info_cb_h); auth_info_cb_h = NULL; } + + if (error_info_cb_h) { + free(error_info_cb_h); + error_info_cb_h = NULL; + } } static void __on_rejected(rpc_port_proxy_AutofillSvcPort_h h, void *user_data) diff --git a/tidl/autofill.tidl b/tidl/autofill.tidl index 6f4ccac..c44c301 100644 --- a/tidl/autofill.tidl +++ b/tidl/autofill.tidl @@ -51,10 +51,17 @@ struct autofill_fill_response { list response_groups; } +struct autofill_error_info { + string app_id; + int error_code; + string error_message; +} + interface AutofillAppPort { void autofill_auth_info_received_cb(autofill_auth_info auth_info) delegate; void autofill_fill_response_received_cb(autofill_fill_response response) delegate; - int Register(int context_id, autofill_auth_info_received_cb auth_info_cb, autofill_fill_response_received_cb fill_response_cb); + void autofill_error_info_received_cb(autofill_error_info error_info) delegate; + int Register(int context_id, autofill_auth_info_received_cb auth_info_cb, autofill_fill_response_received_cb fill_response_cb, autofill_error_info_received_cb error_info_cb); void Unregister(int context_id) async; int request_auth_info(int context_id, autofill_view_info vi); diff --git a/tidl/autofill_service.tidl b/tidl/autofill_service.tidl index 311a411..bd89003 100644 --- a/tidl/autofill_service.tidl +++ b/tidl/autofill_service.tidl @@ -53,10 +53,17 @@ struct autofill_svc_fill_response { list response_groups; } +struct autofill_svc_error_info { + string app_id; + int error_code; + string error_message; +} + interface AutofillSvcPort { void autofill_svc_auth_info_cb(int context_id, autofill_svc_auth_info auth_info) delegate; void autofill_svc_fill_response_cb(int context_id, autofill_svc_fill_response response) delegate; - int Register(autofill_svc_auth_info_cb auth_info_cb, autofill_svc_fill_response_cb fill_response_cb); + void autofill_svc_send_error_cb(int context_id, autofill_svc_error_info error_info) delegate; + int Register(autofill_svc_auth_info_cb auth_info_cb, autofill_svc_fill_response_cb fill_response_cb, autofill_svc_send_error_cb send_error_cb); void Unregister() async; void request_auth_info(int context_id, autofill_svc_view_info vi) async; -- 2.7.4 From 8482ef0569981d4221a7271fb286a19eddcea449 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 14 Mar 2019 10:37:21 +0900 Subject: [PATCH 07/16] Update package version to 1.0.10 Change-Id: I4267d559a1ee3d2a0f314da71daa527de96bde95 Signed-off-by: Jihoon Kim --- org.tizen.autofilld.xml | 2 +- packaging/org.tizen.autofilld.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.tizen.autofilld.xml b/org.tizen.autofilld.xml index 4bad5f9..f5b8b20 100644 --- a/org.tizen.autofilld.xml +++ b/org.tizen.autofilld.xml @@ -1,5 +1,5 @@ - + Jihoon Kim autofilld diff --git a/packaging/org.tizen.autofilld.spec b/packaging/org.tizen.autofilld.spec index b7aa945..b7320b6 100644 --- a/packaging/org.tizen.autofilld.spec +++ b/packaging/org.tizen.autofilld.spec @@ -1,6 +1,6 @@ Name: org.tizen.autofilld Summary: Autofill Daemon -Version: 1.0.9 +Version: 1.0.10 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From 37863ced603ecd8273ad326937b7931b9a78fe06 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 14 Mar 2019 11:02:30 +0900 Subject: [PATCH 08/16] Change API version Change-Id: I657f3fab476e54e15cb4f8bef64ccd27acce7503 Signed-off-by: Jihoon Kim --- org.tizen.autofilld.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.tizen.autofilld.xml b/org.tizen.autofilld.xml index f5b8b20..451cef8 100644 --- a/org.tizen.autofilld.xml +++ b/org.tizen.autofilld.xml @@ -1,5 +1,5 @@ - + Jihoon Kim autofilld -- 2.7.4 From 1a447d2616943a169a79f56b42454b11507994f9 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 18 Mar 2019 10:25:58 +0900 Subject: [PATCH 09/16] Fix memory leak issue Dynamic memory referenced by 'handle->auth_info_cb' was allocated at autofill_stub.c:3925 by calling function 'rpc_port_AutofillAppPort_autofill_auth_info_received_cb_clone' at autofill-daemon.c:98 and lost at autofill-daemon.c:121. Change-Id: Ie3bbba42a1dab3688c3d409b6f3374a35335d9f7 Signed-off-by: Jihoon Kim --- src/autofill-daemon.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/autofill-daemon.c b/src/autofill-daemon.c index 7466701..34b78a5 100644 --- a/src/autofill-daemon.c +++ b/src/autofill-daemon.c @@ -117,6 +117,8 @@ static autofill_client_s *__create_client(const char *app_id, int context_id, if (!handle->error_info_cb) { LOGE("Out of memory"); free(handle->app_id); + rpc_port_AutofillAppPort_autofill_auth_info_received_cb_destroy(handle->auth_info_cb); + rpc_port_AutofillAppPort_autofill_fill_response_received_cb_destroy(handle->fill_response_received_cb); free(handle); return NULL; } -- 2.7.4 From f5be04e9b04887a298fd5fa079db3a5dc239f2da Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 18 Mar 2019 10:45:01 +0900 Subject: [PATCH 10/16] Update package version to 1.0.11 Change-Id: I85a7549427e1efa53658435b03edb581e5a0cd6e Signed-off-by: Jihoon Kim --- org.tizen.autofilld.xml | 2 +- packaging/org.tizen.autofilld.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.tizen.autofilld.xml b/org.tizen.autofilld.xml index 451cef8..a82cf85 100644 --- a/org.tizen.autofilld.xml +++ b/org.tizen.autofilld.xml @@ -1,5 +1,5 @@ - + Jihoon Kim autofilld diff --git a/packaging/org.tizen.autofilld.spec b/packaging/org.tizen.autofilld.spec index b7320b6..ce9db40 100644 --- a/packaging/org.tizen.autofilld.spec +++ b/packaging/org.tizen.autofilld.spec @@ -1,6 +1,6 @@ Name: org.tizen.autofilld Summary: Autofill Daemon -Version: 1.0.10 +Version: 1.0.11 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From cf071fb4e7acc451fe67c40258252f8adaef107f Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 19 Mar 2019 16:51:42 +0900 Subject: [PATCH 11/16] Remove code to support error message Change-Id: I0e90b481ae256b6fd052d39822b101d7b1f6ccd3 Signed-off-by: Jihoon Kim --- src/autofill-daemon.c | 8 +------- tidl/autofill.tidl | 1 - tidl/autofill_service.tidl | 1 - 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/autofill-daemon.c b/src/autofill-daemon.c index 34b78a5..e1f1047 100644 --- a/src/autofill-daemon.c +++ b/src/autofill-daemon.c @@ -611,31 +611,25 @@ static void __auth_info_recv_cb(void *user_data, int context_id, rpc_port_autofi static void __error_info_recv_cb(void *user_data, int context_id, rpc_port_autofill_svc_error_info_h svc_error_info_h) { char *app_id = NULL; - char *error_message = NULL; int error_code = 0; rpc_port_autofill_svc_error_info_get_app_id(svc_error_info_h, &app_id); rpc_port_autofill_svc_error_info_get_error_code(svc_error_info_h, &error_code); - rpc_port_autofill_svc_error_info_get_error_message(svc_error_info_h, &error_message); /* transfer error info */ rpc_port_autofill_error_info_h error_info_h = NULL; rpc_port_autofill_error_info_create(&error_info_h); rpc_port_autofill_error_info_set_app_id(error_info_h, app_id); rpc_port_autofill_error_info_set_error_code(error_info_h, error_code); - rpc_port_autofill_error_info_set_error_message(error_info_h, error_message); autofill_client_s *sender_client = get_autofill_client(app_id, context_id); if (sender_client) rpc_port_AutofillAppPort_autofill_error_info_received_cb_invoke(sender_client->error_info_cb, error_info_h); - LOGD("error code : %d, message : %s", error_code, error_message); + LOGD("error code : %x", error_code); if (app_id) free(app_id); - - if (error_message) - free(error_message); } static void __on_connected(rpc_port_proxy_AutofillSvcPort_h h, void *user_data) diff --git a/tidl/autofill.tidl b/tidl/autofill.tidl index c44c301..fbf53b4 100644 --- a/tidl/autofill.tidl +++ b/tidl/autofill.tidl @@ -54,7 +54,6 @@ struct autofill_fill_response { struct autofill_error_info { string app_id; int error_code; - string error_message; } interface AutofillAppPort { diff --git a/tidl/autofill_service.tidl b/tidl/autofill_service.tidl index bd89003..31a4809 100644 --- a/tidl/autofill_service.tidl +++ b/tidl/autofill_service.tidl @@ -56,7 +56,6 @@ struct autofill_svc_fill_response { struct autofill_svc_error_info { string app_id; int error_code; - string error_message; } interface AutofillSvcPort { -- 2.7.4 From 136d8e737863944f262f2a99421ca73104976ace Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 19 Mar 2019 19:07:13 +0900 Subject: [PATCH 12/16] Update package version to 1.0.12 Change-Id: Ib63a59b3c625ee4fac47118f32c339300ea17dec Signed-off-by: Jihoon Kim --- org.tizen.autofilld.xml | 2 +- packaging/org.tizen.autofilld.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.tizen.autofilld.xml b/org.tizen.autofilld.xml index a82cf85..004d1d6 100644 --- a/org.tizen.autofilld.xml +++ b/org.tizen.autofilld.xml @@ -1,5 +1,5 @@ - + Jihoon Kim autofilld diff --git a/packaging/org.tizen.autofilld.spec b/packaging/org.tizen.autofilld.spec index ce9db40..8d009c6 100644 --- a/packaging/org.tizen.autofilld.spec +++ b/packaging/org.tizen.autofilld.spec @@ -1,6 +1,6 @@ Name: org.tizen.autofilld Summary: Autofill Daemon -Version: 1.0.11 +Version: 1.0.12 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From ffb7748d62ccce9006a995eb0f35d59e5039ed56 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 5 Apr 2019 20:10:46 +0900 Subject: [PATCH 13/16] Make no sleep as daemon Change-Id: Ie2191eb59d059270f65882e570837ba1cfba34da Signed-off-by: Jihoon Kim --- org.tizen.autofilld.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/org.tizen.autofilld.xml b/org.tizen.autofilld.xml index 004d1d6..9b12481 100644 --- a/org.tizen.autofilld.xml +++ b/org.tizen.autofilld.xml @@ -6,6 +6,7 @@ + http://tizen.org/privilege/appmanager.launch -- 2.7.4 From 2a8c0acd3064b280f2299361d17d7d50e2074818 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 5 Apr 2019 20:14:17 +0900 Subject: [PATCH 14/16] Change the method to show error code Change-Id: Iafd993fc231974afd350222d888067a4ce4bdacb Signed-off-by: Jihoon Kim --- src/autofill-daemon.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/autofill-daemon.c b/src/autofill-daemon.c index e1f1047..9abe0e5 100644 --- a/src/autofill-daemon.c +++ b/src/autofill-daemon.c @@ -626,7 +626,7 @@ static void __error_info_recv_cb(void *user_data, int context_id, rpc_port_autof if (sender_client) rpc_port_AutofillAppPort_autofill_error_info_received_cb_invoke(sender_client->error_info_cb, error_info_h); - LOGD("error code : %x", error_code); + LOGD("error code : %#x, message : '%s'", error_code, get_error_message(error_code)); if (app_id) free(app_id); @@ -634,7 +634,7 @@ static void __error_info_recv_cb(void *user_data, int context_id, rpc_port_autof static void __on_connected(rpc_port_proxy_AutofillSvcPort_h h, void *user_data) { - LOGI("[__RPC_PORT__] connected"); + LOGI("Autofill service connected"); if (fill_response_received_cb_h) { free(fill_response_received_cb_h); @@ -699,7 +699,7 @@ static bool __manager_set_autofill_service_cb(rpc_port_stub_AutofillManagerPort_ rpc_port_proxy_AutofillSvcPort_invoke_request_terminate(svc_rpc_h); int ret = rpc_port_proxy_AutofillSvcPort_destroy(svc_rpc_h); - LOGD("ret : %d", ret); + LOGD("ret : %#x", ret); } svc_rpc_h = NULL; @@ -731,7 +731,7 @@ bool add_autofill_service_cb(app_info_h app_info, void *user_data) int ret = app_info_get_app_id(app_info, &app_id); if (ret != APP_MANAGER_ERROR_NONE) { - LOGW("app_info_get_app_id failed (%d)", ret); + LOGW("app_info_get_app_id failed (%#x)", ret); return true; } @@ -754,14 +754,14 @@ static bool __manager_get_autofill_service_list_cb(rpc_port_stub_AutofillManager // Get the Autofill service list ret = app_info_metadata_filter_create(&handle); if (ret != APP_MANAGER_ERROR_NONE) { - LOGW("app_info_metadata_filter_create failed (%d)", ret); + LOGW("app_info_metadata_filter_create failed (%#x)", ret); app_info_metadata_filter_destroy(handle); return false; } ret = app_info_metadata_filter_add(handle, "autofill-service", "true"); if (ret != APP_MANAGER_ERROR_NONE) { - LOGW("app_info_metadata_filter_add failed (%d)", ret); + LOGW("app_info_metadata_filter_add failed (%#x)", ret); app_info_metadata_filter_destroy(handle); return false; } @@ -771,7 +771,7 @@ static bool __manager_get_autofill_service_list_cb(rpc_port_stub_AutofillManager ret = app_info_metadata_filter_foreach(handle, add_autofill_service_cb, app_id_list_h); if (ret != APP_MANAGER_ERROR_NONE) { - LOGW("app_info_metadata_filter_foreach failed (%d)", ret); + LOGW("app_info_metadata_filter_foreach failed (%#x)", ret); } *service_info_list = app_id_list_h; @@ -800,7 +800,7 @@ static int connect_service() char *active_autofill_service_id = NULL; bool sys_config = false; autofill_config_get_autofill_service_app_id(&active_autofill_service_id, &sys_config); - LOGD("autofill service : '%s'", active_autofill_service_id); + LOGD("active autofill service app id: '%s'", active_autofill_service_id); if (!active_autofill_service_id) { active_autofill_service_id = strdup(AUTOFILL_SERVICE_APP_ID); @@ -823,14 +823,14 @@ static int connect_service() } if (ret != RPC_PORT_ERROR_NONE) { - LOGW("Failed to create rpc port. err = %d", ret); + LOGW("Failed to create rpc port. err = %#x", ret); return false; } } ret = rpc_port_proxy_AutofillSvcPort_connect(svc_rpc_h); if (ret != RPC_PORT_ERROR_NONE) { - LOGW("Failed to connect. err = %d", ret); + LOGW("Failed to connect. err = %#x", ret); return false; } -- 2.7.4 From 3c4047851cd5a66cb55a81cee37c96114f00f7d1 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 5 Apr 2019 20:30:39 +0900 Subject: [PATCH 15/16] Retry to connect when autofill service is disconnected Change-Id: I03feac914d8510cf36ed0def365a6c505fb145df Signed-off-by: Jihoon Kim --- CMakeLists.txt | 1 + packaging/org.tizen.autofilld.spec | 1 + src/autofill-daemon.c | 82 +++++++++++++++++++++++++++----------- 3 files changed, 60 insertions(+), 24 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7eca8bf..a7613bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,7 @@ pkg_check_modules(pkgs_test REQUIRED rpc-port glib-2.0 eina + ecore capi-appfw-service-application capi-appfw-app-manager capi-appfw-preference diff --git a/packaging/org.tizen.autofilld.spec b/packaging/org.tizen.autofilld.spec index 8d009c6..ffe4aab 100644 --- a/packaging/org.tizen.autofilld.spec +++ b/packaging/org.tizen.autofilld.spec @@ -12,6 +12,7 @@ BuildRequires: pkgconfig(libtzplatform-config) BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(efl) BuildRequires: pkgconfig(eina) +BuildRequires: pkgconfig(ecore) BuildRequires: pkgconfig(rpc-port) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(capi-appfw-service-application) diff --git a/src/autofill-daemon.c b/src/autofill-daemon.c index 9abe0e5..097c86b 100644 --- a/src/autofill-daemon.c +++ b/src/autofill-daemon.c @@ -21,6 +21,7 @@ #include #include #include +#include #include "autofill_daemon_dlog.h" #include "autofill_stub.h" @@ -33,8 +34,6 @@ static rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h fill_response_re static rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h auth_info_cb_h = NULL; static rpc_port_AutofillSvcPort_autofill_svc_send_error_cb_h error_info_cb_h = NULL; -static int connect_service(); - typedef struct { char *app_id; int context_id; @@ -45,6 +44,9 @@ typedef struct { } autofill_client_s; static GList *__client_list = NULL; +static Ecore_Timer *g_connect_timer = NULL; + +static bool connect_service(); static autofill_client_s * get_autofill_client(const char *app_id, int context_id) @@ -636,6 +638,11 @@ static void __on_connected(rpc_port_proxy_AutofillSvcPort_h h, void *user_data) { LOGI("Autofill service connected"); + if (g_connect_timer) { + ecore_timer_del(g_connect_timer); + g_connect_timer = NULL; + } + if (fill_response_received_cb_h) { free(fill_response_received_cb_h); } @@ -657,10 +664,20 @@ static void __on_connected(rpc_port_proxy_AutofillSvcPort_h h, void *user_data) LOGD("Failed to invoke Register"); } +static Eina_Bool connect_timer_cb(void *data) +{ + if (connect_service()) { + g_connect_timer = NULL; + return ECORE_CALLBACK_CANCEL; + } + + return ECORE_CALLBACK_RENEW; +} + //LCOV_EXCL_START static void __on_disconnected(rpc_port_proxy_AutofillSvcPort_h h, void *user_data) { - LOGD("disconnected"); + LOGW("Autofill service is disconnected"); svc_rpc_h = NULL; @@ -678,6 +695,14 @@ static void __on_disconnected(rpc_port_proxy_AutofillSvcPort_h h, void *user_dat free(error_info_cb_h); error_info_cb_h = NULL; } + + // try to connect again + if (!connect_service()) { + if (g_connect_timer) + ecore_timer_del(g_connect_timer); + + g_connect_timer = ecore_timer_add(1.0, connect_timer_cb, NULL); + } } static void __on_rejected(rpc_port_proxy_AutofillSvcPort_h h, void *user_data) @@ -781,10 +806,12 @@ static bool __manager_get_autofill_service_list_cb(rpc_port_stub_AutofillManager return true; } -static int connect_service() +static bool connect_service() { int ret; size_t service_id_len = 0; + char *active_autofill_service_id = NULL; + bool sys_config = false; rpc_port_proxy_AutofillSvcPort_callback_s rpc_callback = { .connected = __on_connected, @@ -794,11 +821,10 @@ static int connect_service() if (svc_rpc_h) { LOGI("already connected\n"); - return RPC_PORT_ERROR_NONE; + return true; } - char *active_autofill_service_id = NULL; - bool sys_config = false; + LOGD("get autofill service app id..."); autofill_config_get_autofill_service_app_id(&active_autofill_service_id, &sys_config); LOGD("active autofill service app id: '%s'", active_autofill_service_id); @@ -806,35 +832,38 @@ static int connect_service() active_autofill_service_id = strdup(AUTOFILL_SERVICE_APP_ID); } - if (active_autofill_service_id) { - if (!sys_config) - autofill_config_set_autofill_service_app_id(active_autofill_service_id); + if (!active_autofill_service_id) + return false; - service_id_len = strlen(active_autofill_service_id); + if (!sys_config) + autofill_config_set_autofill_service_app_id(active_autofill_service_id); - if (service_id_len > 0) { - ret = rpc_port_proxy_AutofillSvcPort_create(active_autofill_service_id, &rpc_callback, NULL, &svc_rpc_h); - } - free(active_autofill_service_id); + service_id_len = strlen(active_autofill_service_id); - if (service_id_len == 0) { - LOGD("No Autofill service to connect"); - return false; - } + if (service_id_len > 0) { + ret = rpc_port_proxy_AutofillSvcPort_create(active_autofill_service_id, &rpc_callback, NULL, &svc_rpc_h); + } + else if (service_id_len == 0) { + LOGD("No Autofill service to connect"); + free(active_autofill_service_id); + return false; + } - if (ret != RPC_PORT_ERROR_NONE) { - LOGW("Failed to create rpc port. err = %#x", ret); - return false; - } + if (ret != RPC_PORT_ERROR_NONE) { + LOGW("Failed to create rpc port. err = %#x", ret); + free(active_autofill_service_id); + return false; } + LOGD("Connect to autofill service: '%s'", active_autofill_service_id); + free(active_autofill_service_id); ret = rpc_port_proxy_AutofillSvcPort_connect(svc_rpc_h); if (ret != RPC_PORT_ERROR_NONE) { LOGW("Failed to connect. err = %#x", ret); return false; } - return ret; + return true; } bool service_app_create(void *data) @@ -890,6 +919,11 @@ void service_app_terminate(void *data) __client_list = NULL; } + if (g_connect_timer) { + ecore_timer_del(g_connect_timer); + g_connect_timer = NULL; + } + rpc_port_stub_AutofillAppPort_unregister(); return; -- 2.7.4 From 6d9d2f180d32d61e16f5e4d5818c233eb48f1daa Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 8 Apr 2019 14:46:13 +0900 Subject: [PATCH 16/16] Update package version to 1.0.13 Change-Id: I46b267662cbbd84339c1871b893913497a8d1fc9 Signed-off-by: Jihoon Kim --- org.tizen.autofilld.xml | 2 +- packaging/org.tizen.autofilld.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.tizen.autofilld.xml b/org.tizen.autofilld.xml index 9b12481..29f1026 100644 --- a/org.tizen.autofilld.xml +++ b/org.tizen.autofilld.xml @@ -1,5 +1,5 @@ - + Jihoon Kim autofilld diff --git a/packaging/org.tizen.autofilld.spec b/packaging/org.tizen.autofilld.spec index ffe4aab..696105e 100644 --- a/packaging/org.tizen.autofilld.spec +++ b/packaging/org.tizen.autofilld.spec @@ -1,6 +1,6 @@ Name: org.tizen.autofilld Summary: Autofill Daemon -Version: 1.0.12 +Version: 1.0.13 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4