From a1d4d652f6cc94f0084e0a91bebde9dbc0988c3d Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 24 Dec 2018 11:49:51 +0900 Subject: [PATCH 01/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 From ab07a95fcdb6048a0b39bb71209381e54db20ca8 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 24 Dec 2018 11:50:39 +0900 Subject: [PATCH 02/16] Update package version to 0.1.13 Change-Id: Ife18c0679ccbe5236b75cb7007c5f05056efefa1 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 009e7d7..40e9498 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.12 +Version: 0.1.13 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From 74b7b364c952342126d6786f2632653fea0f1177 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 26 Dec 2018 08:00:17 +0900 Subject: [PATCH 03/16] Remove on-boot option in autofill daemon Change-Id: I9723d3f6dd2f5df206ebc65d887a03a17c746ac9 Signed-off-by: Jihoon Kim --- server/org.tizen.autofill-daemon.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/org.tizen.autofill-daemon.xml b/server/org.tizen.autofill-daemon.xml index 36ad5ac..fd959f2 100644 --- a/server/org.tizen.autofill-daemon.xml +++ b/server/org.tizen.autofill-daemon.xml @@ -3,7 +3,7 @@ Jihoon Kim autofill-daemon - + -- 2.7.4 From e32cb6e7c6b41b5d687bb0cd5d3a5d841f29f479 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 26 Dec 2018 08:00:46 +0900 Subject: [PATCH 04/16] Update package version to 0.1.14 Change-Id: I1ed1cbe10239b28e0d1e782f3428e981b280eb26 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 40e9498..2e58553 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.13 +Version: 0.1.14 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From 74f43c5732f17020a6bda8804af712a51de4b1d5 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 19 Nov 2018 15:58:45 +0900 Subject: [PATCH 05/16] Remove org.tizen.autofill-daemon org.tizen.autofill-daemon is replaced by org.tizen.autofilld. org.tizen.autofilld is located in other git repository for ABS build. Change-Id: I8302b5572ab2435dd875a91cd165d06fc49b5a83 --- CMakeLists.txt | 8 - packaging/capi-ui-autofill.spec | 29 +- server/CMakeLists.txt | 43 -- server/autofill_config.c | 111 ---- server/autofill_config.h | 39 -- server/main.c | 868 ------------------------------ server/org.tizen.autofill-daemon.manifest | 5 - server/org.tizen.autofill-daemon.xml | 14 - 8 files changed, 1 insertion(+), 1116 deletions(-) delete mode 100644 server/CMakeLists.txt delete mode 100644 server/autofill_config.c delete mode 100644 server/autofill_config.h delete mode 100644 server/main.c 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/packaging/capi-ui-autofill.spec b/packaging/capi-ui-autofill.spec index 2e58553..aad7931 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/autofill_config.c b/server/autofill_config.c deleted file mode 100644 index c891f2b..0000000 --- a/server/autofill_config.c +++ /dev/null @@ -1,111 +0,0 @@ - /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include -#include -#include -#include - -#include "autofill_config.h" - -#ifdef LOG_TAG -#undef LOG_TAG -#endif -#define LOG_TAG "AUTOFILL_DAEMON" - -#define SETTING_ACTIVE_AUTOFILL_SERVICE "ActiveAutofillService" -#define AUTOFILL_SYSTEM_CONFIG_FILE "/etc/autofill/config" - -bool autofill_config_get_autofill_service_app_id(char **app_id) -{ - char *active_autofill_service_id = NULL; - FILE *pFile = NULL; - Eina_Strbuf *sb_key = NULL, *sb_value = NULL; - const char *key_str = NULL; - const char *value_str = NULL; - bool ret = false; - char strTemp[1024]; - - if (preference_get_string(SETTING_ACTIVE_AUTOFILL_SERVICE, &active_autofill_service_id) == PREFERENCE_ERROR_NONE) { - LOGD("preference active autofill service : %s", active_autofill_service_id); - *app_id = active_autofill_service_id; - return true; - } - - LOGD("Read from config"); - - pFile = fopen(AUTOFILL_SYSTEM_CONFIG_FILE, "r"); - if (pFile == NULL) - return false; - - while (fgets(strTemp, sizeof(strTemp), pFile) != NULL) - { - char **result_arr = eina_str_split(strTemp, "=", 0); - if (!result_arr) - continue; - - if (!result_arr[0]) { - free(result_arr); - continue; - } - - sb_key = eina_strbuf_new(); - eina_strbuf_append(sb_key, result_arr[0]); - eina_strbuf_trim(sb_key); - - key_str = eina_strbuf_string_get(sb_key); - if (key_str) { - if (strcmp(key_str, SETTING_ACTIVE_AUTOFILL_SERVICE) == 0) { - if (result_arr[1]) { - sb_value = eina_strbuf_new(); - eina_strbuf_append(sb_value, result_arr[1]); - eina_strbuf_trim(sb_value); - value_str = eina_strbuf_string_get(sb_value); - - if (app_id && value_str) { - *app_id = strdup(value_str); - ret = true; - } - - eina_strbuf_free(sb_value); - } - } - eina_strbuf_free(sb_key); - } - - /* Free the memory */ - free(result_arr[0]); - free(result_arr); - - if (ret) - break; - } /* end of while */ - - fclose(pFile); - - return ret; -} - -bool autofill_config_set_autofill_service_app_id(const char *app_id) -{ - if (preference_set_string(SETTING_ACTIVE_AUTOFILL_SERVICE, app_id) == PREFERENCE_ERROR_NONE) - return true; - - return false; -} - diff --git a/server/autofill_config.h b/server/autofill_config.h deleted file mode 100644 index 57eb00e..0000000 --- a/server/autofill_config.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __AUTOFILL_CONFIG_H__ -#define __AUTOFILL_CONFIG_H__ - -#include - -#define AUTOFILL_SERVICE_APP_ID "org.tizen.autofill-service" - -#ifdef __cplusplus -extern "C" { -#endif - -bool autofill_config_get_autofill_service_app_id(char **app_id); -bool autofill_config_set_autofill_service_app_id(const char *app_id); - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __AUTOFILL_CONFIG_H__ */ diff --git a/server/main.c b/server/main.c deleted file mode 100644 index d1ac10a..0000000 --- a/server/main.c +++ /dev/null @@ -1,868 +0,0 @@ - /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include -#include -#include -#include -#include - -#include "autofill_stub.h" -#include "autofill_service_proxy.h" -#include "autofill_manager_stub.h" -#include "autofill_config.h" - -#ifdef LOG_TAG -#undef LOG_TAG -#endif -#define LOG_TAG "AUTOFILL_DAEMON" - - -static rpc_port_proxy_AutofillSvcPort_h svc_rpc_h = NULL; - -static int connect_service(); - -typedef struct { - 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; -} autofill_client_s; - -static GList *__client_list = NULL; - -static autofill_client_s * -get_autofill_client(const char *app_id, int context_id) -{ - GList *iter; - autofill_client_s *client; - - iter = __client_list; - while (iter) { - client = iter->data; - - iter = g_list_next(iter); - - if (!client) { - LOGW("Warning: value is NULL"); - continue; - } - - if ((client->context_id == context_id) && - client->app_id && strcmp(client->app_id, app_id) == 0) { - return client; - } - } - - return NULL; -} - -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) -{ - LOGD(""); - autofill_client_s *handle; - - handle = calloc(1, sizeof(autofill_client_s)); - if (!handle) { - LOGE("Out of memory"); - return NULL; - } - - handle->app_id = strdup(app_id); - if (!handle->app_id) { - LOGE("Out of memory"); - free(handle); - return NULL; - } - - handle->context_id = context_id; - - rpc_port_AutofillAppPort_autofill_auth_info_received_cb_clone(auth_info_cb, &handle->auth_info_cb); - if (!handle->auth_info_cb) { - LOGE("Out of memory"); - free(handle->app_id); - free(handle); - return NULL; - } - - rpc_port_AutofillAppPort_autofill_fill_response_received_cb_clone(fill_response_received_cb, &handle->fill_response_received_cb); - - if (!handle->fill_response_received_cb) { - LOGE("Out of memory"); - free(handle->app_id); - rpc_port_AutofillAppPort_autofill_auth_info_received_cb_destroy(handle->auth_info_cb); - free(handle); - return NULL; - } - - return handle; -} - -static void __destroy_client(gpointer data) -{ - LOGD(""); - autofill_client_s *handle = data; - - if (!handle) - return; - - if (handle->auth_info_cb) { - rpc_port_AutofillAppPort_autofill_auth_info_received_cb_destroy(handle->auth_info_cb); - handle->auth_info_cb = NULL; - } - - if (handle->fill_response_received_cb) { - rpc_port_AutofillAppPort_autofill_fill_response_received_cb_destroy(handle->fill_response_received_cb); - handle->fill_response_received_cb = NULL; - } - - if (handle->app_id) { - free(handle->app_id); - handle->app_id = NULL; - } - - free(handle); -} - -static void __remove_client(rpc_port_stub_AutofillAppPort_context_h context) -{ - autofill_client_s *client = NULL; - rpc_port_stub_AutofillAppPort_context_get_tag(context, (void *)&client); - if (!client) - return; - - rpc_port_stub_AutofillAppPort_context_set_tag(context, NULL); - - LOGI("name(%s)", client->app_id); - - __client_list = g_list_remove(__client_list, client); - __destroy_client(client); -} - -static void __message_create(rpc_port_stub_AutofillAppPort_context_h context, - void *user_data) -{ - LOGD(""); - char *sender = NULL; - - rpc_port_stub_AutofillAppPort_context_get_sender(context, &sender); - if (!sender) - return; - - LOGD("sender(%s)", sender); - free(sender); -} - -static void __message_terminate(rpc_port_stub_AutofillAppPort_context_h context, - void *user_data) -{ - LOGD(""); - char *sender = NULL; - - rpc_port_stub_AutofillAppPort_context_get_sender(context, &sender); - if (!sender) - return; - - LOGD("[__RPC_PORT__] sender(%s)", sender); - free(sender); - - __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) -{ - LOGD(""); - char *sender = NULL; - autofill_client_s *client = NULL; - - rpc_port_stub_AutofillAppPort_context_get_sender(context, &sender); - if (!sender) - return -1; - - LOGD("sender(%s)", sender); - - client = __create_client(sender, context_id, auth_info_cb, fill_response_received_cb); - free(sender); - - if (!client) - return -1; - - __client_list = g_list_append(__client_list, client); - - rpc_port_stub_AutofillAppPort_context_set_tag(context, client); - - return 0; -} - -static void __message_unregister(rpc_port_stub_AutofillAppPort_context_h context, int context_id, void *user_data) -{ - __remove_client(context); -} - -static void __manager_create(rpc_port_stub_AutofillManagerPort_context_h context, - void *user_data) -{ - LOGD(""); -} - -static void __manager_terminate(rpc_port_stub_AutofillManagerPort_context_h context, - void *user_data) -{ - LOGD(""); -} - -bool __view_info_item_cb(rpc_port_autofill_item_h items, void *user_data) -{ - char *id = NULL; - char *label = NULL; - char *value = NULL; - int autofill_hint; - bool sensitive_data; - - rpc_port_autofill_svc_view_info_h svi = (rpc_port_autofill_svc_view_info_h)user_data; - - rpc_port_autofill_svc_item_h svc_item; - - rpc_port_autofill_svc_item_create(&svc_item); - - rpc_port_autofill_item_get_id(items, &id); - rpc_port_autofill_svc_item_set_id(svc_item, id); - if (id) { - LOGD("id : %s", id); - free(id); - } - - rpc_port_autofill_item_get_label(items, &label); - rpc_port_autofill_svc_item_set_label(svc_item, label); - if (label) { - LOGD("label : %s", label); - free(label); - } - - rpc_port_autofill_item_get_value(items, &value); - rpc_port_autofill_svc_item_set_value(svc_item, value); - if (value) { - LOGD("value : %s", value); - free(value); - } - - rpc_port_autofill_item_get_autofill_hint(items, &autofill_hint); - rpc_port_autofill_svc_item_set_autofill_hint(svc_item, autofill_hint); - LOGD("autofill hint : %d", autofill_hint); - - rpc_port_autofill_item_get_is_sensitive_data(items, &sensitive_data); - rpc_port_autofill_svc_item_set_is_sensitive_data(svc_item, sensitive_data); - LOGD("sensitive data : %d", sensitive_data); - - rpc_port_autofill_svc_view_info_add_items(svi, svc_item); - - rpc_port_autofill_svc_item_destroy(svc_item); - - return true; -} - -bool __save_item_cb(rpc_port_autofill_save_item_h items, void *user_data) -{ - char *id = NULL; - char *label = NULL; - char *value = NULL; - int autofill_hint; - bool sensitive_data; - - rpc_port_autofill_svc_save_view_info_h svi = (rpc_port_autofill_svc_save_view_info_h)user_data; - - rpc_port_autofill_svc_save_item_h svc_save_item; - - rpc_port_autofill_svc_save_item_create(&svc_save_item); - - rpc_port_autofill_save_item_get_id(items, &id); - rpc_port_autofill_svc_save_item_set_id(svc_save_item, id); - if (id) { - LOGD("id : %s", id); - free(id); - } - - rpc_port_autofill_save_item_get_label(items, &label); - rpc_port_autofill_svc_save_item_set_label(svc_save_item, label); - if (label) { - LOGD("label : %s", label); - free(label); - } - - rpc_port_autofill_save_item_get_value(items, &value); - rpc_port_autofill_svc_save_item_set_value(svc_save_item, value); - if (value) { - LOGD("value : %s", value); - free(value); - } - - rpc_port_autofill_save_item_get_autofill_hint(items, &autofill_hint); - rpc_port_autofill_svc_save_item_set_autofill_hint(svc_save_item, autofill_hint); - LOGD("autofill hint : %d", autofill_hint); - - rpc_port_autofill_save_item_get_is_sensitive_data(items, &sensitive_data); - rpc_port_autofill_svc_save_item_set_is_sensitive_data(svc_save_item, sensitive_data); - LOGD("sensitive data : %d", sensitive_data); - - rpc_port_autofill_svc_save_view_info_add_items(svi, svc_save_item); - - rpc_port_autofill_svc_save_item_destroy(svc_save_item); - - return true; -} - -static int __auth_info_request_cb(rpc_port_stub_AutofillAppPort_context_h context, int context_id, rpc_port_autofill_view_info_h vi, void *user_data) -{ - char *sender = NULL; - autofill_client_s *sender_client; - - if (!svc_rpc_h) { - LOGW("Not initialized"); - return 0; - } - - rpc_port_stub_AutofillAppPort_context_get_sender(context, &sender); - char *view_id = NULL; - - rpc_port_autofill_view_info_get_view_id(vi, &view_id); - LOGD("app id : %s, view id : %s", sender, view_id); - - rpc_port_stub_AutofillAppPort_context_get_tag(context, (void *)&sender_client); - - /* create view info */ - rpc_port_autofill_svc_view_info_h svi; - rpc_port_autofill_svc_view_info_create(&svi); - rpc_port_autofill_svc_view_info_set_app_id(svi, sender); - rpc_port_autofill_svc_view_info_set_view_id(svi, view_id); - - rpc_port_autofill_view_info_foreach_items(vi, __view_info_item_cb, svi); - - rpc_port_proxy_AutofillSvcPort_invoke_request_auth_info(svc_rpc_h, context_id, svi); - - if (sender) { - free(sender); - } - - if (view_id) { - free(view_id); - } - - rpc_port_autofill_svc_view_info_destroy(svi); - - return 0; -} - -static int __autofill_fill_request_cb(rpc_port_stub_AutofillAppPort_context_h context, int context_id, rpc_port_autofill_view_info_h vi, void *user_data) -{ - char *sender = NULL; - char *view_id = NULL; - - if (!svc_rpc_h) { - LOGW("Not initialized"); - return 0; - } - - rpc_port_stub_AutofillAppPort_context_get_sender(context, &sender); - rpc_port_autofill_view_info_get_view_id(vi, &view_id); - - LOGD("app id : %s, view id : %s, context id : %d", sender, view_id, context_id); - - rpc_port_autofill_svc_view_info_h svi; - rpc_port_autofill_svc_view_info_create(&svi); - rpc_port_autofill_svc_view_info_set_app_id(svi, sender); - rpc_port_autofill_svc_view_info_set_view_id(svi, view_id); - - rpc_port_autofill_view_info_foreach_items(vi, __view_info_item_cb, svi); - - rpc_port_proxy_AutofillSvcPort_invoke_send_fill_request(svc_rpc_h, context_id, svi); - - if (sender) - free(sender); - - if (view_id) - free(view_id); - - rpc_port_autofill_svc_view_info_destroy(svi); - - return 0; -} - -static int __commit_cb(rpc_port_stub_AutofillAppPort_context_h context, int context_id, rpc_port_autofill_save_view_info_h vi, void *user_data) -{ - char *sender = NULL; - autofill_client_s *sender_client; - - if (!svc_rpc_h) { - LOGW("Not initialized"); - return 0; - } - - rpc_port_stub_AutofillAppPort_context_get_sender(context, &sender); - if (sender) { - LOGD("sender(%s)", sender); - free(sender); - } - - char *view_id = NULL; - rpc_port_autofill_save_view_info_get_view_id(vi, &view_id); - if (view_id) { - LOGD("view id : %s", view_id); - } - - rpc_port_autofill_svc_save_view_info_h svi; - rpc_port_autofill_svc_save_view_info_create(&svi); - rpc_port_autofill_svc_save_view_info_set_view_id(svi, view_id); - - rpc_port_stub_AutofillAppPort_context_get_tag(context, (void *)&sender_client); - rpc_port_autofill_save_view_info_foreach_items(vi, __save_item_cb, svi); - - rpc_port_proxy_AutofillSvcPort_invoke_commit(svc_rpc_h, context_id, svi); - - if (view_id) - free(view_id); - - rpc_port_autofill_svc_save_view_info_destroy(svi); - - return 0; -} - -bool fill_response_item_cb(rpc_port_autofill_svc_response_item_h response_items, void *user_data) -{ - rpc_port_autofill_response_group_h res_group = (rpc_port_autofill_response_group_h)user_data; - - char *id = NULL; - char *presentation_text = NULL; - char *value = NULL; - - rpc_port_autofill_response_item_h res_item; - - rpc_port_autofill_response_item_create(&res_item); - - rpc_port_autofill_svc_response_item_get_id(response_items, &id); - rpc_port_autofill_response_item_set_id(res_item, id); - - rpc_port_autofill_svc_response_item_get_presentation_text(response_items, &presentation_text); - rpc_port_autofill_response_item_set_presentation_text(res_item, presentation_text); - - rpc_port_autofill_svc_response_item_get_value(response_items, &value); - rpc_port_autofill_response_item_set_value(res_item, value); - - LOGD("id : %s, presentation text : %s, value : %s", id, presentation_text, value); - - rpc_port_autofill_response_group_add_response_items(res_group, res_item); - - if (id) - free(id); - - if (presentation_text) - free(presentation_text); - - if (value) - free(value); - - rpc_port_autofill_response_item_destroy(res_item); - - return true; -} - -bool fill_response_group_cb(rpc_port_autofill_svc_response_group_h response_groups, void *user_data) -{ - rpc_port_autofill_fill_response_h fr_h = (rpc_port_autofill_fill_response_h)user_data; - - rpc_port_autofill_response_group_h res_group; - rpc_port_autofill_response_group_create(&res_group); - - rpc_port_autofill_svc_response_group_foreach_response_items(response_groups, fill_response_item_cb, res_group); - - rpc_port_autofill_fill_response_add_response_groups(fr_h, res_group); - - rpc_port_autofill_response_group_destroy(res_group); - - return true; -} - -static void __fill_response_recv_cb(void *user_data, int context_id, rpc_port_autofill_svc_fill_response_h response_h) -{ - // recv fill response from service - char *view_id = NULL; - char *app_id = NULL; - - rpc_port_autofill_svc_fill_response_get_app_id(response_h, &app_id); - rpc_port_autofill_svc_fill_response_get_view_id(response_h, &view_id); - LOGD("app id : %s, view id : %s", app_id, view_id); - - /* create autofill response */ - rpc_port_autofill_fill_response_h fill_response_h; - rpc_port_autofill_fill_response_create(&fill_response_h); - rpc_port_autofill_fill_response_set_view_id(fill_response_h, view_id); - - rpc_port_autofill_svc_fill_response_foreach_response_groups(response_h, fill_response_group_cb, fill_response_h); - - autofill_client_s *sender_client = get_autofill_client(app_id, context_id); - if (sender_client) - rpc_port_AutofillAppPort_autofill_fill_response_received_cb_invoke(sender_client->fill_response_received_cb, fill_response_h); - - rpc_port_autofill_fill_response_destroy(fill_response_h); - - if (app_id) - free(app_id); - - if (view_id) - free(view_id); -} - -static void __auth_info_recv_cb(void *user_data, int context_id, rpc_port_autofill_svc_auth_info_h svc_auth_info_h) -{ - bool exist_autofill_data; - bool need_authentication; - char *service_name = NULL; - char *service_logo_image_path = NULL; - char *service_message = NULL; - char *app_id = NULL; - char *view_id = NULL; - - rpc_port_autofill_svc_auth_info_get_app_id(svc_auth_info_h, &app_id); - rpc_port_autofill_svc_auth_info_get_view_id(svc_auth_info_h, &view_id); - rpc_port_autofill_svc_auth_info_get_exist_autofill_data(svc_auth_info_h, &exist_autofill_data); - rpc_port_autofill_svc_auth_info_get_need_authentication(svc_auth_info_h, &need_authentication); - rpc_port_autofill_svc_auth_info_get_service_name(svc_auth_info_h, &service_name); - rpc_port_autofill_svc_auth_info_get_service_logo_image_path(svc_auth_info_h, &service_logo_image_path); - rpc_port_autofill_svc_auth_info_get_service_message(svc_auth_info_h, &service_message); - - LOGD("app id : %s, service name : %s, message : %s, logo path : %s", app_id, service_name, service_message, service_logo_image_path); - - /* transfer auth info */ - rpc_port_autofill_auth_info_h auth_info_h; - rpc_port_autofill_auth_info_create(&auth_info_h); - rpc_port_autofill_auth_info_set_view_id(auth_info_h, view_id); - rpc_port_autofill_auth_info_set_exist_autofill_data(auth_info_h, exist_autofill_data); - rpc_port_autofill_auth_info_set_need_authentication(auth_info_h, need_authentication); - rpc_port_autofill_auth_info_set_service_name(auth_info_h, service_name); - rpc_port_autofill_auth_info_set_service_message(auth_info_h, service_message); - rpc_port_autofill_auth_info_set_service_logo_image_path(auth_info_h, service_logo_image_path); - - autofill_client_s *sender_client = get_autofill_client(app_id, context_id); - if (sender_client) - rpc_port_AutofillAppPort_autofill_auth_info_received_cb_invoke(sender_client->auth_info_cb, auth_info_h); - - rpc_port_autofill_auth_info_destroy(auth_info_h); - - if (app_id) - free(app_id); - - if (view_id) - free(view_id); - - if (service_name) - free(service_name); - - if (service_logo_image_path) - free(service_logo_image_path); - - if (service_message) - free(service_message); -} - -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); - - int r = rpc_port_proxy_AutofillSvcPort_invoke_Register(h, auth_info_cb_h, fill_response_received_cb_h); - if (r != 0) - LOGD("Failed to invoke Register"); -} - -//LCOV_EXCL_START -static void __on_disconnected(rpc_port_proxy_AutofillSvcPort_h h, void *user_data) -{ - LOGD("disconnected"); - - svc_rpc_h = NULL; -} - -static void __on_rejected(rpc_port_proxy_AutofillSvcPort_h h, void *user_data) -{ - LOGD("rejected"); -} -//LCOV_EXCL_STOP - -static bool __manager_set_autofill_service_cb(rpc_port_stub_AutofillManagerPort_context_h context, const char *app_id, void *user_data) -{ - LOGD("app id : %s", app_id); - - if (app_id) - autofill_config_set_autofill_service_app_id(app_id); - - if (svc_rpc_h) { - LOGD("send terminate"); - // terminate service - rpc_port_proxy_AutofillSvcPort_invoke_request_terminate(svc_rpc_h); - - int ret = rpc_port_proxy_AutofillSvcPort_destroy(svc_rpc_h); - LOGD("ret : %d", ret); - } - - svc_rpc_h = NULL; - - connect_service(); - - return true; -} - -static char * __manager_get_autofill_service_cb(rpc_port_stub_AutofillManagerPort_context_h context, void *user_data) -{ - if (!svc_rpc_h) { - LOGW("Not initialized"); - return false; - } - - char *app_id; - autofill_config_get_autofill_service_app_id(&app_id); - - LOGD("app id : %s", app_id); - - return app_id; -} - -bool add_autofill_service_cb(app_info_h app_info, void *user_data) -{ - char *app_id = NULL; - rpc_port_list_string_h service_info_list = (rpc_port_list_string_h)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); - return true; - } - - LOGD("Find autofill service : %s", app_id); - - rpc_port_list_string_add_list_strings(service_info_list, app_id); - - if (app_id) { - free(app_id); - } - - return true; -} - -static bool __manager_get_autofill_service_list_cb(rpc_port_stub_AutofillManagerPort_context_h context, rpc_port_list_string_h *service_info_list, void *user_data) -{ - int ret; - app_info_metadata_filter_h handle = NULL; - - // 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); - 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); - app_info_metadata_filter_destroy(handle); - return false; - } - - rpc_port_list_string_h app_id_list_h; - rpc_port_list_string_create(&app_id_list_h); - - 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); - } - - *service_info_list = app_id_list_h; - - app_info_metadata_filter_destroy(handle); - - return true; -} - -static int connect_service() -{ - int ret; - size_t service_id_len; - - rpc_port_proxy_AutofillSvcPort_callback_s rpc_callback = { - .connected = __on_connected, - .disconnected = __on_disconnected, - .rejected = __on_rejected - }; - - if (svc_rpc_h) { - LOGI("already connected\n"); - return RPC_PORT_ERROR_NONE; - } - - char *active_autofill_service_id = NULL; - autofill_config_get_autofill_service_app_id(&active_autofill_service_id); - LOGD("autofill service : '%s'", active_autofill_service_id); - - if (!active_autofill_service_id) { - active_autofill_service_id = strdup(AUTOFILL_SERVICE_APP_ID); - } - - if (active_autofill_service_id) { - autofill_config_set_autofill_service_app_id(active_autofill_service_id); - service_id_len = strlen(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); - - if (service_id_len == 0) { - LOGD("No Autofill service to connect"); - return false; - } - - if (ret != RPC_PORT_ERROR_NONE) { - LOGW("Failed to create rpc port. err = %d", 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); - return false; - } - - return ret; -} - -bool service_app_create(void *data) -{ - // Todo: add your code here. - LOGD(""); - - int ret; - // register app port - rpc_port_stub_AutofillAppPort_callback_s callback = { - __message_create, - __message_terminate, - __message_register, - __message_unregister, - __auth_info_request_cb, - __autofill_fill_request_cb, - __commit_cb, - }; - - ret = rpc_port_stub_AutofillAppPort_register(&callback, NULL); - if (ret != 0) - LOGI("Failed to register app port"); - else - LOGI("Succeeded to register app port"); - - // register manager port - rpc_port_stub_AutofillManagerPort_callback_s manager_callback = { - __manager_create, - __manager_terminate, - __manager_set_autofill_service_cb, - __manager_get_autofill_service_cb, - __manager_get_autofill_service_list_cb, - }; - - ret = rpc_port_stub_AutofillManagerPort_register(&manager_callback, NULL); - if (ret != 0) - LOGI("Failed to register manager port"); - else - LOGI("Succeeded to register manager port"); - - connect_service(); - - return true; -} - -void service_app_terminate(void *data) -{ - // Todo: add your code here. - LOGD(""); - - if (__client_list) { - g_list_free_full(__client_list, __destroy_client); - __client_list = NULL; - } - - rpc_port_stub_AutofillAppPort_unregister(); - - return; -} - -void service_app_control(app_control_h app_control, void *data) -{ - // Todo: add your code here. - return; -} - -static void -service_app_lang_changed(app_event_info_h event_info, void *user_data) -{ - /*APP_EVENT_LANGUAGE_CHANGED*/ - return; -} - -static void -service_app_region_changed(app_event_info_h event_info, void *user_data) -{ - /*APP_EVENT_REGION_FORMAT_CHANGED*/ -} - -static void -service_app_low_battery(app_event_info_h event_info, void *user_data) -{ - /*APP_EVENT_LOW_BATTERY*/ -} - -static void -service_app_low_memory(app_event_info_h event_info, void *user_data) -{ - /*APP_EVENT_LOW_MEMORY*/ -} - -/** - * Entry point for this application. - */ -int main(int argc, char *argv[]) -{ - LOGI("BEGIN"); - - char ad[50] = {0,}; - service_app_lifecycle_callback_s event_callback; - app_event_handler_h handlers[5] = {NULL, }; - - event_callback.create = service_app_create; - event_callback.terminate = service_app_terminate; - event_callback.app_control = service_app_control; - - service_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, service_app_low_battery, &ad); - service_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, service_app_low_memory, &ad); - service_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, service_app_lang_changed, &ad); - service_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, service_app_region_changed, &ad); - - return service_app_main(argc, argv, &event_callback, ad); -} 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 fd959f2..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 decc8c0e8522415d1221516def66c664f4ab3cbd Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 2 Jan 2019 16:55:22 +0900 Subject: [PATCH 06/16] Update package version to 0.1.15 Change-Id: I65bbd7a378e169740a47b95fe00c3254b14a5f5e 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 aad7931..2abf9e6 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.14 +Version: 0.1.15 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From 81df7b64e4c5ddf89a946cc8e4c01653937e7e4b Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 2 Jan 2019 18:29:24 +0900 Subject: [PATCH 07/16] Fix build error Change-Id: Iaff50928078e0c3941317dcb9cb260fc6cdafa1c Signed-off-by: Jihoon Kim --- packaging/capi-ui-autofill.spec | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packaging/capi-ui-autofill.spec b/packaging/capi-ui-autofill.spec index 2abf9e6..cf2f953 100644 --- a/packaging/capi-ui-autofill.spec +++ b/packaging/capi-ui-autofill.spec @@ -102,10 +102,6 @@ tidlc -p -l C -i tidl/autofill_manager.tidl -o autofill_manager_proxy mv autofill_manager_proxy.h ./manager/ mv autofill_manager_proxy.c ./manager/ -tidlc -s -l C -i tidl/autofill_manager.tidl -o autofill_manager_stub -mv autofill_manager_stub.h ./server/ -mv autofill_manager_stub.c ./server/ - %build -- 2.7.4 From 2e7c554e488046c2070b76296fe72fb5fd984524 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 2 Jan 2019 18:30:43 +0900 Subject: [PATCH 08/16] Update package version to 0.1.16 Change-Id: I4c29bbe225abce2748adb0f536192e1483af26e8 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 cf2f953..ca170ff 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.15 +Version: 0.1.16 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From e93dbb5268e8f0fbf7fdc01e82fee22e32b76e7d Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 28 Dec 2018 14:37:23 +0900 Subject: [PATCH 09/16] Add password and credit card security code type Change-Id: I3312b8c173ad55a6f546b8a4df79048dcf1c22a8 Signed-off-by: Jihoon Kim --- include/autofill_common.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/autofill_common.h b/include/autofill_common.h index 40bc2e4..ae0601a 100644 --- a/include/autofill_common.h +++ b/include/autofill_common.h @@ -51,7 +51,9 @@ typedef enum AUTOFILL_HINT_PHONE, /**< Autofill hint for a phone number */ AUTOFILL_HINT_POSTAL_ADDRESS, /**< Autofill hint for a postal address */ AUTOFILL_HINT_POSTAL_CODE, /**< Autofill hint for a postal code */ - AUTOFILL_HINT_ID /**< Autofill hint for a user's ID */ + AUTOFILL_HINT_ID, /**< Autofill hint for a user's ID */ + AUTOFILL_HINT_PASSWORD, /**< Autofill hint for password */ + AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE /**< Autofill hint for a credit card security code */ } autofill_hint_e; /** -- 2.7.4 From 5a6d09cdec151e212436df797ae6f3e5748f93b7 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 7 Jan 2019 07:58:06 +0900 Subject: [PATCH 10/16] Set app id in fill response and authentication information Change-Id: I249a4ce5b574c980867f0b1fec7c429c35e4f595 Signed-off-by: Jihoon Kim --- client/autofill.c | 19 ++++++++++++++++--- tidl/autofill.tidl | 2 ++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/client/autofill.c b/client/autofill.c index 6318d3d..fdd0df9 100644 --- a/client/autofill.c +++ b/client/autofill.c @@ -92,18 +92,25 @@ static bool fill_response_group_cb(rpc_port_autofill_response_group_h response_g static void __fill_response_recv_cb(void *user_data, rpc_port_autofill_fill_response_h response_h) { + char *app_id = NULL; char *view_id = NULL; autofill_h ah = user_data; autofill_fill_response_h rh; autofill_fill_response_create(&rh); + rpc_port_autofill_fill_response_get_app_id(response_h, &app_id); rpc_port_autofill_fill_response_get_view_id(response_h, &view_id); + LOGD("app id : %s, view id : %s", app_id, view_id); + + if (app_id) { + autofill_fill_response_set_app_id(rh, app_id); + free(app_id); + } + if (view_id) { autofill_fill_response_set_view_id(rh, view_id); - - LOGD("view id : %s", view_id); free(view_id); } @@ -124,11 +131,13 @@ static void __auth_info_recv_cb(void *user_data, rpc_port_autofill_auth_info_h a bool autofill_data_present = false; bool authentication_needed = false; + char *app_id = NULL; char *view_id = NULL; char *service_name = NULL; char *service_logo_image_path = NULL; char *service_message = NULL; + rpc_port_autofill_auth_info_get_app_id(auth_info_h, &app_id); rpc_port_autofill_auth_info_get_view_id(auth_info_h, &view_id); rpc_port_autofill_auth_info_get_exist_autofill_data(auth_info_h, &autofill_data_present); rpc_port_autofill_auth_info_get_need_authentication(auth_info_h, &authentication_needed); @@ -136,8 +145,9 @@ static void __auth_info_recv_cb(void *user_data, rpc_port_autofill_auth_info_h a rpc_port_autofill_auth_info_get_service_logo_image_path(auth_info_h, &service_logo_image_path); rpc_port_autofill_auth_info_get_service_message(auth_info_h, &service_message); - LOGD("service name : %s", service_name); + LOGD("app id : %s, view id : %s, service name : %s", app_id, view_id, service_name); + autofill_auth_info_set_app_id(aih, app_id); autofill_auth_info_set_view_id(aih, view_id); autofill_auth_info_set_autofill_data_present(aih, autofill_data_present); autofill_auth_info_set_authentication_needed(aih, authentication_needed); @@ -145,6 +155,9 @@ static void __auth_info_recv_cb(void *user_data, rpc_port_autofill_auth_info_h a autofill_auth_info_set_service_logo_image_path(aih, service_logo_image_path); autofill_auth_info_set_service_message(aih, service_message); + if (app_id) + free(app_id); + if (view_id) free(view_id); diff --git a/tidl/autofill.tidl b/tidl/autofill.tidl index 8c3d185..6f4ccac 100644 --- a/tidl/autofill.tidl +++ b/tidl/autofill.tidl @@ -25,6 +25,7 @@ struct autofill_save_view_info { } struct autofill_auth_info { + string app_id; string view_id; bool exist_autofill_data; bool need_authentication; @@ -45,6 +46,7 @@ struct autofill_response_group { } struct autofill_fill_response { + string app_id; string view_id; list response_groups; } -- 2.7.4 From 5dac39d923f5371044e984762b50a3ae6ea5632e Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 7 Jan 2019 07:58:40 +0900 Subject: [PATCH 11/16] Update package version to 0.1.17 Change-Id: Ic160fa714e1f6dc444772842071d596b5630dbf5 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 ca170ff..31f926c 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.16 +Version: 0.1.17 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From 44a70e104dfe9581720f387bdfd3436ca7dfd5ad Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 8 Jan 2019 18:55:37 +0900 Subject: [PATCH 12/16] Add connection error message Change-Id: Ibf37850a6ee651b0f86465a630040592be697890 Signed-off-by: Jihoon Kim --- client/autofill.c | 9 +++++++++ client/autofill_auth.c | 5 +++++ client/autofill_fill_request.c | 5 +++++ include/autofill_private.h | 2 ++ 4 files changed, 21 insertions(+) diff --git a/client/autofill.c b/client/autofill.c index fdd0df9..b5220e0 100644 --- a/client/autofill.c +++ b/client/autofill.c @@ -190,6 +190,8 @@ static void __on_connected(rpc_port_proxy_AutofillAppPort_h h, void *user_data) return; } + ah->connected = true; + LOGI("connected"); rpc_port_AutofillAppPort_autofill_fill_response_received_cb_h fill_response_received_cb = rpc_port_AutofillAppPort_autofill_fill_response_received_cb_create(__fill_response_recv_cb, false, ah); rpc_port_AutofillAppPort_autofill_auth_info_received_cb_h auth_info_received_cb = rpc_port_AutofillAppPort_autofill_auth_info_received_cb_create(__auth_info_recv_cb, false, ah); @@ -209,6 +211,8 @@ static void __on_disconnected(rpc_port_proxy_AutofillAppPort_h h, void *user_dat autofill_h ah = user_data; if (ah) { + ah->connected = false; + if (ah && ah->connection_callback) ah->connection_callback(ah, AUTOFILL_CONNECTION_STATUS_DISCONNECTED, ah->connection_userdata); @@ -336,6 +340,11 @@ EXPORT_API int autofill_commit(autofill_h ah, autofill_save_view_info_h vi) return AUTOFILL_ERROR_OPERATION_FAILED; } + if (!ah->connected) { + LOGW("[ERROR] Not connected"); + 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); diff --git a/client/autofill_auth.c b/client/autofill_auth.c index d238b63..9fdf7f9 100644 --- a/client/autofill_auth.c +++ b/client/autofill_auth.c @@ -49,6 +49,11 @@ EXPORT_API int autofill_auth_info_request(autofill_h ah, autofill_view_info_h vi return AUTOFILL_ERROR_OPERATION_FAILED; } + if (!ah->connected) { + LOGW("[ERROR] Not connected"); + return AUTOFILL_ERROR_OPERATION_FAILED; + } + LOGD("app id : %s, view id : %s", vi->app_id, vi->view_id); rpc_port_autofill_view_info_create(&vih); diff --git a/client/autofill_fill_request.c b/client/autofill_fill_request.c index 8dec709..8c8b091 100644 --- a/client/autofill_fill_request.c +++ b/client/autofill_fill_request.c @@ -47,6 +47,11 @@ EXPORT_API int autofill_fill_request(autofill_h ah, autofill_view_info_h vi) return AUTOFILL_ERROR_OPERATION_FAILED; } + if (!ah->connected) { + LOGW("[ERROR] Not connected"); + return AUTOFILL_ERROR_OPERATION_FAILED; + } + Eina_List *l; autofill_item_h it; diff --git a/include/autofill_private.h b/include/autofill_private.h index 3ca6f28..6a465cb 100644 --- a/include/autofill_private.h +++ b/include/autofill_private.h @@ -26,6 +26,8 @@ struct autofill_s { unsigned int context_id; + bool connected; + autofill_connection_status_changed_cb connection_callback; void *connection_userdata; -- 2.7.4 From 48f32584793d6cd2ea8ab6b135e7bd6050f3d562 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 8 Jan 2019 19:10:11 +0900 Subject: [PATCH 13/16] Fix issue detected by static analysis tool Change-Id: Icc95ff7e03a79c8e62731f849dfba5848bb8d2ff Signed-off-by: Jihoon Kim --- privilege_checker/privilege_checker.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/privilege_checker/privilege_checker.c b/privilege_checker/privilege_checker.c index e75a372..05f6c24 100644 --- a/privilege_checker/privilege_checker.c +++ b/privilege_checker/privilege_checker.c @@ -19,6 +19,7 @@ check_privilege(const char *privilege) char label_path[1024] = "/proc/self/attr/current"; char smack_label[1024] = {'\0', }; char uid[10] = {0,}; + int num; int ret = cynara_initialize(&p_cynara, NULL); if (ret != CYNARA_API_SUCCESS) { @@ -31,7 +32,8 @@ check_privilege(const char *privilege) fp = fopen(label_path, "r"); if (fp != NULL) { - if (fread(smack_label, 1, sizeof(smack_label) - 1, fp) <= 0) { + num = fread(smack_label, 1, sizeof(smack_label) - 1, fp); + if (num <= 0) { LOGW("[check_privilege] fail to fread"); } fclose(fp); -- 2.7.4 From 86af763eeaae8c1934553d7ec4b5ae9301999cb5 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 9 Jan 2019 11:21:45 +0900 Subject: [PATCH 14/16] Update package version to 0.1.18 Change-Id: I7304e915dbb6c22826778cc3eb3d2ea4a4ceadb7 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 31f926c..2088c66 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.17 +Version: 0.1.18 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 -- 2.7.4 From 4721d434b981161447bc26923d78bc224ce2b0b2 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 10 Jan 2019 12:10:45 +0900 Subject: [PATCH 15/16] Fix documentation Change-Id: Icab8b9d2d6f310b08bcfa9fdbda3888b6475ccec Signed-off-by: Jihoon Kim --- doc/autofill_client_doc.h | 6 +++--- doc/autofill_common_doc.h | 2 +- doc/autofill_doc.h | 2 +- doc/autofill_manager_doc.h | 4 ++-- doc/autofill_service_doc.h | 2 +- include/autofill_service.h | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/autofill_client_doc.h b/doc/autofill_client_doc.h index d323a8e..52e4c42 100644 --- a/doc/autofill_client_doc.h +++ b/doc/autofill_client_doc.h @@ -21,13 +21,13 @@ /** * @ingroup CAPI_UIX_AUTOFILL_MODULE * @defgroup CAPI_UIX_AUTOFILL_CLIENT_MODULE Autofill client - * @brief The @ref CAPI_UIX_AUTOFILL_CLIENT_MODULE API provides the functions for sending data to the autofill service and receiving the commonly-entered data from the autofill service. + * @brief The @ref CAPI_UIX_AUTOFILL_CLIENT_MODULE API provides the functions for sending data to the autofill service and receiving the data previously entered by the user from the autofill service. * @section CAPI_UIX_AUTOFILL_MODULE_CLIENT_HEADER Required Header * * \#include * @section CAPI_UIX_AUTOFILL_CLIENT_MODULE_OVERVIEW Overview - * Autofill is a feature that allows you to fill out commonly-entered information such as email, account and address in a text input field. email, account and address in a text input field. - * The @ref CAPI_UIX_AUTOFILL_CLIENT_MODULE API provides the functions for sending data to the autofill service and receiving the commonly-entered data from the autofill service. + * Autofill is a feature that allows you to fill out the data previously entered by the user such as email, account and address in a text input field. email, account and address in a text input field. + * The @ref CAPI_UIX_AUTOFILL_CLIENT_MODULE API provides the functions for sending data to the autofill service and receiving the data previously entered by the user from the autofill service. */ diff --git a/doc/autofill_common_doc.h b/doc/autofill_common_doc.h index fd94dec..cc92d11 100644 --- a/doc/autofill_common_doc.h +++ b/doc/autofill_common_doc.h @@ -26,7 +26,7 @@ * \#include * * @section CAPI_UIX_AUTOFILL_COMMON_MODULE_OVERVIEW Overview - * Autofill is a feature that allows you to fill out commonly-entered information such as email, account and address in a text input field. email, account and address in a text input field. + * Autofill is a feature that allows you to fill out the data previously entered by the user such as email, account and address in a text input field. email, account and address in a text input field. * @ref CAPI_UIX_AUTOFILL_COMMON_MODULE functions are responsible for storing or retrieving autofill data in each autofill data structure. * The @ref CAPI_UIX_AUTOFILL_COMMON_MODULE functions can be used in an autofill client and an autofill service. */ diff --git a/doc/autofill_doc.h b/doc/autofill_doc.h index 940c2f5..d71c8af 100644 --- a/doc/autofill_doc.h +++ b/doc/autofill_doc.h @@ -24,7 +24,7 @@ * @brief The @ref CAPI_UIX_AUTOFILL_MODULE API provides the functions for supporting users to use autofill feature. * * @section CAPI_UIX_AUTOFILL_MODULE_OVERVIEW Overview - * Autofill is a feature that allows you to fill out commonly-entered information such as email, account and address in a text input field. email, account and address in a text input field. + * Autofill is a feature that allows you to fill out the data previously entered by the user such as email, account and address in a text input field. email, account and address in a text input field. */ diff --git a/doc/autofill_manager_doc.h b/doc/autofill_manager_doc.h index 70eeaf4..af82a0c 100644 --- a/doc/autofill_manager_doc.h +++ b/doc/autofill_manager_doc.h @@ -26,9 +26,9 @@ * \#include * * @section CAPI_UIX_AUTOFILL_MANAGER_MODULE_OVERVIEW Overview - * Autofill is a feature that allows you to fill out commonly-entered information such as email, account and address in a text input field. email, account and address in a text input field. + * Autofill is a feature that allows you to fill out the data previously entered by the user such as email, account and address in a text input field. email, account and address in a text input field. * Autofill manager is a module for managing the installed autofill services. Application developers can use this module to get the current autofill service and changing the autofill service. - * @ref CAPI_UIX_AUTOFILL_MANAGER_MODULE functions are responsible for sending data for supporting autofill to the autofill service and receiving the commonly-entered data from the autofill service. + * @ref CAPI_UIX_AUTOFILL_MANAGER_MODULE functions are responsible for sending data for supporting autofill to the autofill service and receiving the data previously entered by the user from the autofill service. */ diff --git a/doc/autofill_service_doc.h b/doc/autofill_service_doc.h index 36052d2..d312ecf 100644 --- a/doc/autofill_service_doc.h +++ b/doc/autofill_service_doc.h @@ -26,7 +26,7 @@ * \#include * * @section CAPI_UIX_AUTOFILL_SERVICE_MODULE_OVERVIEW Overview - * Autofill Service application is a service application to save the user input and provide the commonly-entered information. + * Autofill Service application is a service application to save the user input and provide the data previously entered by the user. * Using the @ref CAPI_UIX_AUTOFILL_SERVICE_MODULE functions, Autofill service application developers can implement their own autofill service to serve the autofill information. */ diff --git a/include/autofill_service.h b/include/autofill_service.h index 8bcdcac..c5283d7 100644 --- a/include/autofill_service.h +++ b/include/autofill_service.h @@ -19,7 +19,7 @@ /** * @file autofill_service.h - * @brief This file contains autofill APIs and related enumeration. + * @brief This file contains autofill service APIs and related enumeration. */ #include -- 2.7.4 From b7e41d1c93be4625d0a4e3d5ade9aa1a4d85763c Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 22 Jan 2019 17:48:49 +0900 Subject: [PATCH 16/16] 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