From b7e41d1c93be4625d0a4e3d5ade9aa1a4d85763c Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 22 Jan 2019 17:48:49 +0900 Subject: [PATCH] Fix bug when getting app id in commit callback Change-Id: Icb759d36162d5253a5dce10bdcade05b6ea842f6 Signed-off-by: Jihoon Kim --- service_lib/autofill_service.c | 14 ++++++++++---- tidl/autofill_service.tidl | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/service_lib/autofill_service.c b/service_lib/autofill_service.c index a18ed44..b064dd9 100644 --- a/service_lib/autofill_service.c +++ b/service_lib/autofill_service.c @@ -223,14 +223,17 @@ static void __autofill_fill_request_cb(rpc_port_stub_AutofillSvcPort_context_h c 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; char *view_id = NULL; + + rpc_port_autofill_svc_save_view_info_get_app_id(vi, &app_id); rpc_port_autofill_svc_save_view_info_get_view_id(vi, &view_id); - if (view_id) { - LOGD("view id : %s", view_id); - } + + LOGD("app id : %s, view id : %s", app_id, view_id); autofill_save_view_info_h view_info; autofill_save_view_info_create(&view_info); + autofill_save_view_info_set_app_id(view_info, app_id); autofill_save_view_info_set_view_id(view_info, view_id); rpc_port_autofill_svc_save_view_info_foreach_items(vi, __save_item_cb, view_info); @@ -240,8 +243,11 @@ static void __autofill_commit_cb(rpc_port_stub_AutofillSvcPort_context_h context autofill_save_view_info_destroy(view_info); + if (app_id) { + free(app_id); + } + if (view_id) { - LOGD("view id : %s", view_id); free(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