}
else {
LOGI("Succeed to change permission : %s", sticker_data.file_path.c_str());
- if (create_sticker_provider_handle() == STICKER_ERROR_NONE) {
- char thumb_path[PATH_MAX];
- char *data_path = NULL;
- data_path = app_get_shared_data_path();
- snprintf(thumb_path, sizeof(thumb_path), "%s/thumbnail/%s", data_path, incoming_file_name.c_str());
- sticker_data.thumbnail_path = string(thumb_path);
-
- if (data_path)
- free(data_path);
-
- int ret = thumbnail_util_extract_to_file(sticker_data.file_path.c_str(), THUMBNAIL_WIDTH, THUMBNAIL_HEIGHT, sticker_data.thumbnail_path.c_str());
- if (ret != THUMBNAIL_UTIL_ERROR_NONE) {
- LOGE("Failed to create thumbnail. msg : %s", get_error_message(ret));
- sticker_data.thumbnail_path.clear();
- }
+ char thumb_path[PATH_MAX];
+ char *data_path = NULL;
+ data_path = app_get_shared_data_path();
+ snprintf(thumb_path, sizeof(thumb_path), "%s/thumbnail/%s", data_path, incoming_file_name.c_str());
+ sticker_data.thumbnail_path = string(thumb_path);
+
+ if (data_path)
+ free(data_path);
+
+ int ret = thumbnail_util_extract_to_file(sticker_data.file_path.c_str(), THUMBNAIL_WIDTH, THUMBNAIL_HEIGHT, sticker_data.thumbnail_path.c_str());
+ if (ret != THUMBNAIL_UTIL_ERROR_NONE) {
+ LOGE("Failed to create thumbnail. msg : %s", get_error_message(ret));
+ sticker_data.thumbnail_path.clear();
+ }
- insert_sticker_data(sticker_data.file_path.c_str(), sticker_data.keyword.c_str(), sticker_data.group.c_str(), sticker_data.description.c_str(),
- sticker_data.thumbnail_path.c_str(), sticker_data.disp_type.c_str());
- destroy_sticker_provider_handle();
+ insert_sticker_data(sticker_data.file_path.c_str(), sticker_data.keyword.c_str(), sticker_data.group.c_str(), sticker_data.description.c_str(),
+ sticker_data.thumbnail_path.c_str(), sticker_data.disp_type.c_str());
- if (unlink(sticker_data.file_path.c_str()) == -1)
- LOGE("Failed to remove sticker file");
+ if (unlink(sticker_data.file_path.c_str()) == -1)
+ LOGE("Failed to remove sticker file");
- if (!sticker_data.thumbnail_path.empty()) {
- if (unlink(sticker_data.thumbnail_path.c_str()) == -1)
- LOGE("Failed to remove sticker thumbnail");
- }
+ if (!sticker_data.thumbnail_path.empty()) {
+ if (unlink(sticker_data.thumbnail_path.c_str()) == -1)
+ LOGE("Failed to remove sticker thumbnail");
}
}
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) {
- delete_all_stickers("bitmoji");
- destroy_sticker_provider_handle();
- }
+ delete_all_stickers("bitmoji");
}
} 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_stickers("bitmoji");
- destroy_sticker_provider_handle();
- }
+ delete_all_stickers("bitmoji");
} else if (result_code == SYNC_START_RSP_AREMOJI_ALL_DELETE) {
LOGD("Delete all AR Emoji stickers");
- if (create_sticker_provider_handle() == STICKER_ERROR_NONE) {
- delete_all_stickers("arsticker");
- destroy_sticker_provider_handle();
- }
+ delete_all_stickers("arsticker");
}
if (!process_request_queue()) {
snprintf(del_path, sizeof(del_path), "%s/%s%s",STICKER_DIRECTORY, app_id, file_path);
LOGD("Delete file : %s, len : %d", del_path, file_len);
- if (create_sticker_provider_handle() == STICKER_ERROR_NONE) {
- delete_sticker_data(del_path);
- destroy_sticker_provider_handle();
- }
+ delete_sticker_data(del_path);
if (app_id)
free(app_id);