#define TAG "STICKER_RECEIVER"
void insert_sticker_data(const char *filepath, const char *keyword, const char *group, const char *desc);
-void create_sticker_provider_handle(void);
+int create_sticker_provider_handle(void);
void destroy_sticker_provider_handle(void);
#endif /* __STICKER_INF_H__ */
}
else {
dlog_print(DLOG_INFO, TAG, "Succeed to change permission : %s", recv_filepath.c_str());
- create_sticker_provider_handle();
- insert_sticker_data(recv_filepath.c_str(), "keyword", "group", "test icon");
- destroy_sticker_provider_handle();
+ if (create_sticker_provider_handle() == STICKER_ERROR_NONE) {
+ insert_sticker_data(recv_filepath.c_str(), "keyword", "group", "test icon");
+ destroy_sticker_provider_handle();
+
+ if (unlink(recv_filepath.c_str()) == -1)
+ dlog_print(DLOG_ERROR, TAG, "Failed to remove sticker file");
+ }
}
} else {
switch (result) {
}
}
-void create_sticker_provider_handle(void)
+int create_sticker_provider_handle(void)
{
int ret;
ret = sticker_provider_create(&sticker_provider);
/* Error handling */
dlog_print(DLOG_ERROR, TAG, "Failed to create sticker provider");
}
+
+ return ret;
}
void destroy_sticker_provider_handle(void)