From 93b4b41339cfccc35c696533e80d4ac85d574af0 Mon Sep 17 00:00:00 2001 From: InHong Han Date: Thu, 7 May 2020 16:24:43 +0900 Subject: [PATCH 01/16] Sort sticker data in reverse order by db index Change-Id: I9535a909b35bc760b55d1bf82f49f7b4197960ad --- server/stickerd_db_manager.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/stickerd_db_manager.c b/server/stickerd_db_manager.c index b13c2ee..85a778e 100644 --- a/server/stickerd_db_manager.c +++ b/server/stickerd_db_manager.c @@ -90,12 +90,12 @@ #define STICKER_DB_GET_ALL_GROUP_LIST "SELECT DISTINCT group_name FROM sticker_info WHERE app_id NOT IN (SELECT DISTINCT provider_id FROM sticker_whitelist_info WHERE provider_id NOT IN (SELECT provider_id FROM sticker_whitelist_info WHERE consumer_id = ?))" #define STICKER_DB_GET_ALL_KEYWORD_LIST "SELECT DISTINCT keyword FROM sticker_keyword_info WHERE sticker_info_id IN (SELECT sticker_info_id from sticker_info WHERE app_id NOT IN (SELECT DISTINCT provider_id FROM sticker_whitelist_info WHERE provider_id NOT IN (SELECT provider_id FROM sticker_whitelist_info WHERE consumer_id = ?)))" #define STICKER_DB_GET_STICKER_COUNT "SELECT count(*) FROM sticker_info WHERE app_id = ?" -#define STICKER_DB_GET_ALL_RECORD_ID "SELECT sticker_info_id FROM sticker_info WHERE app_id NOT IN (SELECT DISTINCT provider_id FROM sticker_whitelist_info WHERE provider_id NOT IN (SELECT provider_id FROM sticker_whitelist_info WHERE consumer_id = ?)) LIMIT ?, ?" -#define STICKER_DB_GET_RECORD_ID_BY_APP_ID "SELECT sticker_info_id from sticker_info WHERE app_id = ? LIMIT ?, ?" -#define STICKER_DB_GET_RECORD_ID_BY_TYPE "SELECT sticker_info_id FROM sticker_info WHERE type = ? AND app_id NOT IN (SELECT DISTINCT provider_id FROM sticker_whitelist_info WHERE provider_id NOT IN (SELECT provider_id FROM sticker_whitelist_info WHERE consumer_id = ?)) LIMIT ?, ?" -#define STICKER_DB_GET_RECORD_ID_BY_GROUP "SELECT sticker_info_id from sticker_info WHERE group_name = ? AND app_id NOT IN (SELECT DISTINCT provider_id FROM sticker_whitelist_info WHERE provider_id NOT IN (SELECT provider_id FROM sticker_whitelist_info WHERE consumer_id = ?)) LIMIT ?, ?" -#define STICKER_DB_GET_RECORD_ID_BY_KEYWORD "SELECT sticker_info_id FROM sticker_keyword_info WHERE keyword = ? INTERSECT SELECT sticker_info_id from sticker_info WHERE app_id NOT IN (SELECT DISTINCT provider_id FROM sticker_whitelist_info WHERE provider_id NOT IN (SELECT provider_id FROM sticker_whitelist_info WHERE consumer_id = ?)) LIMIT ?, ?" -#define STICKER_DB_GET_RECORD_ID_BY_DISP_TYPE "SELECT sticker_info_id FROM sticker_info WHERE display_type = ? AND app_id NOT IN (SELECT DISTINCT provider_id FROM sticker_whitelist_info WHERE provider_id NOT IN (SELECT provider_id FROM sticker_whitelist_info WHERE consumer_id = ?)) LIMIT ?, ?" +#define STICKER_DB_GET_ALL_RECORD_ID "SELECT sticker_info_id FROM sticker_info WHERE app_id NOT IN (SELECT DISTINCT provider_id FROM sticker_whitelist_info WHERE provider_id NOT IN (SELECT provider_id FROM sticker_whitelist_info WHERE consumer_id = ?)) ORDER BY sticker_info_id DESC LIMIT ?, ?" +#define STICKER_DB_GET_RECORD_ID_BY_APP_ID "SELECT sticker_info_id from sticker_info WHERE app_id = ? ORDER BY sticker_info_id DESC LIMIT ?, ?" +#define STICKER_DB_GET_RECORD_ID_BY_TYPE "SELECT sticker_info_id FROM sticker_info WHERE type = ? AND app_id NOT IN (SELECT DISTINCT provider_id FROM sticker_whitelist_info WHERE provider_id NOT IN (SELECT provider_id FROM sticker_whitelist_info WHERE consumer_id = ?)) ORDER BY sticker_info_id DESC LIMIT ?, ?" +#define STICKER_DB_GET_RECORD_ID_BY_GROUP "SELECT sticker_info_id from sticker_info WHERE group_name = ? AND app_id NOT IN (SELECT DISTINCT provider_id FROM sticker_whitelist_info WHERE provider_id NOT IN (SELECT provider_id FROM sticker_whitelist_info WHERE consumer_id = ?)) ORDER BY sticker_info_id DESC LIMIT ?, ?" +#define STICKER_DB_GET_RECORD_ID_BY_KEYWORD "SELECT sticker_info_id FROM sticker_keyword_info WHERE keyword = ? INTERSECT SELECT sticker_info_id from sticker_info WHERE app_id NOT IN (SELECT DISTINCT provider_id FROM sticker_whitelist_info WHERE provider_id NOT IN (SELECT provider_id FROM sticker_whitelist_info WHERE consumer_id = ?)) ORDER BY sticker_info_id DESC LIMIT ?, ?" +#define STICKER_DB_GET_RECORD_ID_BY_DISP_TYPE "SELECT sticker_info_id FROM sticker_info WHERE display_type = ? AND app_id NOT IN (SELECT DISTINCT provider_id FROM sticker_whitelist_info WHERE provider_id NOT IN (SELECT provider_id FROM sticker_whitelist_info WHERE consumer_id = ?)) ORDER BY sticker_info_id DESC LIMIT ?, ?" #define STICKER_DB_GET_GROUP_LIST_BY_DISP_TYPE "SELECT DISTINCT group_name FROM sticker_info WHERE display_type = ? AND app_id NOT IN (SELECT DISTINCT provider_id FROM sticker_whitelist_info WHERE provider_id NOT IN (SELECT provider_id FROM sticker_whitelist_info WHERE consumer_id = ?))" #define STICKER_DB_CHECK_FILE_EXISTS "SELECT EXISTS(SELECT 1 FROM sticker_info WHERE uri = ? LIMIT 1)" #define STICKER_DB_CHECK_RECENT_HISTORY_EXISTS "SELECT EXISTS(SELECT 1 FROM sticker_recent_history_info WHERE sticker_info_id = ? LIMIT 1)" -- 2.7.4 From e67386207a9fd8cbac33b656086987dab3fddfea Mon Sep 17 00:00:00 2001 From: InHong Han Date: Thu, 7 May 2020 19:12:50 +0900 Subject: [PATCH 02/16] Fix issue auto synchronization does not work Change-Id: I344a1a4e209a4b902cc97d90e80dba565d34624c --- receiver/src/ft.cpp | 84 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 49 insertions(+), 35 deletions(-) diff --git a/receiver/src/ft.cpp b/receiver/src/ft.cpp index 29450fa..98870c8 100644 --- a/receiver/src/ft.cpp +++ b/receiver/src/ft.cpp @@ -415,24 +415,67 @@ bool request_sticker_data(const char *mode, const char *category, const char *ty return result; } +static bool process_request_queue() +{ + if (ReqQueue.empty()) + return false; + + StickerRequest request = ReqQueue.front(); + + if (request.req_type == REQUEST_TYPE_FEATURE_REQ) { + LOGD("[Request feature exchange]"); + request_sticker_feature(); + ReqQueue.pop(); + } + else if (request.req_type == REQUEST_TYPE_SYNC) { + LOGD("[Request to sync sticker] mode: %s, category: %s, type : %s", request.mode.c_str(), + request.category.c_str(), + request.type.c_str()); + + if (request_sticker_data(request.mode.c_str(), request.category.c_str(), request.type.c_str())) + ReqQueue.pop(); + } + else if (request.req_type == REQUEST_TYPE_SHOW_NOTIFICATION) { + LOGD("[Request to show notification]"); + request_show_sync_notification(); + ReqQueue.pop(); + } + + return true; +} + void request_all_sticker_data(const char *mode, const char *type) { + StickerRequest pending_request; + pending_request.req_type = REQUEST_TYPE_SYNC; + pending_request.mode = string(mode); + pending_request.type = string(type); + #ifdef VCONFKEY_STICKER_SUPPORTED_FEATURE int feature_flag = 0; if (vconf_get_int(VCONFKEY_STICKER_SUPPORTED_FEATURE, &feature_flag) == 0) { - if (feature_flag & VCONFKEY_STICKER_FEATURE_AREMOJI) - request_sticker_data(mode, "arsticker", type); + if (feature_flag & VCONFKEY_STICKER_FEATURE_AREMOJI) { + pending_request.category = string("arsticker"); + ReqQueue.push(pending_request); + } - if (feature_flag & VCONFKEY_STICKER_FEATURE_BITMOJI) - request_sticker_data(mode, "bitmoji", type); + if (feature_flag & VCONFKEY_STICKER_FEATURE_BITMOJI) { + pending_request.category = string("bitmoji"); + ReqQueue.push(pending_request); + } } else LOGW("Failed to get value of VCONFKEY_STICKER_SUPPORTED_FEATURE"); #else - request_sticker_data(mode, "arsticker", type); - request_sticker_data(mode, "bitmoji", type); + pending_request.category = string("arsticker"); + ReqQueue.push(pending_request); + pending_request.category = string("bitmoji"); + ReqQueue.push(pending_request); #endif + + if (priv_data.socket) + process_request_queue(); } void request_sticker_feature() @@ -578,35 +621,6 @@ void conn_terminated(sap_peer_agent_h peer_agent, service_app_exit(); } -static bool process_request_queue() -{ - if (ReqQueue.empty()) - return false; - - StickerRequest request = ReqQueue.front(); - - if (request.req_type == REQUEST_TYPE_FEATURE_REQ) { - LOGD("[Request feature exchange]"); - request_sticker_feature(); - ReqQueue.pop(); - } - else if (request.req_type == REQUEST_TYPE_SYNC) { - LOGD("[Request to sync sticker] mode: %s, category: %s, type : %s", request.mode.c_str(), - request.category.c_str(), - request.type.c_str()); - - if (request_sticker_data(request.mode.c_str(), request.category.c_str(), request.type.c_str())) - ReqQueue.pop(); - } - else if (request.req_type == REQUEST_TYPE_SHOW_NOTIFICATION) { - LOGD("[Request to show notification]"); - request_show_sync_notification(); - ReqQueue.pop(); - } - - return true; -} - static void quit() { job_progress = FALSE; -- 2.7.4 From 84cb0dd30061eb4635b031887744538e5311f6ef Mon Sep 17 00:00:00 2001 From: InHong Han Date: Thu, 7 May 2020 21:03:07 +0900 Subject: [PATCH 03/16] Update package version to 0.1.44 Change-Id: Id3b276ddb07ba1acc47e2a4cc6c2cb124208469d --- 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 8b43584..efe50ed 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.43 +Version: 0.1.44 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 diff --git a/receiver/tizen-manifest.xml b/receiver/tizen-manifest.xml index b2e6cd8..d394841 100644 --- a/receiver/tizen-manifest.xml +++ b/receiver/tizen-manifest.xml @@ -1,5 +1,5 @@ - + -- 2.7.4 From 54786f4b14095f253ba8de9da2bf7d0f0776d616 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 8 May 2020 14:30:52 +0900 Subject: [PATCH 04/16] Add -Wall in build flag for avoiding build error Change-Id: I5523c48fcd436424fb970883f61284f6dfa45ec1 Signed-off-by: Jihoon Kim --- consumer/CMakeLists.txt | 2 +- provider/CMakeLists.txt | 2 +- receiver/CMakeLists.txt | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/consumer/CMakeLists.txt b/consumer/CMakeLists.txt index 0e554b0..f98cc42 100644 --- a/consumer/CMakeLists.txt +++ b/consumer/CMakeLists.txt @@ -10,7 +10,7 @@ INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/include) FOREACH(flag ${pkgs_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall") ## Add definitions ## ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"") diff --git a/provider/CMakeLists.txt b/provider/CMakeLists.txt index 9eb6d49..ea3c48a 100644 --- a/provider/CMakeLists.txt +++ b/provider/CMakeLists.txt @@ -10,7 +10,7 @@ INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/include) FOREACH(flag ${pkgs_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall") ## Add definitions ## ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"") diff --git a/receiver/CMakeLists.txt b/receiver/CMakeLists.txt index 90c3837..4797abb 100644 --- a/receiver/CMakeLists.txt +++ b/receiver/CMakeLists.txt @@ -35,8 +35,8 @@ ENDFOREACH(flag) ADD_DEFINITIONS("-DEXPORTED=__attribute__((visibility(\"default\")))") -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE") -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} -fPIE") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -fPIE") +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} -Wall -fPIE") SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie") FIND_PROGRAM(UNAME NAMES uname) -- 2.7.4 From f11c2c857c3379e9286979e25ce7425d632edc7d Mon Sep 17 00:00:00 2001 From: InHong Han Date: Fri, 8 May 2020 17:02:52 +0900 Subject: [PATCH 05/16] Add code to delete all bitmoji stickers Change-Id: I333cae24dd42da9aada3721143851ed48df3b5ec --- receiver/inc/sticker_info.h | 1 + receiver/src/ft.cpp | 16 +++++++++++----- receiver/src/sticker_info.cpp | 31 +++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 5 deletions(-) diff --git a/receiver/inc/sticker_info.h b/receiver/inc/sticker_info.h index 9784b5a..8deac5e 100644 --- a/receiver/inc/sticker_info.h +++ b/receiver/inc/sticker_info.h @@ -21,5 +21,6 @@ void insert_sticker_data(const char *filepath, const char *keyword, const char * int create_sticker_provider_handle(void); void destroy_sticker_provider_handle(void); void delete_sticker_data(const char *fileName); +void delete_all_bitmoji_stickers(); #endif /* __STICKER_INFO_H__ */ diff --git a/receiver/src/ft.cpp b/receiver/src/ft.cpp index 98870c8..9982af9 100644 --- a/receiver/src/ft.cpp +++ b/receiver/src/ft.cpp @@ -66,7 +66,8 @@ using namespace std; enum { SYNC_START_RSP_SUCCESS = 1000, - SYNC_START_RSP_NO_STICKER = 1001 + SYNC_START_RSP_NO_STICKER = 1001, + SYNC_START_RSP_BITMOJI_ALL_DELETE = 1002 }; struct sap_info_s { @@ -633,7 +634,7 @@ static void send_sync_start_response(int result_code) int feature_flag = 0; string response_to_app; switch (result_code) { - case SYNC_START_RSP_SUCCESS: + case SYNC_START_RSP_SUCCESS || SYNC_START_RSP_BITMOJI_ALL_DELETE: { response_to_app = "success"; if (current_request.category == string("arsticker")) @@ -753,7 +754,7 @@ on_data_received(sap_socket_h socket, unsigned short int channel_id, unsigned in send_sync_start_response(result_code); - if (result_code != SYNC_START_RSP_SUCCESS) { + if (result_code == SYNC_START_RSP_NO_STICKER) { if (!process_request_queue()) { #ifdef VCONFKEY_STICKER_SUPPORTED_FEATURE int feature_flag = 0; @@ -780,11 +781,16 @@ on_data_received(sap_socket_h socket, unsigned short int channel_id, unsigned in #endif /* VCONFKEY_STICKER_SUPPORTED_FEATURE */ set_sync_progressing(FALSE); - if (result_code == SYNC_START_RSP_NO_STICKER) - save_last_sync_time(); + save_last_sync_time(); quit(); } + } else if (result_code == SYNC_START_RSP_BITMOJI_ALL_DELETE) { + LOGD("Delete all bitmoji stickers"); + if (create_sticker_provider_handle() == STICKER_ERROR_NONE) { + delete_all_bitmoji_stickers(); + destroy_sticker_provider_handle(); + } } } else if (msg_id == STICKER_SEND_START_REQ) { LOGD("msg : %s", msg_id.c_str()); diff --git a/receiver/src/sticker_info.cpp b/receiver/src/sticker_info.cpp index 2d5e58d..2b59d57 100644 --- a/receiver/src/sticker_info.cpp +++ b/receiver/src/sticker_info.cpp @@ -142,4 +142,35 @@ void delete_sticker_data(const char *fileName) ret = sticker_provider_delete_data_by_uri(sticker_provider, fileName); if (ret != STICKER_ERROR_NONE) LOGE("Failed to delete sticker. ret : %d", ret); +} + +static void _delete_all_bitmoji_stickers_cb(sticker_data_h data_handle, void *user_data) +{ + int ret; + char *group = NULL; + + ret = sticker_data_get_group_name(data_handle, &group); + if (ret != STICKER_ERROR_NONE) + LOGE("Failed to get group name. ret : %d", ret); + + if (strcmp(group, "bitmoji") == 0) { + ret = sticker_provider_delete_data(sticker_provider, data_handle); + if (ret != STICKER_ERROR_NONE) + LOGE("Failed to delete sticker. ret : %d", ret); + } +} + +void delete_all_bitmoji_stickers() +{ + int ret; + int total_cnt; + int result; + + ret = sticker_provider_get_sticker_count(sticker_provider, &total_cnt); + if (ret != STICKER_ERROR_NONE) + LOGE("Failed to get sticker count. ret : %d", ret); + + ret = sticker_provider_data_foreach_all(sticker_provider, 0, total_cnt, &result, _delete_all_bitmoji_stickers_cb, NULL); + if (ret != STICKER_ERROR_NONE) + LOGE("Failed to retrieve all sticker data. ret : %d", ret); } \ No newline at end of file -- 2.7.4 From 7a6ec037ea66ba4d3297857078469e34626f74ca Mon Sep 17 00:00:00 2001 From: InHong Han Date: Mon, 11 May 2020 16:39:43 +0900 Subject: [PATCH 06/16] Fix issue the current time is initialized whenever the device is restarted Change-Id: Ie1310dc403ed46ee5705cc7cf88f1c3c6cd12434 --- receiver/src/ft.cpp | 2 +- receiver/src/main.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/receiver/src/ft.cpp b/receiver/src/ft.cpp index 9982af9..336e965 100644 --- a/receiver/src/ft.cpp +++ b/receiver/src/ft.cpp @@ -94,7 +94,7 @@ static int sync_complete_flags = 0; static void save_last_sync_time() { // save last sync time in preference - double current_time = ecore_time_get(); + double current_time = ecore_time_unix_get(); if (preference_set_double(LAST_SYNC_TIME, current_time) == PREFERENCE_ERROR_NONE) { LOGI("Succeed to set last sync time : %f", current_time); } diff --git a/receiver/src/main.cpp b/receiver/src/main.cpp index 6a7cb61..34b9837 100644 --- a/receiver/src/main.cpp +++ b/receiver/src/main.cpp @@ -98,14 +98,14 @@ static bool check_sync_time_condition() } // compare time - LOGD("current time : %f, last_sync_time : %f", ecore_time_get(), last_sync_time); + LOGD("current time : %f, last_sync_time : %f", ecore_time_unix_get(), last_sync_time); - if (ecore_time_get() - last_sync_time > MAX_WAIT_TIME) { + if (ecore_time_unix_get() - last_sync_time > MAX_WAIT_TIME) { initialize_sap(); request_show_sync_notification(); result = false; } else { - if (ecore_time_get() - last_sync_time > SYNC_INTERVAL) + if (ecore_time_unix_get() - last_sync_time > SYNC_INTERVAL) result = true; else result = false; -- 2.7.4 From 93c3e73693eb25d3229f99d12d35a71e9f5aa04e Mon Sep 17 00:00:00 2001 From: InHong Han Date: Mon, 11 May 2020 18:15:02 +0900 Subject: [PATCH 07/16] Update package version to 0.1.45 Change-Id: Id7b7c1de80a4534635439abf18e129b7ab3c959f --- 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 efe50ed..c3f1454 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.44 +Version: 0.1.45 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 diff --git a/receiver/tizen-manifest.xml b/receiver/tizen-manifest.xml index d394841..2a9bd06 100644 --- a/receiver/tizen-manifest.xml +++ b/receiver/tizen-manifest.xml @@ -1,5 +1,5 @@ - + -- 2.7.4 From 8ec7918a8eb9d1c0ba675199131484e081a5158f Mon Sep 17 00:00:00 2001 From: InHong Han Date: Tue, 12 May 2020 10:34:33 +0900 Subject: [PATCH 08/16] Terminate sticker-receiver after deleting stickers Change-Id: I3cff68c6698f9b55b88d9fb171d95c51e1f2917c --- receiver/src/ft.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/receiver/src/ft.cpp b/receiver/src/ft.cpp index 336e965..044c21e 100644 --- a/receiver/src/ft.cpp +++ b/receiver/src/ft.cpp @@ -791,6 +791,14 @@ on_data_received(sap_socket_h socket, unsigned short int channel_id, unsigned in delete_all_bitmoji_stickers(); destroy_sticker_provider_handle(); } + + set_sync_progressing(FALSE); + save_last_sync_time(); + + if (!process_request_queue()) { + sync_success_cnt = 0; + quit(); + } } } else if (msg_id == STICKER_SEND_START_REQ) { LOGD("msg : %s", msg_id.c_str()); -- 2.7.4 From d0057bd4c4558668e3c54c3f717c8cfcd99a60d8 Mon Sep 17 00:00:00 2001 From: InHong Han Date: Tue, 12 May 2020 10:42:46 +0900 Subject: [PATCH 09/16] Update package version to 0.1.46 Change-Id: I3f420ed2d840f73a12c82dce46154db70273d32e --- 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 c3f1454..fa59d3f 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.45 +Version: 0.1.46 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 diff --git a/receiver/tizen-manifest.xml b/receiver/tizen-manifest.xml index 2a9bd06..307d7db 100644 --- a/receiver/tizen-manifest.xml +++ b/receiver/tizen-manifest.xml @@ -1,5 +1,5 @@ - + -- 2.7.4 From c831b0b50625fb9164fb3d07fc438c27c61ffcc9 Mon Sep 17 00:00:00 2001 From: InHong Han Date: Thu, 14 May 2020 15:52:45 +0900 Subject: [PATCH 10/16] Modified to not change return value Change-Id: Ie0ca9082d13018cef06b7e45a80c0a07ecea3622 --- client/sticker_data.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/sticker_data.c b/client/sticker_data.c index 5b6b7ae..cb5c427 100644 --- a/client/sticker_data.c +++ b/client/sticker_data.c @@ -318,9 +318,9 @@ cleanup: _free_sticker_data(handle); if (gdbus_connection) { - ret = sticker_dbus_shutdown(gdbus_connection, &server_watcher_id, &server_monitor_id, &monitor_id, STICKER_CLIENT_LIB_PROVIDER); - if (ret != STICKER_ERROR_NONE) - LOGE("Failed to finalize dbus : %d", ret); + int ret_err = sticker_dbus_shutdown(gdbus_connection, &server_watcher_id, &server_monitor_id, &monitor_id, STICKER_CLIENT_LIB_PROVIDER); + if (ret_err != STICKER_ERROR_NONE) + LOGE("Failed to finalize dbus : %d", ret_err); g_object_unref(gdbus_connection); } -- 2.7.4 From 9cb6a838f4c8b34a5be6ff857ed39a19aae4b927 Mon Sep 17 00:00:00 2001 From: InHong Han Date: Thu, 14 May 2020 15:55:47 +0900 Subject: [PATCH 11/16] Update package version to 0.1.47 Change-Id: Iccd9d7d4e0354c24a23196e7a26f5d4357a4487f --- 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 fa59d3f..acfd81d 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.46 +Version: 0.1.47 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 diff --git a/receiver/tizen-manifest.xml b/receiver/tizen-manifest.xml index 307d7db..a788ce2 100644 --- a/receiver/tizen-manifest.xml +++ b/receiver/tizen-manifest.xml @@ -1,5 +1,5 @@ - + -- 2.7.4 From 0705df06a179d918e03837b53abdfa325fe5c533 Mon Sep 17 00:00:00 2001 From: InHong Han Date: Fri, 15 May 2020 12:35:58 +0900 Subject: [PATCH 12/16] Delete all bitmoji stickers before synchronizing them Change-Id: I09540680be692fd10aba742593a9c688b011d825 --- 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 044c21e..4e03352 100644 --- a/receiver/src/ft.cpp +++ b/receiver/src/ft.cpp @@ -754,7 +754,15 @@ on_data_received(sap_socket_h socket, unsigned short int channel_id, unsigned in send_sync_start_response(result_code); - if (result_code == SYNC_START_RSP_NO_STICKER) { + if(result_code == SYNC_START_RSP_SUCCESS) { + if (current_request.category == string("bitmoji")) { + LOGD("Delete all bitmoji stickers"); + if (create_sticker_provider_handle() == STICKER_ERROR_NONE) { + delete_all_bitmoji_stickers(); + destroy_sticker_provider_handle(); + } + } + } else if (result_code == SYNC_START_RSP_NO_STICKER) { if (!process_request_queue()) { #ifdef VCONFKEY_STICKER_SUPPORTED_FEATURE int feature_flag = 0; -- 2.7.4 From 7eb1ffdbfc90ebd868b15e2385c6f622ec26e2b3 Mon Sep 17 00:00:00 2001 From: InHong Han Date: Fri, 15 May 2020 15:27:31 +0900 Subject: [PATCH 13/16] Fix the issue no_sticker message was not delivered after OOBE Change-Id: I83fde1a99c224f25b345d05a00918fd3143e8dba --- receiver/src/ft.cpp | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/receiver/src/ft.cpp b/receiver/src/ft.cpp index 4e03352..1ab77b0 100644 --- a/receiver/src/ft.cpp +++ b/receiver/src/ft.cpp @@ -634,7 +634,7 @@ static void send_sync_start_response(int result_code) int feature_flag = 0; string response_to_app; switch (result_code) { - case SYNC_START_RSP_SUCCESS || SYNC_START_RSP_BITMOJI_ALL_DELETE: + case SYNC_START_RSP_SUCCESS: { response_to_app = "success"; if (current_request.category == string("arsticker")) @@ -646,6 +646,18 @@ static void send_sync_start_response(int result_code) case SYNC_START_RSP_NO_STICKER: response_to_app = "no_sticker"; break; + case SYNC_START_RSP_BITMOJI_ALL_DELETE: + { + int is_synced = 0; + if (vconf_get_int(VCONFKEY_STICKER_SYNC_COMPLETE, &is_synced) != 0) + LOGW("Failed to read sync completion"); + + if (is_synced == VCONFKEY_STICKER_SYNC_COMPLETE_NONE) + response_to_app = "no_sticker"; + else + response_to_app = "success"; + break; + } default: response_to_app = "unknown_error"; break; @@ -752,9 +764,8 @@ on_data_received(sap_socket_h socket, unsigned short int channel_id, unsigned in int result_code = json_object_get_int_member(root_obj, "resultCode"); LOGD("result : %s, resultCode : %d", result.c_str(), result_code); - send_sync_start_response(result_code); - if(result_code == SYNC_START_RSP_SUCCESS) { + send_sync_start_response(result_code); if (current_request.category == string("bitmoji")) { LOGD("Delete all bitmoji stickers"); if (create_sticker_provider_handle() == STICKER_ERROR_NONE) { @@ -762,7 +773,15 @@ on_data_received(sap_socket_h socket, unsigned short int channel_id, unsigned in destroy_sticker_provider_handle(); } } - } else if (result_code == SYNC_START_RSP_NO_STICKER) { + } else { + if (result_code == SYNC_START_RSP_BITMOJI_ALL_DELETE) { + LOGD("Delete all bitmoji stickers"); + if (create_sticker_provider_handle() == STICKER_ERROR_NONE) { + delete_all_bitmoji_stickers(); + destroy_sticker_provider_handle(); + } + } + if (!process_request_queue()) { #ifdef VCONFKEY_STICKER_SUPPORTED_FEATURE int feature_flag = 0; @@ -788,25 +807,12 @@ on_data_received(sap_socket_h socket, unsigned short int channel_id, unsigned in LOGW("No vconf supported feature"); #endif /* VCONFKEY_STICKER_SUPPORTED_FEATURE */ + send_sync_start_response(result_code); set_sync_progressing(FALSE); save_last_sync_time(); quit(); } - } else if (result_code == SYNC_START_RSP_BITMOJI_ALL_DELETE) { - LOGD("Delete all bitmoji stickers"); - if (create_sticker_provider_handle() == STICKER_ERROR_NONE) { - delete_all_bitmoji_stickers(); - destroy_sticker_provider_handle(); - } - - set_sync_progressing(FALSE); - save_last_sync_time(); - - if (!process_request_queue()) { - sync_success_cnt = 0; - quit(); - } } } else if (msg_id == STICKER_SEND_START_REQ) { LOGD("msg : %s", msg_id.c_str()); -- 2.7.4 From 2181271e0c24c11226cb2ebed7fdf3326adb4e56 Mon Sep 17 00:00:00 2001 From: InHong Han Date: Fri, 15 May 2020 15:30:35 +0900 Subject: [PATCH 14/16] Update package version to 0.1.48 Change-Id: I437fb131fb57044a34661d6d51b2dad7c9c6eb20 --- 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 acfd81d..652ec6c 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.47 +Version: 0.1.48 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 diff --git a/receiver/tizen-manifest.xml b/receiver/tizen-manifest.xml index a788ce2..fdf99da 100644 --- a/receiver/tizen-manifest.xml +++ b/receiver/tizen-manifest.xml @@ -1,5 +1,5 @@ - + -- 2.7.4 From 54e45a83c8caca4af16e43b672f0a8140171fb0f Mon Sep 17 00:00:00 2001 From: InHong Han Date: Fri, 15 May 2020 20:20:55 +0900 Subject: [PATCH 15/16] Change sticker directory to TZ_USER_SHARE Change-Id: If2652a9659688a1638d4643e53081bbb16855395 --- client/sticker_dbus.c | 2 +- packaging/capi-ui-sticker.spec | 10 +++++----- server/stickerd_data_manager.c | 2 +- sticker-parser/sticker-parser.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/client/sticker_dbus.c b/client/sticker_dbus.c index 6cf0088..ff54639 100644 --- a/client/sticker_dbus.c +++ b/client/sticker_dbus.c @@ -23,7 +23,7 @@ #endif #define LOG_TAG "STICKER_DBUS" -#define STICKER_DIRECTORY tzplatform_mkpath(TZ_SYS_SHARE, "sticker-data") +#define STICKER_DIRECTORY tzplatform_mkpath(TZ_USER_SHARE, "sticker-data") static int is_server_started = 0; static CLIENT_LIB last_req_lib = STICKER_CLIENT_LIB_NONE; diff --git a/packaging/capi-ui-sticker.spec b/packaging/capi-ui-sticker.spec index 652ec6c..0f880c6 100644 --- a/packaging/capi-ui-sticker.spec +++ b/packaging/capi-ui-sticker.spec @@ -101,7 +101,7 @@ export FFLAGS+=" -DTIZEN_DEBUG_ENABLE -fvisibility=hidden" -DCOMPANION_MODE=true \ %endif -DCMAKE_INSTALL_PREFIX=/usr -DLIBDIR=%{_libdir} -DBINDIR=%{_bindir} -DINCLUDEDIR=%{_includedir} \ - -DTZ_SYS_RO_SHARE=%TZ_SYS_RO_SHARE -DTZ_SYS_BIN=%TZ_SYS_BIN -DTZ_SYS_SHARE=%TZ_SYS_SHARE \ + -DTZ_SYS_RO_SHARE=%TZ_SYS_RO_SHARE -DTZ_SYS_BIN=%TZ_SYS_BIN -DTZ_USER_SHARE=%TZ_USER_SHARE \ -DTZ_SYS_RO_APP=%TZ_SYS_RO_APP -DTZ_SYS_RO_PACKAGES=%TZ_SYS_RO_PACKAGES make %{?jobs:-j%jobs} @@ -142,10 +142,10 @@ install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj %post /sbin/ldconfig -mkdir -p -m 0775 %{TZ_SYS_SHARE}/sticker-data -chown -R ui_fw:ui_fw %{TZ_SYS_SHARE}/sticker-data -chsmack -t %{TZ_SYS_SHARE}/sticker-data -chsmack -a "System::Shared" %{TZ_SYS_SHARE}/sticker-data +mkdir -p -m 0775 %{TZ_USER_SHARE}/sticker-data +chown -R ui_fw:ui_fw %{TZ_USER_SHARE}/sticker-data +chsmack -t %{TZ_USER_SHARE}/sticker-data +chsmack -a "System::Shared" %{TZ_USER_SHARE}/sticker-data %postun -p /sbin/ldconfig diff --git a/server/stickerd_data_manager.c b/server/stickerd_data_manager.c index c731971..60b1a22 100644 --- a/server/stickerd_data_manager.c +++ b/server/stickerd_data_manager.c @@ -39,7 +39,7 @@ #endif #define LOG_TAG "STICKERD_DATA_MANAGER" -#define STICKER_DIRECTORY tzplatform_mkpath(TZ_SYS_SHARE, "sticker-data") +#define STICKER_DIRECTORY tzplatform_mkpath(TZ_USER_SHARE, "sticker-data") #define MAX_ERROR_BUFFER 256 static GHashTable *_monitoring_hash = NULL; diff --git a/sticker-parser/sticker-parser.c b/sticker-parser/sticker-parser.c index a9c92ea..3b25fca 100644 --- a/sticker-parser/sticker-parser.c +++ b/sticker-parser/sticker-parser.c @@ -40,7 +40,7 @@ #endif #define LOG_TAG "STICKER_PARSER" -#define STICKER_DIRECTORY tzplatform_mkpath(TZ_SYS_SHARE, "sticker-data") +#define STICKER_DIRECTORY tzplatform_mkpath(TZ_USER_SHARE, "sticker-data") #define STICKER_INFO_CREATE_TABLE "CREATE TABLE IF NOT EXISTS sticker_info(sticker_info_id INTEGER PRIMARY KEY AUTOINCREMENT, app_id TEXT NOT NULL, type INTEGER NOT NULL, uri TEXT NOT NULL, thumbnail TEXT, description TEXT, group_name TEXT NOT NULL, date TEXT NOT NULL, display_type INTEGER)" #define STICKER_KEYWORD_INFO_CREATE_TABLE "CREATE TABLE IF NOT EXISTS sticker_keyword_info(keyword_id INTEGER PRIMARY KEY AUTOINCREMENT, sticker_info_id INTEGER, keyword TEXT NOT NULL, FOREIGN KEY (sticker_info_id) REFERENCES sticker_info(sticker_info_id) ON DELETE CASCADE)" #define STICKER_WHITELIST_INFO_CREATE_TABLE "CREATE TABLE IF NOT EXISTS sticker_whitelist_info(whitelist_id INTEGER PRIMARY KEY AUTOINCREMENT, provider_id TEXT NOT NULL, consumer_id TEXT NOT NULL)" -- 2.7.4 From cbe27384744716d9a1641f0dee455cc31186f164 Mon Sep 17 00:00:00 2001 From: InHong Han Date: Fri, 15 May 2020 20:24:44 +0900 Subject: [PATCH 16/16] Update package version to 0.1.49 Change-Id: I93b575249dc0622ecb2cfc068f7fbd66e8216607 --- 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 0f880c6..cca6428 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.48 +Version: 0.1.49 Release: 1 Group: Graphics & UI Framework/Input License: Apache-2.0 diff --git a/receiver/tizen-manifest.xml b/receiver/tizen-manifest.xml index fdf99da..4eeb56e 100644 --- a/receiver/tizen-manifest.xml +++ b/receiver/tizen-manifest.xml @@ -1,5 +1,5 @@ - + -- 2.7.4