From 042aef7a63b407ef39e3272dd0fcc68cbc5fca5e Mon Sep 17 00:00:00 2001 From: InHong Han Date: Fri, 29 May 2020 18:20:50 +0900 Subject: [PATCH 01/16] Update package version to 0.1.51 Change-Id: I2b468e31aeb87f171877cb20b1a5f3e405c082cf --- packaging/capi-ui-sticker.spec | 2 +- receiver/tizen-manifest.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/capi-ui-sticker.spec b/packaging/capi-ui-sticker.spec index 11ab9df..871c986 100644 --- a/packaging/capi-ui-sticker.spec +++ b/packaging/capi-ui-sticker.spec @@ -1,6 +1,6 @@ Name: capi-ui-sticker Summary: Sticker client library and daemon -Version: 0.1.50 +Version: 0.1.51 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 diff --git a/receiver/tizen-manifest.xml b/receiver/tizen-manifest.xml index 0f9aed4..843df8c 100644 --- a/receiver/tizen-manifest.xml +++ b/receiver/tizen-manifest.xml @@ -1,5 +1,5 @@ - + -- 2.7.4 From 2d3243dca6eceddb799e59ef7f37a2c7ccb85ff0 Mon Sep 17 00:00:00 2001 From: InHong Han Date: Wed, 13 May 2020 17:10:56 +0900 Subject: [PATCH 02/16] Add logs for checking sync events Change-Id: I6166b0ea0ba2cffa9b814d82572796954094dcfb --- receiver/src/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/receiver/src/main.cpp b/receiver/src/main.cpp index dc105d0..8e04807 100644 --- a/receiver/src/main.cpp +++ b/receiver/src/main.cpp @@ -104,6 +104,7 @@ static bool check_sync_time_condition() LOGD("current time : %f, last_sync_time : %f", ecore_time_unix_get(), last_sync_time); if (ecore_time_unix_get() - last_sync_time > MAX_WAIT_TIME) { + LOGD("Starting manual synchronization"); initialize_sap(); request_show_sync_notification(); result = false; @@ -159,6 +160,7 @@ static void app_control(app_control_h app_control, void *data) if (!is_init_sap()) { if (check_sync_time_condition()) { if (check_battery_condition()) { + LOGD("Starting auto synchronization"); initialize_sap(); request_all_sticker_data("auto", "input"); } -- 2.7.4 From d144bc3231092c3d6acf5cb93b1fce128512c85c Mon Sep 17 00:00:00 2001 From: InHong Han Date: Tue, 2 Jun 2020 11:20:58 +0900 Subject: [PATCH 03/16] Limit the maximum size of log file Change-Id: Ic1f3f34837cf57fbb74c6f90269a44c2d45f44e4 --- receiver/inc/config.h | 3 +++ receiver/inc/receiver_preference.h | 1 + receiver/src/sticker_log.cpp | 45 +++++++++++++++++++++++++++++++++++++- 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/receiver/inc/config.h b/receiver/inc/config.h index bafee30..f1ca4b9 100644 --- a/receiver/inc/config.h +++ b/receiver/inc/config.h @@ -33,4 +33,7 @@ #define STICKER_DIRECTORY "/opt/usr/share/sticker-data" +#define MAX_LOG_SIZE 1024*1024 +#define MAX_LOG_COUNT 7 + #endif /* __CONFIG_H__ */ diff --git a/receiver/inc/receiver_preference.h b/receiver/inc/receiver_preference.h index 140b171..02fc7e3 100644 --- a/receiver/inc/receiver_preference.h +++ b/receiver/inc/receiver_preference.h @@ -18,5 +18,6 @@ #define __RECEIVER_PREFERENCE_H__ #define LAST_SYNC_TIME "LastSyncTime" +#define LAST_LOG_FILE_INDEX "LastLogFileIndex" #endif /* __RECEIVER_PREFERENCE_H__ */ diff --git a/receiver/src/sticker_log.cpp b/receiver/src/sticker_log.cpp index 8954a28..1faffd5 100644 --- a/receiver/src/sticker_log.cpp +++ b/receiver/src/sticker_log.cpp @@ -9,8 +9,11 @@ #include #include #include +#include #include "log.h" +#include "config.h" +#include "receiver_preference.h" using namespace std; @@ -44,7 +47,47 @@ void sticker_save_log(const char *fmt, ...) if (data_path) free(data_path); - snprintf(strLogFile, sizeof(strLogFile), "%s/sticker.log", log_path); + int idx = 0; + if (preference_get_int(LAST_LOG_FILE_INDEX, &idx) != PREFERENCE_ERROR_NONE) { + idx = 1; + snprintf(strLogFile, sizeof(strLogFile), "%s/sticker_%d.log", log_path, idx); + + if (access(strLogFile, F_OK) == 0) { + if (unlink(strLogFile) == -1) + LOGE("Failed to remove log file"); + } + + if (preference_set_int(LAST_LOG_FILE_INDEX, idx) != PREFERENCE_ERROR_NONE) + LOGW("Failed to set last file index"); + } else { + char tmpLogFile[PATH_MAX]; + snprintf(tmpLogFile, sizeof(tmpLogFile), "%s/sticker_%d.log", log_path, idx); + + ifstream log_file(tmpLogFile, ifstream::binary); + if (!log_file || !log_file.is_open()) { + snprintf(strLogFile, sizeof(strLogFile), "%s", tmpLogFile); + } else { + log_file.seekg(0, log_file.end); + int size = log_file.tellg(); + + if (size >= MAX_LOG_SIZE) { + if (idx + 1 > MAX_LOG_COUNT) + idx = 1; + else + idx += 1; + + if (preference_set_int(LAST_LOG_FILE_INDEX, idx) != PREFERENCE_ERROR_NONE) + LOGW("Failed to set last file index"); + + snprintf(strLogFile, sizeof(strLogFile), "%s/sticker_%d.log", log_path, idx); + if (access(strLogFile, F_OK) == 0) { + if (unlink(strLogFile) == -1) + LOGE("Failed to remove log file"); + } + } else + snprintf(strLogFile, sizeof(strLogFile), "%s", tmpLogFile); + } + } std::ofstream sticker_log_file (strLogFile, std::ios::app); sticker_log_file << full_buf << std::endl; -- 2.7.4 From abd0eff3424ac830445d283bd43fbbb4a783f0de Mon Sep 17 00:00:00 2001 From: InHong Han Date: Tue, 2 Jun 2020 11:22:52 +0900 Subject: [PATCH 04/16] Update package version to 0.1.52 Change-Id: I91db19339401073e2190d2785a738ac48736bd4d --- packaging/capi-ui-sticker.spec | 2 +- receiver/tizen-manifest.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/capi-ui-sticker.spec b/packaging/capi-ui-sticker.spec index 871c986..7e371e7 100644 --- a/packaging/capi-ui-sticker.spec +++ b/packaging/capi-ui-sticker.spec @@ -1,6 +1,6 @@ Name: capi-ui-sticker Summary: Sticker client library and daemon -Version: 0.1.51 +Version: 0.1.52 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 diff --git a/receiver/tizen-manifest.xml b/receiver/tizen-manifest.xml index 843df8c..6e0ed28 100644 --- a/receiver/tizen-manifest.xml +++ b/receiver/tizen-manifest.xml @@ -1,5 +1,5 @@ - + -- 2.7.4 From a035b4d539bf333a4ea8df04cf68a8cf19e9ddaa Mon Sep 17 00:00:00 2001 From: InHong Han Date: Wed, 3 Jun 2020 13:53:06 +0900 Subject: [PATCH 05/16] Modified the synchronization interval Change-Id: I2c9b74d6e7f27207e2af5b761dd2b45d41387f1d --- receiver/inc/config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/receiver/inc/config.h b/receiver/inc/config.h index f1ca4b9..e02f07c 100644 --- a/receiver/inc/config.h +++ b/receiver/inc/config.h @@ -20,8 +20,8 @@ #define ACCESSORY_SERVICE_PROFILE_ID "/sample/filetransfersender" #define ACCESSORY_SERVICE_CHANNEL_ID 107 -#define SYNC_INTERVAL 12*60*60 -#define MAX_WAIT_TIME 48*60*60 +#define SYNC_INTERVAL 24*60*60 +#define MAX_WAIT_TIME 120*60*60 #define REMOTE_APP_ID "com.samsung.w-input-selector" #define MESSAGE_PORT_REMOTE_NAME REMOTE_APP_ID"_msg_port_rcv" -- 2.7.4 From 149f8c80539fc3fa828f56590d7200d4d226b621 Mon Sep 17 00:00:00 2001 From: InHong Han Date: Wed, 3 Jun 2020 13:56:24 +0900 Subject: [PATCH 06/16] Update package version to 0.1.53 Change-Id: I521dcbe9b78b631bca1bd187cd04778c25c4e7c2 --- packaging/capi-ui-sticker.spec | 2 +- receiver/tizen-manifest.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/capi-ui-sticker.spec b/packaging/capi-ui-sticker.spec index 7e371e7..371e148 100644 --- a/packaging/capi-ui-sticker.spec +++ b/packaging/capi-ui-sticker.spec @@ -1,6 +1,6 @@ Name: capi-ui-sticker Summary: Sticker client library and daemon -Version: 0.1.52 +Version: 0.1.53 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 diff --git a/receiver/tizen-manifest.xml b/receiver/tizen-manifest.xml index 6e0ed28..8aea7e1 100644 --- a/receiver/tizen-manifest.xml +++ b/receiver/tizen-manifest.xml @@ -1,5 +1,5 @@ - + -- 2.7.4 From d26e4499f389349e27d7fcec7088252843e1447e Mon Sep 17 00:00:00 2001 From: InHong Han Date: Wed, 3 Jun 2020 18:56:04 +0900 Subject: [PATCH 07/16] Fix the issue sticker log files are not copied to the debug directory Change-Id: I4c13528fb202133820370980d20ed3bf5999d43d --- dump/sticker_log_dump.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dump/sticker_log_dump.sh b/dump/sticker_log_dump.sh index 2d0f875..c90ecb1 100755 --- a/dump/sticker_log_dump.sh +++ b/dump/sticker_log_dump.sh @@ -8,8 +8,8 @@ STICKER_DEBUG=$1/sticker STICKER_HOME=/opt/usr/home/owner/apps_rw/.shared/org.tizen.sticker-receiver/data/log STICKER_DB=/opt/dbspace/.sticker_info.db /bin/mkdir -p ${STICKER_DEBUG} -/bin/cat ${STICKER_HOME}/sticker.log > ${STICKER_DEBUG}/sticker.log -/bin/cp ${STICKER_DB}/.sticker_info.db* ${STICKER_DEBUG}/ +/bin/cp ${STICKER_HOME}/sticker_*.log ${STICKER_DEBUG}/ +/bin/cp ${STICKER_DB} ${STICKER_DEBUG}/ /bin/sync ##UEP330x4988b0767795e32b117da2c8c810260b9f03a2808cd45af44f4584cde4d17be8149fd2921bdbcf4b0d6c08ef97453b983cb72e238c6c64b33e8286148e7b377f906f66407eec37edd6fd431d93a217109003fa0ebc99560a67954fe2910fe35a02523c131fd0ab36de45f140db756fdda71f58e1d9d46575d0c2f5453575aaa08d47e6f13a657420020353981fb8e5998b29c9af70272613dffd33a97502e51ea926a258c6de56cc21d951d28b1e44f1e33ed5a530c5dfb9a72714a56d30894f02bf98fb9cfd1521102abbf46f50d38dc079321850685808ae0fd05a22822592bec5a1883d7937d990cbd59947829ea7c2c0d43333a2f0d72d53c6bcef426bb7AAACAg==:UEP -- 2.7.4 From 757667cc6c05fad55894c2c01247114736552842 Mon Sep 17 00:00:00 2001 From: InHong Han Date: Wed, 3 Jun 2020 18:57:34 +0900 Subject: [PATCH 08/16] Update package version to 0.1.54 Change-Id: I9bac3c7a633c2043573c714a35ca12ac521974be --- packaging/capi-ui-sticker.spec | 2 +- receiver/tizen-manifest.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/capi-ui-sticker.spec b/packaging/capi-ui-sticker.spec index 371e148..cea1ecc 100644 --- a/packaging/capi-ui-sticker.spec +++ b/packaging/capi-ui-sticker.spec @@ -1,6 +1,6 @@ Name: capi-ui-sticker Summary: Sticker client library and daemon -Version: 0.1.53 +Version: 0.1.54 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 diff --git a/receiver/tizen-manifest.xml b/receiver/tizen-manifest.xml index 8aea7e1..831445e 100644 --- a/receiver/tizen-manifest.xml +++ b/receiver/tizen-manifest.xml @@ -1,5 +1,5 @@ - + -- 2.7.4 From aa6e02508a7b5615b9e3a5c09f2b7054fd72b00c Mon Sep 17 00:00:00 2001 From: InHong Han Date: Fri, 12 Jun 2020 11:32:05 +0900 Subject: [PATCH 09/16] Delete all AR emoji stickers before synchronizing them Change-Id: I972d7e243fc39e633968a32567bf57a0784858fb --- receiver/src/ft.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/receiver/src/ft.cpp b/receiver/src/ft.cpp index ebf7e92..670d30c 100644 --- a/receiver/src/ft.cpp +++ b/receiver/src/ft.cpp @@ -68,7 +68,8 @@ enum { SYNC_START_RSP_SUCCESS = 1000, SYNC_START_RSP_NO_STICKER = 1001, SYNC_START_RSP_BITMOJI_ALL_DELETE = 1002, - SYNC_START_RSP_AREMOJI_ALL_DELETE = 1003 + SYNC_START_RSP_AREMOJI_ALL_DELETE = 1003, + SYNC_START_RSP_SYNC_AFTER_DELETING_AREMOJI = 1004 }; struct sap_info_s { @@ -660,6 +661,9 @@ static void send_sync_start_response(int result_code) case SYNC_START_RSP_AREMOJI_ALL_DELETE: response_to_app = "success"; break; + case SYNC_START_RSP_SYNC_AFTER_DELETING_AREMOJI: + response_to_app = "success"; + break; default: response_to_app = "unknown_error"; break; @@ -772,6 +776,10 @@ on_data_received(sap_socket_h socket, unsigned short int channel_id, unsigned in LOGD("Delete all bitmoji stickers"); delete_all_stickers("bitmoji"); } + } else if (result_code == SYNC_START_RSP_SYNC_AFTER_DELETING_AREMOJI) { + send_sync_start_response(result_code); + LOGD("Delete all AR Emoji stickers"); + delete_all_stickers("arsticker"); } else { if (result_code == SYNC_START_RSP_BITMOJI_ALL_DELETE) { LOGD("Delete all bitmoji stickers"); -- 2.7.4 From aa921ff498a529e51542bbb1e2c59ef2e3565604 Mon Sep 17 00:00:00 2001 From: InHong Han Date: Fri, 12 Jun 2020 11:34:25 +0900 Subject: [PATCH 10/16] Update package version to 0.1.55 Change-Id: I10013b31ca139b34edbd564421d146f4f3373c17 --- packaging/capi-ui-sticker.spec | 2 +- receiver/tizen-manifest.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/capi-ui-sticker.spec b/packaging/capi-ui-sticker.spec index cea1ecc..264efe8 100644 --- a/packaging/capi-ui-sticker.spec +++ b/packaging/capi-ui-sticker.spec @@ -1,6 +1,6 @@ Name: capi-ui-sticker Summary: Sticker client library and daemon -Version: 0.1.54 +Version: 0.1.55 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 diff --git a/receiver/tizen-manifest.xml b/receiver/tizen-manifest.xml index 831445e..9814958 100644 --- a/receiver/tizen-manifest.xml +++ b/receiver/tizen-manifest.xml @@ -1,5 +1,5 @@ - + -- 2.7.4 From a0fea8f60af3722a47f2cfb53ef0b7bb843957cb Mon Sep 17 00:00:00 2001 From: InHong Han Date: Mon, 15 Jun 2020 18:41:16 +0900 Subject: [PATCH 11/16] Change API description by API review Change-Id: Ib9f385840671c0dbc73426f79907603b564e0cf8 --- include/sticker_provider.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/sticker_provider.h b/include/sticker_provider.h index cdfbac4..65a4d78 100644 --- a/include/sticker_provider.h +++ b/include/sticker_provider.h @@ -97,7 +97,7 @@ int sticker_provider_destroy(sticker_provider_h provider_handle); /** * @brief Inserts a sticker data to the sticker database. * @since_tizen 5.5 - * @remarks All data except thumbnail, description, display_type must be set in the @a data_handle to insert the sticker data. + * @remarks All data except thumbnail, description, and display_type must be set in the @a data_handle to insert the sticker data. * If the URI type is #STICKER_DATA_URI_LOCAL_PATH, the sticker file is copied to a sticker directory. * It is recommended to delete your sticker file after inserting a sticker data. * @param[in] provider_handle The sticker provider handle @@ -118,7 +118,7 @@ int sticker_provider_insert_data(sticker_provider_h provider_handle, sticker_dat * @brief Inserts a sticker data using JSON file. * @details @a json_path must be a relative path like '/data/message_sticker.json'. * @since_tizen 5.5 - * @remarks All data except thumbnail, description, display_type must be set in the JSON file to insert the sticker data. + * @remarks All data except thumbnail, description, and display_type must be set in the JSON file to insert the sticker data. * @a json_path must have a non-null value and must be an existing file. If not, the error as invalid parameter will be returned. * If the URI type is #STICKER_DATA_URI_LOCAL_PATH, the sticker file is copied to a sticker directory. * It is recommended to delete your sticker files after inserting a sticker data. @@ -201,7 +201,7 @@ int sticker_provider_update_data(sticker_provider_h provider_handle, sticker_dat int sticker_provider_delete_data(sticker_provider_h provider_handle, sticker_data_h data_handle); /** - * @brief Deletes a sticker data with the given @a uri from the sticker database. + * @brief Deletes a sticker with the given @a uri from the sticker database. * @details If the database does not have a sticker that matches the given @a uri, the STICKER_ERROR_NO_SUCH_FILE error is returned. * @since_tizen 5.5 * @param[in] provider_handle The sticker provider handle -- 2.7.4 From 3e9082d24a1377292cb19093bff6c36e307bc2bd Mon Sep 17 00:00:00 2001 From: InHong Han Date: Mon, 15 Jun 2020 18:42:19 +0900 Subject: [PATCH 12/16] Update package version to 0.1.56 Change-Id: I22a450053bb46a8727472648d9c1e173551fe8d7 --- packaging/capi-ui-sticker.spec | 2 +- receiver/tizen-manifest.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/capi-ui-sticker.spec b/packaging/capi-ui-sticker.spec index 264efe8..48fdec4 100644 --- a/packaging/capi-ui-sticker.spec +++ b/packaging/capi-ui-sticker.spec @@ -1,6 +1,6 @@ Name: capi-ui-sticker Summary: Sticker client library and daemon -Version: 0.1.55 +Version: 0.1.56 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 diff --git a/receiver/tizen-manifest.xml b/receiver/tizen-manifest.xml index 9814958..2a9aff2 100644 --- a/receiver/tizen-manifest.xml +++ b/receiver/tizen-manifest.xml @@ -1,5 +1,5 @@ - + -- 2.7.4 From 61f808e82820973e5bf8e9b31c46a513ce0343ca Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 26 Jun 2020 11:43:16 +0900 Subject: [PATCH 13/16] Keep the directory structure in gcov package Change-Id: If9310998850d1e548256441b7021328459810074 Signed-off-by: Jihoon Kim --- packaging/capi-ui-sticker.spec | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packaging/capi-ui-sticker.spec b/packaging/capi-ui-sticker.spec index 48fdec4..efdabd0 100644 --- a/packaging/capi-ui-sticker.spec +++ b/packaging/capi-ui-sticker.spec @@ -106,8 +106,7 @@ export FFLAGS+=" -DTIZEN_DEBUG_ENABLE -fvisibility=hidden" make %{?jobs:-j%jobs} %if 0%{?gcov:1} -mkdir -p gcov-obj -find . -name '*.gcno' -exec cp '{}' gcov-obj ';' +find . -name '*.gcno' | tar cf %{name}-gcov.tar -T - %endif %install @@ -127,8 +126,8 @@ mkdir -p %{buildroot}%{_sysconfdir}/dbus-1/system.d install -m 0644 %SOURCE3 %{buildroot}%{_sysconfdir}/dbus-1/system.d/capi-ui-sticker.conf %if 0%{?gcov:1} -mkdir -p %{buildroot}%{_datadir}/gcov/obj -install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj +install -d -m 755 %{buildroot}%{_datadir}/gcov/obj +tar xf %{name}-gcov.tar -C %{buildroot}%{_datadir}/gcov/obj %endif %if 0%{?sec_product_feature_profile_wearable} @@ -186,5 +185,5 @@ chsmack -a "User::App::Shared" /opt/usr/share/sticker-data %if 0%{?gcov:1} %files gcov -%{_datadir}/gcov/obj/* +%{_datadir}/gcov/* %endif -- 2.7.4 From 969d5b0994a4cfda9d65dfd6ad17316eac7fdc80 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 26 Jun 2020 19:18:12 +0900 Subject: [PATCH 14/16] Update package version to 0.1.57 Change-Id: I7bf42355224305e609004bfeb04ae48fef71b8a6 Signed-off-by: Jihoon Kim --- packaging/capi-ui-sticker.spec | 2 +- receiver/tizen-manifest.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/capi-ui-sticker.spec b/packaging/capi-ui-sticker.spec index efdabd0..52c61fa 100644 --- a/packaging/capi-ui-sticker.spec +++ b/packaging/capi-ui-sticker.spec @@ -1,6 +1,6 @@ Name: capi-ui-sticker Summary: Sticker client library and daemon -Version: 0.1.56 +Version: 0.1.57 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 diff --git a/receiver/tizen-manifest.xml b/receiver/tizen-manifest.xml index 2a9aff2..f724b35 100644 --- a/receiver/tizen-manifest.xml +++ b/receiver/tizen-manifest.xml @@ -1,5 +1,5 @@ - + -- 2.7.4 From e89babb374b32b2644dd2b7d33c1635fab42eeca Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Sun, 19 Jul 2020 15:30:54 +0900 Subject: [PATCH 15/16] Add exclude section for impossible lines to be executed in TCT Change-Id: I12fd296bbc832d2083d24800f162514f70018cc4 Signed-off-by: Jihoon Kim --- client/sticker_data.c | 12 +++++++----- client/sticker_dbus.c | 22 +++++++++++++++++++++- consumer/sticker_consumer.c | 12 +++++++++--- provider/sticker_provider.c | 18 ++++++++++++------ 4 files changed, 49 insertions(+), 15 deletions(-) diff --git a/client/sticker_data.c b/client/sticker_data.c index cb5c427..c0a5869 100644 --- a/client/sticker_data.c +++ b/client/sticker_data.c @@ -39,21 +39,21 @@ static char* _make_absolute_path(const char *relative_path) ret = app_get_id(&app_id); if (ret != APP_ERROR_NONE) { - LOGE("Failed to get app_id : %d", ret); + LOGE("Failed to get app_id : %d", ret); //LCOV_EXCL_LINE ret = STICKER_ERROR_OPERATION_FAILED; goto cleanup; } ret = package_info_create(app_id, &package_info); if (ret != PACKAGE_MANAGER_ERROR_NONE || package_info == NULL) { - LOGE("failed to create package_info. ret: %d", ret); + LOGE("failed to create package_info. ret: %d", ret); //LCOV_EXCL_LINE ret = STICKER_ERROR_OPERATION_FAILED; goto cleanup; } ret = package_info_get_root_path(package_info, &app_path); if (ret != PACKAGE_MANAGER_ERROR_NONE || app_path == NULL) { - LOGE("failed to create package_info. ret: %d", ret); + LOGE("failed to create package_info. ret: %d", ret); //LCOV_EXCL_LINE ret = STICKER_ERROR_OPERATION_FAILED; goto cleanup; } @@ -61,7 +61,7 @@ static char* _make_absolute_path(const char *relative_path) int path_len = strlen(app_path) + strlen(relative_path) + 2; file_path = (char *)calloc(path_len, sizeof(char)); if (!file_path) { - LOGE("failed to alloc memory"); + LOGE("failed to alloc memory"); //LCOV_EXCL_LINE ret = STICKER_ERROR_OPERATION_FAILED; goto cleanup; } @@ -69,7 +69,7 @@ static char* _make_absolute_path(const char *relative_path) if(relative_path[0] == '/') snprintf(file_path, path_len, "%s%s",app_path, relative_path); else - snprintf(file_path, path_len, "%s%s%s",app_path, "/", relative_path); + snprintf(file_path, path_len, "%s%s%s",app_path, "/", relative_path); //LCOV_EXCL_LINE if (access(file_path, F_OK) != 0) { LOGE("%s does not exist", file_path); @@ -152,10 +152,12 @@ EXPORT_API int sticker_data_create(sticker_data_h *data_handle) char *app_id = NULL; int ret = app_get_id(&app_id); if (ret != APP_ERROR_NONE) { + //LCOV_EXCL_START LOGE("Failed to get app_id : %d", ret); free(data_struct); ret = STICKER_ERROR_OPERATION_FAILED; goto cleanup; + //LCOV_EXCL_STOP } data_struct->app_id = strdup(app_id); diff --git a/client/sticker_dbus.c b/client/sticker_dbus.c index a3c9cfa..2b653da 100644 --- a/client/sticker_dbus.c +++ b/client/sticker_dbus.c @@ -49,10 +49,12 @@ static int _dbus_init(GDBusConnection **gdbus_connection) GDBusConnection *conn = NULL; conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error); if (conn == NULL) { + //LCOV_EXCL_START if (error != NULL) { LOGE("g_bus_get_sync error message = %s", error->message); g_error_free(error); } + //LCOV_EXCL_STOP return STICKER_CLIENT_ERROR_IO_ERROR; } *gdbus_connection = conn; @@ -68,7 +70,7 @@ static int _dbus_init(GDBusConnection **gdbus_connection) LOGD("watch_id : %d", watch_id); if (watch_id == 0) { - LOGE("Failed to get identifier"); + LOGE("Failed to get identifier"); //LCOV_EXCL_LINE return STICKER_CLIENT_ERROR_IO_ERROR; } @@ -352,8 +354,10 @@ static int _dbus_signal_init(GDBusConnection *gdbus_connection, int *monitor_id, NULL); LOGD("id : %d", id); if (id == 0) { + //LCOV_EXCL_START ret = STICKER_CLIENT_ERROR_IO_ERROR; LOGE("g_dbus_connection_signal_subscribe() failed"); + //LCOV_EXCL_STOP } else { *monitor_id = id; } @@ -372,9 +376,11 @@ static GDBusMessage *_get_gbus_message(GVariant *body, const char *cmd) cmd); if (!message) { + //LCOV_EXCL_START LOGE("Failed to create a new gdbus message"); if (body) g_variant_unref(body); + //LCOV_EXCL_STOP return NULL; } @@ -399,6 +405,7 @@ static int _send_gdbus_sync_message(GDBusConnection *gdbus_connection, GDBusMess &err); if (!*reply) { + //LCOV_EXCL_START ret = STICKER_CLIENT_ERROR_SERVICE_NOT_READY; if (err != NULL) { LOGE("Error occurred when sending message(%s) : %s", cmd, err->message); @@ -406,16 +413,19 @@ static int _send_gdbus_sync_message(GDBusConnection *gdbus_connection, GDBusMess ret = STICKER_CLIENT_ERROR_PERMISSION_DENIED; g_error_free(err); } + //LCOV_EXCL_STOP return ret; } if (g_dbus_message_to_gerror(*reply, &err)) { + //LCOV_EXCL_START LOGE("error message = %s, code = %d", err->message, err->code); if (err->code == G_DBUS_ERROR_ACCESS_DENIED) ret = STICKER_CLIENT_ERROR_PERMISSION_DENIED; else ret = err->code; g_error_free(err); + //LCOV_EXCL_STOP return ret; } @@ -456,6 +466,7 @@ static int _send_async_message(GDBusConnection *gdbus_connection, GVariant *body g_object_unref(msg); if (err != NULL) { + //LCOV_EXCL_START ret = STICKER_CLIENT_ERROR_SERVICE_NOT_READY; LOGE("Error occurred when sending message(%s) : %s", cmd, err->message); @@ -464,6 +475,7 @@ static int _send_async_message(GDBusConnection *gdbus_connection, GVariant *body g_error_free(err); return ret; + //LCOV_EXCL_STOP } return ret; @@ -519,20 +531,26 @@ int sticker_dbus_init(GDBusConnection **gdbus_connection, int *server_watcher_id ret = _dbus_init(gdbus_connection); if (ret != STICKER_CLIENT_ERROR_NONE) { + //LCOV_EXCL_START LOGE("_dbus_init() failed : %d", ret); return ret; + //LCOV_EXCL_STOP } ret = _dbus_signal_init(*gdbus_connection, monitor_id, lib, data); if (ret != STICKER_CLIENT_ERROR_NONE) { + //LCOV_EXCL_START LOGE("_dbus_signal_init() failed : %d", ret); return ret; + //LCOV_EXCL_STOP } ret = _monitor_register(*gdbus_connection, server_watcher_id, lib); if (ret != STICKER_CLIENT_ERROR_NONE) { + //LCOV_EXCL_START LOGE("_monitor_register() failed : %d", ret); return ret; + //LCOV_EXCL_STOP } if (*server_monitor_id == 0) { @@ -545,10 +563,12 @@ int sticker_dbus_init(GDBusConnection **gdbus_connection, int *server_watcher_id server_watcher_id, NULL); if (*server_monitor_id == 0) { + //LCOV_EXCL_START g_dbus_connection_signal_unsubscribe(*gdbus_connection, *monitor_id); *monitor_id = 0; LOGE("Failed to get identifier"); return STICKER_CLIENT_ERROR_IO_ERROR; + //LCOV_EXCL_STOP } } diff --git a/consumer/sticker_consumer.c b/consumer/sticker_consumer.c index 1c11f19..4f51fb5 100644 --- a/consumer/sticker_consumer.c +++ b/consumer/sticker_consumer.c @@ -78,7 +78,7 @@ static int _cynara_initialize() { int ret = cynara_initialize(&p_cynara, NULL); if (ret != CYNARA_API_SUCCESS) - LOGE("Failed to cynara initialize"); + LOGE("Failed to cynara initialize"); //LCOV_EXCL_LINE return ret; } @@ -110,7 +110,7 @@ static int _check_privilege(const char *uid, const char *privilege) free(session); if (ret != CYNARA_API_ACCESS_ALLOWED) { - LOGE("Access denied. The result of cynara_check() : %d.", ret); + LOGE("Access denied. The result of cynara_check() : %d.", ret); //LCOV_EXCL_LINE return -1; } @@ -134,7 +134,7 @@ static int _sticker_check_privilege() { snprintf(uid, 16, "%d", getuid()); if (_check_privilege(uid, STICKER_PRIVILEGE_MEDIASTORAGE) < 0) { - LOGE("Permission is denied"); + LOGE("Permission is denied"); //LCOV_EXCL_LINE ret = STICKER_ERROR_PERMISSION_DENIED; } @@ -161,17 +161,21 @@ EXPORT_API int sticker_consumer_create(sticker_consumer_h *consumer_handle) ret = app_get_id(&consumer_struct->app_id); if (ret != APP_ERROR_NONE) { + //LCOV_EXCL_START LOGE("Failed to get app_id : %d", ret); free(consumer_struct); return STICKER_ERROR_OPERATION_FAILED; + //LCOV_EXCL_STOP } ret = sticker_dbus_init(&consumer_struct->gdbus_connection, &consumer_struct->server_watcher_id, &consumer_struct->monitor_id, &consumer_struct->server_monitor_id, STICKER_CLIENT_LIB_CONSUMER, (void *)consumer_struct); if (ret != STICKER_ERROR_NONE) { + //LCOV_EXCL_START LOGE("Failed to initialize dbus : %d", ret); free(consumer_struct); return STICKER_ERROR_OPERATION_FAILED; + //LCOV_EXCL_STOP } *consumer_handle = consumer_struct; @@ -191,9 +195,11 @@ EXPORT_API int sticker_consumer_destroy(sticker_consumer_h consumer_handle) ret = sticker_dbus_shutdown(consumer_handle->gdbus_connection, &consumer_handle->server_watcher_id, &consumer_handle->server_monitor_id, &consumer_handle->monitor_id, STICKER_CLIENT_LIB_CONSUMER); if (ret != STICKER_ERROR_NONE) { + //LCOV_EXCL_START LOGE("Failed to finalize dbus : %d", ret); free(consumer_handle); return STICKER_ERROR_OPERATION_FAILED; + //LCOV_EXCL_STOP } if (consumer_handle->gdbus_connection) diff --git a/provider/sticker_provider.c b/provider/sticker_provider.c index b16db5e..82e32c8 100644 --- a/provider/sticker_provider.c +++ b/provider/sticker_provider.c @@ -87,9 +87,11 @@ EXPORT_API int sticker_provider_create(sticker_provider_h *provider_handle) ret = sticker_dbus_init(&provider_struct->gdbus_connection, &provider_struct->server_watcher_id, &provider_struct->monitor_id, &provider_struct->server_monitor_id, STICKER_CLIENT_LIB_PROVIDER, (void *)provider_struct); if (ret != STICKER_ERROR_NONE) { + //LCOV_EXCL_START LOGE("Failed to initialize dbus : %d", ret); free(provider_struct); return STICKER_ERROR_OPERATION_FAILED; + //LCOV_EXCL_STOP } *provider_handle = provider_struct; @@ -109,9 +111,11 @@ EXPORT_API int sticker_provider_destroy(sticker_provider_h provider_handle) ret = sticker_dbus_shutdown(provider_handle->gdbus_connection, &provider_handle->server_watcher_id, &provider_handle->server_monitor_id, &provider_handle->monitor_id, STICKER_CLIENT_LIB_PROVIDER); if (ret != STICKER_ERROR_NONE) { + //LCOV_EXCL_START LOGE("Failed to finalize dbus : %d", ret); free(provider_handle); return STICKER_ERROR_OPERATION_FAILED; + //LCOV_EXCL_STOP } if (provider_handle->gdbus_connection) @@ -169,7 +173,7 @@ EXPORT_API int sticker_provider_insert_data_by_json_file(sticker_provider_h prov ret = app_get_id(&app_id); if (ret != APP_ERROR_NONE) { - LOGE("Failed to get app_id : %d", ret); + LOGE("Failed to get app_id : %d", ret); //LCOV_EXCL_LINE ret = STICKER_ERROR_OPERATION_FAILED; goto cleanup; } @@ -177,14 +181,14 @@ EXPORT_API int sticker_provider_insert_data_by_json_file(sticker_provider_h prov if (access(json_path, F_OK) != 0) { ret = package_info_create(app_id, &package_info); if (ret != PACKAGE_MANAGER_ERROR_NONE || package_info == NULL) { - LOGE("failed to create package_info. ret: %d", ret); + LOGE("failed to create package_info. ret: %d", ret); //LCOV_EXCL_LINE ret = STICKER_ERROR_OPERATION_FAILED; goto cleanup; } ret = package_info_get_root_path(package_info, &app_path); if (ret != PACKAGE_MANAGER_ERROR_NONE || app_path == NULL) { - LOGE("failed to create package_info. ret: %d", ret); + LOGE("failed to create package_info. ret: %d", ret); //LCOV_EXCL_LINE ret = STICKER_ERROR_OPERATION_FAILED; goto cleanup; } @@ -192,7 +196,7 @@ EXPORT_API int sticker_provider_insert_data_by_json_file(sticker_provider_h prov int path_len = strlen(app_path) + strlen(json_path) + 2; file_path = (char *)calloc(path_len, sizeof(char)); if (!file_path) { - LOGE("failed to alloc memory"); + LOGE("failed to alloc memory"); //LCOV_EXCL_LINE ret = STICKER_ERROR_OPERATION_FAILED; goto cleanup; } @@ -247,6 +251,7 @@ EXPORT_API int sticker_provider_update_data(sticker_provider_h provider_handle, ret = sticker_dbus_update_sticker_info(provider_handle->gdbus_connection, data_handle); if (ret != STICKER_ERROR_NONE) { + //LCOV_EXCL_START LOGE("Failed to update sticker information : %d", ret); if (ret == STICKER_CLIENT_ERROR_FILE_EXISTS) return STICKER_ERROR_FILE_EXISTS; @@ -254,6 +259,7 @@ EXPORT_API int sticker_provider_update_data(sticker_provider_h provider_handle, return STICKER_ERROR_NO_SUCH_FILE; else return STICKER_ERROR_OPERATION_FAILED; + //LCOV_EXCL_STOP } return STICKER_ERROR_NONE; @@ -288,7 +294,7 @@ EXPORT_API int sticker_provider_get_sticker_count(sticker_provider_h provider_ha ret = app_get_id(&app_id); if (ret != APP_ERROR_NONE) { - LOGE("Failed to get app_id : %d", ret); + LOGE("Failed to get app_id : %d", ret); //LCOV_EXCL_LINE ret = STICKER_ERROR_OPERATION_FAILED; goto cleanup; } @@ -321,7 +327,7 @@ EXPORT_API int sticker_provider_data_foreach_all(sticker_provider_h provider_han ret = app_get_id(&app_id); if (ret != APP_ERROR_NONE) { - LOGE("Failed to get app_id : %d", ret); + LOGE("Failed to get app_id : %d", ret); //LCOV_EXCL_LINE ret = STICKER_ERROR_OPERATION_FAILED; goto cleanup; } -- 2.7.4 From 337fb870830a849e25a75a528b7d05170d2b95f3 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 22 Jul 2020 14:57:43 +0900 Subject: [PATCH 16/16] Update package version to 0.1.58 Change-Id: I8615ed2806a92155b417a8d008d2407798f64531 Signed-off-by: Jihoon Kim --- packaging/capi-ui-sticker.spec | 2 +- receiver/tizen-manifest.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/capi-ui-sticker.spec b/packaging/capi-ui-sticker.spec index 52c61fa..0fdadce 100644 --- a/packaging/capi-ui-sticker.spec +++ b/packaging/capi-ui-sticker.spec @@ -1,6 +1,6 @@ Name: capi-ui-sticker Summary: Sticker client library and daemon -Version: 0.1.57 +Version: 0.1.58 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 diff --git a/receiver/tizen-manifest.xml b/receiver/tizen-manifest.xml index f724b35..d9d4dfc 100644 --- a/receiver/tizen-manifest.xml +++ b/receiver/tizen-manifest.xml @@ -1,5 +1,5 @@ - + -- 2.7.4