From ee31e38ee34dce27b142d9f80807e45430c5bf6d Mon Sep 17 00:00:00 2001 From: Seungha Son Date: Wed, 27 Dec 2017 18:14:13 +0900 Subject: [PATCH] Rename log macro Signed-off-by: Seungha Son Change-Id: I3accae47bc7a8bb93436c53aea8aed75ce614bfa --- include/notification_debug.h | 16 +-- src/notification.c | 69 ++++++----- src/notification_db.c | 23 ++-- src/notification_db_query.h | 8 +- src/notification_group.c | 13 +- src/notification_internal.c | 53 ++++----- src/notification_ipc.c | 236 ++++++++++++++++++------------------- src/notification_list.c | 20 ++-- src/notification_noti.c | 111 +++++++++-------- src/notification_ongoing.c | 20 ++-- src/notification_setting.c | 148 +++++++++++------------ src/notification_setting_service.c | 88 +++++++------- src/notification_shared_file.c | 78 ++++++------ src/notification_status.c | 16 +-- src/notification_viewer.c | 16 +-- 15 files changed, 454 insertions(+), 461 deletions(-) diff --git a/include/notification_debug.h b/include/notification_debug.h index 6b2133e..f3f0514 100644 --- a/include/notification_debug.h +++ b/include/notification_debug.h @@ -27,44 +27,44 @@ #ifndef _DLOG_H_ #include -#define NOTIFICATION_DBG(fmt , args...) \ +#define DBG(fmt , args...) \ do { \ printf("[D][%s : %d] "fmt"\n", __func__, __LINE__, ##args); \ } while (0) -#define NOTIFICATION_INFO(fmt , args...) \ +#define INFO(fmt , args...) \ do { \ printf("[I][%s : %d] "fmt"\n", __func__, __LINE__, ##args); \ } while (0) -#define NOTIFICATION_WARN(fmt , args...) \ +#define WARN(fmt , args...) \ do { \ printf("[W][%s : %d] "fmt"\n", __func__, __LINE__, ##args); \ } while (0) -#define NOTIFICATION_ERR(fmt , args...) \ +#define ERR(fmt , args...) \ do { \ printf("[E][%s : %d] "fmt"\n", __func__, __LINE__, ##args); \ } while (0) #else /* _DLOG_H_ */ -#define NOTIFICATION_DBG(fmt , args...) \ +#define DBG(fmt , args...) \ do { \ SECURE_LOGD("[%s : %d] "fmt"\n", __func__, __LINE__, ##args); \ } while (0) -#define NOTIFICATION_INFO(fmt , args...) \ +#define INFO(fmt , args...) \ do { \ SECURE_LOGI("[%s : %d] "fmt"\n", __func__, __LINE__, ##args); \ } while (0) -#define NOTIFICATION_WARN(fmt , args...) \ +#define WARN(fmt , args...) \ do { \ SECURE_LOGW("[%s : %d] "fmt"\n", __func__, __LINE__, ##args); \ } while (0) -#define NOTIFICATION_ERR(fmt , args...) \ +#define ERR(fmt , args...) \ do { \ SECURE_LOGE("[%s : %d] "fmt"\n", __func__, __LINE__, ##args); \ } while (0) diff --git a/src/notification.c b/src/notification.c index b3f4069..b6718af 100755 --- a/src/notification.c +++ b/src/notification.c @@ -84,7 +84,7 @@ char *notification_get_app_id_by_pid(int pid) dup_app_id = strdup(app_id); if (!dup_app_id) - NOTIFICATION_ERR("Failed to strdup, errno[%d]", errno); + ERR("Failed to strdup, errno[%d]", errno); return dup_app_id; } @@ -403,8 +403,7 @@ EXPORT_API int notification_set_text(notification_h noti, break; default: - NOTIFICATION_ERR("Invalid variable type. : %d", - var_type); + ERR("Invalid variable type. : %d", var_type); noti_err = NOTIFICATION_ERROR_INVALID_PARAMETER; break; } @@ -560,7 +559,7 @@ EXPORT_API int notification_get_text(notification_h noti, if (NOTI_TEXT_RESULT_LEN - 1 > strlen(result_str)) { strncat(result_str, temp_str, 1); } else { - NOTIFICATION_WARN("The buffer is full"); + WARN("The buffer is full"); break; } } else { @@ -568,7 +567,7 @@ EXPORT_API int notification_get_text(notification_h noti, if (NOTI_TEXT_RESULT_LEN - 1 > strlen(result_str)) { strncat(result_str, temp_str, 1); } else { - NOTIFICATION_WARN("The buffer is full"); + WARN("The buffer is full"); break; } } else if (*(temp_str + 1) == 'd') { @@ -622,14 +621,12 @@ EXPORT_API int notification_get_text(notification_h noti, bindtextdomain(noti->domain, noti->dir); translated_str = dgettext(noti->domain, ret_val); - NOTIFICATION_INFO("translated_str[%s]", - translated_str); + INFO("translated_str[%s]", translated_str); } else if (ret_val != NULL) { /* Get system string */ translated_str = dgettext("sys_string", ret_val); - NOTIFICATION_INFO("translated_str[%s]", - translated_str); + INFO("translated_str[%s]", translated_str); } else { translated_str = NULL; } @@ -741,7 +738,7 @@ EXPORT_API int notification_get_text(notification_h noti, if (NOTI_TEXT_RESULT_LEN - 1 > strlen(result_str)) { strncat(result_str, temp_str, 1); } else { - NOTIFICATION_WARN("The buffer is full"); + WARN("The buffer is full"); break; } } @@ -749,7 +746,7 @@ EXPORT_API int notification_get_text(notification_h noti, if (NOTI_TEXT_RESULT_LEN - 1 > strlen(result_str)) { strncat(result_str, temp_str, 1); } else { - NOTIFICATION_WARN("The buffer is full"); + WARN("The buffer is full"); break; } } @@ -1117,7 +1114,7 @@ EXPORT_API int notification_set_launch_option(notification_h noti, } if ((ret = app_control_export_as_bundle(app_control, &b)) != APP_CONTROL_ERROR_NONE) { - NOTIFICATION_ERR("Failed to convert appcontrol to bundle[%d]", ret); + ERR("Failed to convert appcontrol to bundle[%d]", ret); err = NOTIFICATION_ERROR_INVALID_PARAMETER; goto out; } @@ -1158,19 +1155,19 @@ EXPORT_API int notification_get_launch_option(notification_h noti, } else { /* LCOV_EXCL_START */ app_control_destroy(app_control_new); - NOTIFICATION_ERR("Failed to import app control from bundle[%d]", ret); + ERR("Failed to import app control from bundle[%d]", ret); return NOTIFICATION_ERROR_IO_ERROR; /* LCOV_EXCL_STOP */ } } else { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to create app control[%d]", ret); + ERR("Failed to create app control[%d]", ret); return NOTIFICATION_ERROR_IO_ERROR; /* LCOV_EXCL_STOP */ } } else { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to get execute option[%d]", ret); + ERR("Failed to get execute option[%d]", ret); return ret; /* LCOV_EXCL_STOP */ } @@ -1185,19 +1182,19 @@ EXPORT_API int notification_set_event_handler(notification_h noti, notification_ if (noti == NULL) { err = NOTIFICATION_ERROR_INVALID_PARAMETER; - NOTIFICATION_ERR("Invalid notification handle"); + ERR("Invalid notification handle"); goto out; } if (event_type < NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_1 || event_type > NOTIFICATION_EVENT_TYPE_MAX) { - NOTIFICATION_ERR("Invalid event type"); + ERR("Invalid event type"); err = NOTIFICATION_ERROR_INVALID_PARAMETER; goto out; } if ((err = app_control_export_as_bundle(event_handler, &app_control_bundle)) != APP_CONTROL_ERROR_NONE) { - NOTIFICATION_ERR("Failed to export app_control to bundle[%d]", err); + ERR("Failed to export app_control to bundle[%d]", err); goto out; } @@ -1218,14 +1215,14 @@ EXPORT_API int notification_get_event_handler(notification_h noti, notification_ if (noti == NULL || event_handler == NULL) { err = NOTIFICATION_ERROR_INVALID_PARAMETER; - NOTIFICATION_ERR("Invalid handle"); + ERR("Invalid handle"); goto out; } if (event_type < NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_1 || event_type > NOTIFICATION_EVENT_TYPE_MAX) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Invalid event type"); + ERR("Invalid event type"); err = NOTIFICATION_ERROR_INVALID_PARAMETER; goto out; /* LCOV_EXCL_STOP */ @@ -1234,7 +1231,7 @@ EXPORT_API int notification_get_event_handler(notification_h noti, notification_ b = noti->b_event_handler[event_type]; if (b == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("No event handler"); + ERR("No event handler"); err = NOTIFICATION_ERROR_NOT_EXIST_ID; goto out; /* LCOV_EXCL_STOP */ @@ -1243,7 +1240,7 @@ EXPORT_API int notification_get_event_handler(notification_h noti, notification_ err = app_control_create(&app_control_new); if (err != APP_CONTROL_ERROR_NONE || app_control_new == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failted to create app_control[%d]", err); + ERR("Failed to create app_control[%d]", err); err = NOTIFICATION_ERROR_IO_ERROR; goto out; /* LCOV_EXCL_STOP */ @@ -1256,7 +1253,7 @@ EXPORT_API int notification_get_event_handler(notification_h noti, notification_ /* LCOV_EXCL_START */ app_control_destroy(app_control_new); app_control_new = NULL; - NOTIFICATION_ERR("Failed to import app control from bundle[%d]", err); + ERR("Failed to import app control from bundle[%d]", err); err = NOTIFICATION_ERROR_IO_ERROR; goto out; /* LCOV_EXCL_STOP */ @@ -1462,7 +1459,7 @@ static notification_h _notification_create(notification_type_e type) int err = 0; if (type <= NOTIFICATION_TYPE_NONE || type > NOTIFICATION_TYPE_MAX) { - NOTIFICATION_ERR("Invalid notification type[%d]", type); + ERR("Invalid notification type[%d]", type); set_last_result(NOTIFICATION_ERROR_INVALID_PARAMETER); return NULL; } @@ -1470,7 +1467,7 @@ static notification_h _notification_create(notification_type_e type) noti = (notification_h)calloc(1, sizeof(struct _notification)); if (noti == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc memory"); + ERR("Failed to alloc memory"); set_last_result(NOTIFICATION_ERROR_OUT_OF_MEMORY); return NULL; /* LCOV_EXCL_STOP */ @@ -1494,7 +1491,7 @@ static notification_h _notification_create(notification_type_e type) noti->auto_remove = true; noti->caller_app_id = notification_get_app_id_by_pid(getpid()); if (noti->caller_app_id == NULL) { - NOTIFICATION_ERR("Failed to get caller_app_id"); + ERR("Failed to get caller_app_id"); err = -1; goto out; } @@ -1517,7 +1514,7 @@ static notification_h _notification_create(notification_type_e type) err = _notification_get_domain_name(pkg_id, &domain_name); if (err != 0 || domain_name == NULL) { - NOTIFICATION_WARN("Failed to get domain_name"); + WARN("Failed to get domain_name"); err = 0; /* In the case of the web app, the domain can not be obtained. */ @@ -1529,7 +1526,7 @@ static notification_h _notification_create(notification_type_e type) err = package_info_create(pkg_id, &package_info); if (err != PACKAGE_MANAGER_ERROR_NONE || package_info == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_WARN("Failed to create package_info err[%d] pkg_id[%s]", + WARN("Failed to create package_info err[%d] pkg_id[%s]", err, pkg_id); goto out; /* LCOV_EXCL_STOP */ @@ -1538,7 +1535,7 @@ static notification_h _notification_create(notification_type_e type) err = package_info_get_root_path(package_info, &app_root_path); if (err != PACKAGE_MANAGER_ERROR_NONE || app_root_path == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_WARN("Failed to get root path err[%d] path[%p]", + WARN("Failed to get root path err[%d] path[%p]", err, app_root_path); goto out; /* LCOV_EXCL_STOP */ @@ -1550,7 +1547,7 @@ static notification_h _notification_create(notification_type_e type) err = pkgmgrinfo_appinfo_get_usr_appinfo(noti->caller_app_id, getuid(), &appinfo); if (err != PMINFO_R_OK || appinfo == NULL) { - NOTIFICATION_WARN("Failed to get appinfo err[%d]", + WARN("Failed to get appinfo err[%d]", err, noti->caller_app_id); err = 0; goto out; @@ -1558,7 +1555,7 @@ static notification_h _notification_create(notification_type_e type) err = pkgmgrinfo_appinfo_get_label(appinfo, &label); if (err != PMINFO_R_OK || label == NULL) { - NOTIFICATION_WARN("Failed to get app_label err[%d]", err); + WARN("Failed to get app_label err[%d]", err); err = 0; goto out; } @@ -1611,14 +1608,14 @@ EXPORT_API int notification_clone(notification_h noti, notification_h *clone) notification_h new_noti = NULL; if (noti == NULL || clone == NULL) { - NOTIFICATION_ERR("Invalid handle"); + ERR("Invalid handle"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } new_noti = (notification_h) calloc(1, sizeof(struct _notification)); if (new_noti == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc memory"); + ERR("Failed to alloc memory"); return NOTIFICATION_ERROR_OUT_OF_MEMORY; /* LCOV_EXCL_STOP */ } @@ -1924,7 +1921,7 @@ EXPORT_API int notification_get_auto_remove(notification_h noti, bool *auto_remo EXPORT_API int notification_save_as_template(notification_h noti, const char *template_name) { if (noti == NULL || template_name == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -1937,7 +1934,7 @@ EXPORT_API notification_h notification_create_from_template(const char *template notification_h noti = NULL; if (template_name == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); set_last_result(NOTIFICATION_ERROR_INVALID_PARAMETER); return NULL; } @@ -1945,7 +1942,7 @@ EXPORT_API notification_h notification_create_from_template(const char *template noti = (notification_h)calloc(1, sizeof(struct _notification)); if (noti == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc memory"); + ERR("Failed to alloc memory"); set_last_result(NOTIFICATION_ERROR_OUT_OF_MEMORY); return NULL; /* LCOV_EXCL_STOP */ diff --git a/src/notification_db.c b/src/notification_db.c index 4510e1c..5f9a925 100755 --- a/src/notification_db.c +++ b/src/notification_db.c @@ -32,12 +32,12 @@ static bool is_db_corrupted = false; static int __check_integrity_cb(void *pid, int argc, char **argv, char **notUsed) { if (!strcmp(argv[0], "ok")) { - NOTIFICATION_ERR("db integrity result : %s" , argv[0]); + ERR("db integrity result : %s" , argv[0]); is_db_corrupted = true; return -1; } - NOTIFICATION_INFO("db integrity result : %s" , argv[0]); + INFO("db integrity result : %s" , argv[0]); return 0; } @@ -47,7 +47,7 @@ static int __recover_corrupted_db(sqlite3 *db) int sql_ret; char *errmsg = NULL; - NOTIFICATION_INFO("DB is corrupted, start to recover corrupted db"); + INFO("DB is corrupted, start to recover corrupted db"); if (db) sqlite3_close(db); unlink(DBPATH); @@ -56,7 +56,7 @@ static int __recover_corrupted_db(sqlite3 *db) SQLITE_OPEN_CREATE |SQLITE_OPEN_READWRITE, NULL); if (sql_ret != SQLITE_OK) { - NOTIFICATION_ERR("Failed to open db[%d]", sql_ret); + ERR("Failed to open db[%d]", sql_ret); unlink(DBPATH); ret = NOTIFICATION_ERROR_FROM_DB; goto out; @@ -64,7 +64,7 @@ static int __recover_corrupted_db(sqlite3 *db) sql_ret = sqlite3_exec(db, CREATE_NOTIFICATION_TABLE, NULL, NULL, &errmsg); if (sql_ret != SQLITE_OK) { - NOTIFICATION_ERR("Failed to exec query[%d][%s]", sql_ret, errmsg); + ERR("Failed to exec query[%d][%s]", sql_ret, errmsg); ret = NOTIFICATION_ERROR_FROM_DB; } @@ -86,7 +86,7 @@ EXPORT_API int notification_db_init() SQLITE_OPEN_CREATE | SQLITE_OPEN_READWRITE, NULL); if (sql_ret != SQLITE_OK) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to open db[%d]", ret); + ERR("Failed to open db[%d]", ret); ret = NOTIFICATION_ERROR_FROM_DB; goto out; /* LCOV_EXCL_STOP */ @@ -95,7 +95,7 @@ EXPORT_API int notification_db_init() sql_ret = sqlite3_exec(db, CREATE_NOTIFICATION_TABLE, NULL, NULL, &errmsg); if (sql_ret != SQLITE_OK) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to exec sqlite[%d][%s]", ret, errmsg); + ERR("Failed to exec sqlite[%d][%s]", ret, errmsg); ret = NOTIFICATION_ERROR_FROM_DB; goto out; /* LCOV_EXCL_STOP */ @@ -104,7 +104,7 @@ EXPORT_API int notification_db_init() sql_ret = sqlite3_exec(db, "PRAGMA integrity_check", __check_integrity_cb, NULL, &errmsg); if (sql_ret != SQLITE_OK || is_db_corrupted) { - NOTIFICATION_ERR("Failed to exec query[%d][%s]", sql_ret, errmsg); + ERR("Failed to exec query[%d][%s]", sql_ret, errmsg); ret = NOTIFICATION_ERROR_FROM_DB; } @@ -157,7 +157,7 @@ int notification_db_close(sqlite3 **db) ret = sqlite3_close(*db); if (ret != SQLITE_OK) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to close db[%d]", ret); + ERR("Failed to close db[%d]", ret); return NOTIFICATION_ERROR_FROM_DB; /* LCOV_EXCL_STOP */ } @@ -178,7 +178,7 @@ int notification_db_exec(sqlite3 *db, const char *query, int *num_changes) ret = sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL); if (ret != SQLITE_OK) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Sqlite3 err[%d][%s]", ret, sqlite3_errmsg(db)); + ERR("Sqlite3 err[%d][%s]", ret, sqlite3_errmsg(db)); return NOTIFICATION_ERROR_FROM_DB; /* LCOV_EXCL_STOP */ } @@ -191,8 +191,7 @@ int notification_db_exec(sqlite3 *db, const char *query, int *num_changes) ret = NOTIFICATION_ERROR_NONE; } else { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Sqlite err[%d][%s]", ret, - sqlite3_errmsg(db)); + ERR("Sqlite err[%d][%s]", ret, sqlite3_errmsg(db)); ret = NOTIFICATION_ERROR_FROM_DB; /* LCOV_EXCL_STOP */ } diff --git a/src/notification_db_query.h b/src/notification_db_query.h index 19a2da5..62cae67 100755 --- a/src/notification_db_query.h +++ b/src/notification_db_query.h @@ -302,7 +302,7 @@ do { \ ret = sqlite3_bind_text(stmt, i, text, -1, SQLITE_TRANSIENT); \ if (ret != SQLITE_OK) { \ - NOTIFICATION_ERR("bind error(index %d): [%d][%s]", i, ret, \ + ERR("bind error(index %d): [%d][%s]", i, ret, \ sqlite3_errmsg(db)); \ ret = NOTIFICATION_ERROR_FROM_DB; \ goto label; \ @@ -313,7 +313,7 @@ do { \ do { \ ret = sqlite3_bind_text(stmt, i, text, -1, SQLITE_STATIC); \ if (ret != SQLITE_OK) { \ - NOTIFICATION_ERR("bind error(index %d): [%d][%s]", i, ret, \ + ERR("bind error(index %d): [%d][%s]", i, ret, \ sqlite3_errmsg(db)); \ ret = NOTIFICATION_ERROR_FROM_DB; \ goto label; \ @@ -324,7 +324,7 @@ do { \ do { \ ret = sqlite3_bind_int(stmt, i, int); \ if (ret != SQLITE_OK) { \ - NOTIFICATION_ERR("bind error(index %d): [%d][%s]", i, ret, \ + ERR("bind error(index %d): [%d][%s]", i, ret, \ sqlite3_errmsg(db)); \ ret = NOTIFICATION_ERROR_FROM_DB; \ goto label; \ @@ -335,7 +335,7 @@ do { \ do { \ ret = sqlite3_bind_double(stmt, i, double); \ if (ret != SQLITE_OK) { \ - NOTIFICATION_ERR("bind error(index %d): [%d][%s]", i, ret, \ + ERR("bind error(index %d): [%d][%s]", i, ret, \ sqlite3_errmsg(db)); \ ret = NOTIFICATION_ERROR_FROM_DB; \ goto label; \ diff --git a/src/notification_group.c b/src/notification_group.c index ea39ab5..07e149d 100755 --- a/src/notification_group.c +++ b/src/notification_group.c @@ -37,8 +37,7 @@ static int _notification_group_check_data_inserted(const char *app_id, ret = sqlite3_prepare(db, query, strlen(query), &stmt, NULL); if (ret != SQLITE_OK) { - NOTIFICATION_ERR("Get count DB err(%d) : %s", ret, - sqlite3_errmsg(db)); + ERR("Get count DB err(%d) : %s", ret, sqlite3_errmsg(db)); return NOTIFICATION_ERROR_FROM_DB; } @@ -54,7 +53,7 @@ static int _notification_group_check_data_inserted(const char *app_id, if (result > 0) return NOTIFICATION_ERROR_ALREADY_EXIST_ID; - NOTIFICATION_INFO("Check Data Inserted appid[%s] group_id[%d] result[%d]", + INFO("Check Data Inserted appid[%s] group_id[%d] result[%d]", app_id, group_id, result); return NOTIFICATION_ERROR_NONE; @@ -93,7 +92,7 @@ int notification_group_set_badge(const char *app_id, ret = sqlite3_prepare_v2(db, query, -1, &stmt, NULL); if (ret != SQLITE_OK) { - NOTIFICATION_ERR("Failed to insert data app_id[%s] err[%d][%s]", + ERR("Failed to insert data app_id[%s] err[%d][%s]", app_id, ret, sqlite3_errmsg(db)); if (stmt) sqlite3_finalize(stmt); @@ -157,12 +156,12 @@ int notification_group_get_badge(const char *app_id, app_id, group_id); } - NOTIFICATION_INFO("Get badge : query[%s]", query); + INFO("Get badge : query[%s]", query); ret = sqlite3_prepare(db, query, strlen(query), &stmt, NULL); if (ret != SQLITE_OK) { - NOTIFICATION_ERR("Failed to insert data app_id[%s] err[%d][%s]", - app_id, ret, sqlite3_errmsg(db)); + ERR("Failed to insert data app_id[%s] err[%d][%s]", + app_id, ret, sqlite3_errmsg(db)); if (db) notification_db_close(&db); diff --git a/src/notification_internal.c b/src/notification_internal.c index 2516bc8..c7da4d8 100755 --- a/src/notification_internal.c +++ b/src/notification_internal.c @@ -106,7 +106,7 @@ void notification_call_changed_cb_for_uid(notification_op *op_list, int op_num, return; if (op_list == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return; } @@ -229,7 +229,7 @@ EXPORT_API int notification_resister_changed_cb_for_uid( noti_cb_info_new = (notification_cb_info_s *)malloc(sizeof(notification_cb_info_s)); if (noti_cb_info_new == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc memory"); + ERR("Failed to alloc memory"); return NOTIFICATION_ERROR_OUT_OF_MEMORY; /* LCOV_EXCL_STOP */ } @@ -1013,7 +1013,7 @@ notification_h notification_load_for_uid(char *app_id, noti = (notification_h)calloc(1, sizeof(struct _notification)); if (noti == NULL) { - NOTIFICATION_ERR("Failed to alloc memory"); + ERR("Failed to alloc memory"); set_last_result(NOTIFICATION_ERROR_OUT_OF_MEMORY); return NULL; } @@ -1193,7 +1193,7 @@ EXPORT_API int notification_register_detailed_changed_cb_for_uid( noti_cb_info_new = (notification_cb_info_s *)malloc(sizeof(notification_cb_info_s)); if (noti_cb_info_new == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc memory"); + ERR("Failed to alloc memory"); return NOTIFICATION_ERROR_OUT_OF_MEMORY; /* LCOV_EXCL_STOP */ } @@ -1402,7 +1402,7 @@ EXPORT_API int notification_post_for_uid(notification_h noti, uid_t uid) ret = notification_ipc_request_insert(noti, &id); if (ret == NOTIFICATION_ERROR_NONE) { noti->priv_id = id; - NOTIFICATION_INFO("Posted notification id[%d]", id); + INFO("Posted notification id[%d]", id); } else { g_list_foreach(file_list, __remove_private_file, NULL); } @@ -1461,7 +1461,7 @@ EXPORT_API notification_h notification_load_by_tag_for_uid(const char *tag, uid_ char *caller_app_id; if (tag == NULL) { - NOTIFICATION_ERR("Invalid tag"); + ERR("Invalid tag"); set_last_result(NOTIFICATION_ERROR_INVALID_PARAMETER); return NULL; } @@ -1469,7 +1469,7 @@ EXPORT_API notification_h notification_load_by_tag_for_uid(const char *tag, uid_ caller_app_id = notification_get_app_id_by_pid(getpid()); if (!caller_app_id) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to get a package name"); + ERR("Failed to get a package name"); set_last_result(NOTIFICATION_ERROR_OUT_OF_MEMORY); return NULL; /* LCOV_EXCL_STOP */ @@ -1478,7 +1478,7 @@ EXPORT_API notification_h notification_load_by_tag_for_uid(const char *tag, uid_ noti = (notification_h)calloc(1, sizeof(struct _notification)); if (noti == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc a new notification"); + ERR("Failed to alloc a new notification"); set_last_result(NOTIFICATION_ERROR_OUT_OF_MEMORY); free(caller_app_id); @@ -1504,7 +1504,7 @@ EXPORT_API notification_h notification_create_from_package_template(const char * notification_h noti; if (app_id == NULL || template_name == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); set_last_result(NOTIFICATION_ERROR_INVALID_PARAMETER); return NULL; } @@ -1512,7 +1512,7 @@ EXPORT_API notification_h notification_create_from_package_template(const char * noti = (notification_h)calloc(1, sizeof(struct _notification)); if (noti == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc memory"); + ERR("Failed to alloc memory"); set_last_result(NOTIFICATION_ERROR_OUT_OF_MEMORY); return NULL; /* LCOV_EXCL_STOP */ @@ -1685,7 +1685,7 @@ EXPORT_API int notification_post_with_event_cb_for_uid(notification_h noti, even info = (notification_event_cb_info_s *)malloc(sizeof(notification_cb_info_s)); if (info == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc memory"); + ERR("Failed to alloc memory"); return NOTIFICATION_ERROR_OUT_OF_MEMORY; /* LCOV_EXCL_STOP */ } @@ -1767,7 +1767,7 @@ EXPORT_API int notification_check_event_receiver_available(notification_h noti, ret = notification_get_id(noti, NULL, &priv_id); if (ret != NOTIFICATION_ERROR_NONE) { - NOTIFICATION_ERR("Failed to get priv id"); + ERR("Failed to get priv id"); return ret; } @@ -1867,13 +1867,13 @@ EXPORT_API int notification_set_extension_event_handler(notification_h noti, char *del = NULL; if (noti == NULL || event_handler == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } if (event < NOTIFICATION_EVENT_TYPE_HIDDEN_BY_USER || event > NOTIFICATION_EVENT_TYPE_HIDDEN_BY_EXTERNAL) { - NOTIFICATION_ERR("Invalid event [%d]", event); + ERR("Invalid event [%d]", event); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -1890,7 +1890,7 @@ EXPORT_API int notification_set_extension_event_handler(notification_h noti, err = app_control_export_as_bundle(event_handler, &app_control_bundle); if (err != APP_CONTROL_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to export app_control to bundle [%d]", err); + ERR("Failed to export app_control to bundle [%d]", err); ret = NOTIFICATION_ERROR_IO_ERROR; goto out; /* LCOV_EXCL_STOP */ @@ -1899,7 +1899,7 @@ EXPORT_API int notification_set_extension_event_handler(notification_h noti, err = bundle_encode(app_control_bundle, &b_raw, &len); if (err != BUNDLE_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to encode bundle [%d]", err); + ERR("Failed to encode bundle [%d]", err); ret = NOTIFICATION_ERROR_IO_ERROR; goto out; /* LCOV_EXCL_STOP */ @@ -1908,7 +1908,7 @@ EXPORT_API int notification_set_extension_event_handler(notification_h noti, err = bundle_add_str(noti->args, key, (const char *)b_raw); if (err != BUNDLE_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to add str to bundle [%d]", err); + ERR("Failed to add str to bundle [%d]", err); ret = NOTIFICATION_ERROR_IO_ERROR; goto out; /* LCOV_EXCL_STOP */ @@ -1935,13 +1935,13 @@ EXPORT_API int notification_get_extension_event_handler(notification_h noti, app_control_h ret_app_control = NULL; if (noti == NULL || event_handler == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } if (event < NOTIFICATION_EVENT_TYPE_HIDDEN_BY_USER || event > NOTIFICATION_EVENT_TYPE_HIDDEN_BY_EXTERNAL) { - NOTIFICATION_ERR("Invalid event [%d]", event); + ERR("Invalid event [%d]", event); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -1949,14 +1949,14 @@ EXPORT_API int notification_get_extension_event_handler(notification_h noti, bundle_get_str(noti->args, key, &ret_str); if (ret_str == NULL) { - NOTIFICATION_ERR("No handler, Invalid event[%d]", event); + ERR("No handler, Invalid event[%d]", event); return NOTIFICATION_ERROR_INVALID_PARAMETER; } app_control_bundle = _create_bundle_from_bundle_raw((bundle_raw *)ret_str); if (app_control_bundle == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to create bundle"); + ERR("Failed to create bundle"); return NOTIFICATION_ERROR_IO_ERROR; /* LCOV_EXCL_STOP */ } @@ -1964,7 +1964,7 @@ EXPORT_API int notification_get_extension_event_handler(notification_h noti, err = app_control_create(&ret_app_control); if (err != APP_CONTROL_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to create app control [%d]", err); + ERR("Failed to create app control [%d]", err); ret = NOTIFICATION_ERROR_IO_ERROR; goto out; /* LCOV_EXCL_STOP */ @@ -1973,8 +1973,7 @@ EXPORT_API int notification_get_extension_event_handler(notification_h noti, err = app_control_import_from_bundle(ret_app_control, app_control_bundle); if (err != APP_CONTROL_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to import app control from bundle [%d]", - err); + ERR("Failed to import app control from bundle [%d]", err); app_control_destroy(ret_app_control); ret = NOTIFICATION_ERROR_IO_ERROR; goto out; @@ -1995,18 +1994,18 @@ EXPORT_API int notification_get_all_count_for_uid(notification_type_e type, int int ret; if (count == NULL) { - NOTIFICATION_ERR("Invalid parameter - count is null"); + ERR("Invalid parameter - count is null"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } if (type < NOTIFICATION_TYPE_NONE || type > NOTIFICATION_TYPE_MAX) { - NOTIFICATION_ERR("Invalid parameter - wrong type"); + ERR("Invalid parameter - wrong type"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } ret = notification_ipc_request_get_all_count(type, count, uid); if (ret != NOTIFICATION_ERROR_NONE) { - NOTIFICATION_ERR("Failed to get count [%d]", ret); + ERR("Failed to get count [%d]", ret); return ret; } diff --git a/src/notification_ipc.c b/src/notification_ipc.c index fd625c6..d435e3a 100755 --- a/src/notification_ipc.c +++ b/src/notification_ipc.c @@ -81,7 +81,7 @@ static void _print_noti(notification_h noti) notification_get_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT, &content); notification_get_tag(noti, &tag); - NOTIFICATION_DBG("Noti-info : app_id[%s] title[%s] content[%s] tag[%s] priv_id[%d]", + DBG("Noti-info : app_id[%s] title[%s] content[%s] tag[%s] priv_id[%d]", app_id, text, content, tag, noti->priv_id); } @@ -101,7 +101,7 @@ static void __provider_appeared_cb(GDBusConnection *connection, const gchar *name_owner, gpointer user_data) { - NOTIFICATION_INFO("name [%s] name_owner[%s]", name, name_owner); + INFO("name [%s] name_owner[%s]", name, name_owner); notification_reset_event_handler_list(); } @@ -110,7 +110,7 @@ static void __provider_vanished_cb(GDBusConnection *connection, const gchar *name, gpointer user_data) { - NOTIFICATION_INFO("name [%s]", name); + INFO("name [%s]", name); } /* LCOV_EXCL_STOP */ @@ -124,7 +124,7 @@ static int _dbus_init() if (_gdbus_conn == NULL) { /* LCOV_EXCL_START */ if (error != NULL) { - NOTIFICATION_ERR("Failed to get dbus[%s]", + ERR("Failed to get dbus[%s]", error->message); g_error_free(error); } @@ -132,7 +132,7 @@ static int _dbus_init() /* LCOV_EXCL_STOP */ } _bus_name = g_dbus_connection_get_unique_name(_gdbus_conn); - NOTIFICATION_INFO("Connected bus name[%s]", _bus_name); + INFO("Connected bus name[%s]", _bus_name); notification_error_quark(); } @@ -145,7 +145,7 @@ static int _dbus_init() __provider_vanished_cb, NULL, NULL); - NOTIFICATION_DBG("Watching data-provider-master is [%s] watcher_id [%d]", + DBG("Watching data-provider-master is [%s] watcher_id [%d]", provider_watcher_id ? "success" : "fail", provider_watcher_id); } @@ -162,7 +162,7 @@ int notification_ipc_is_master_ready(void) ret = _dbus_init(); if (ret != NOTIFICATION_ERROR_NONE) { - NOTIFICATION_ERR("Failed to init dbus connection[%d]", ret); + ERR("Failed to init dbus connection[%d]", ret); is_master_started = 0; return is_master_started; } @@ -182,19 +182,19 @@ int notification_ipc_is_master_ready(void) if (err || (result == NULL)) { if (err) { - NOTIFICATION_ERR("No reply[%s]", err->message); + ERR("No reply[%s]", err->message); g_error_free(err); } - NOTIFICATION_ERR("Failed to ready master"); + ERR("Failed to ready master"); is_master_started = 0; } else { g_variant_get(result, "(b)", &name_exist); if (!name_exist) { - NOTIFICATION_ERR("The master has been stopped, Not exsited name[%s]", PROVIDER_BUS_NAME); + ERR("The master has been stopped, Not exsited name[%s]", PROVIDER_BUS_NAME); is_master_started = 0; } else { - NOTIFICATION_DBG("The master has been started"); + DBG("The master has been started"); is_master_started = 1; } } @@ -301,7 +301,7 @@ static void _do_deffered_task(void) while (list_do != NULL) { if (list_do->task_cb != NULL) { list_do->task_cb(list_do->data); - NOTIFICATION_DBG("called:%p", list_do->task_cb); + DBG("called:%p", list_do->task_cb); } list_temp = list_do->next; free(list_do); @@ -325,7 +325,7 @@ static notification_op *_ipc_create_op(notification_op_type_e type, op_list = (notification_op *)malloc(sizeof(notification_op) * num_op); if (op_list == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc memory"); + ERR("Failed to alloc memory"); return NULL; /* LCOV_EXCL_STOP */ } @@ -356,7 +356,7 @@ static inline char *_dup_string(const char *string) ret = strdup(string); if (!ret) - NOTIFICATION_ERR("Failed to strdup[%s]", + ERR("Failed to strdup[%s]", strerror_r(errno, err_buf, sizeof(err_buf))); return ret; @@ -379,10 +379,10 @@ static void _add_noti_notify(GVariant *parameters) GVariant *body = NULL; uid_t uid; - NOTIFICATION_DBG("add noti notify"); + DBG("add noti notify"); noti = notification_create(NOTIFICATION_TYPE_NOTI); if (!noti) { - NOTIFICATION_ERR("Failed to create notification handle"); + ERR("Failed to create notification handle"); return; } @@ -390,7 +390,7 @@ static void _add_noti_notify(GVariant *parameters) notification_ipc_make_noti_from_gvariant(noti, body); _print_noti(noti); if (noti->flags_for_property & NOTIFICATION_PROP_DISABLE_UPDATE_ON_INSERT) { - NOTIFICATION_ERR("Disable changed callback[%d]", noti->flags_for_property); + ERR("Disable changed callback[%d]", noti->flags_for_property); /* Disable changed cb */ } else { /* Enable changed cb */ @@ -417,7 +417,7 @@ static void _update_noti_notify(GVariant *parameters) noti = notification_create(NOTIFICATION_TYPE_NOTI); if (!noti) { - NOTIFICATION_ERR("Failed to create notification handle"); + ERR("Failed to create notification handle"); return; } @@ -482,15 +482,15 @@ static void _delete_multiple_notify(GVariant *parameters) g_variant_get(parameters, "(a(i)i)", &iter, &uid); while (g_variant_iter_loop(iter, "(i)", &buf[idx])) { - NOTIFICATION_DBG("priv id[%d]", buf[idx]); + DBG("priv id[%d]", buf[idx]); idx++; } g_variant_iter_free(iter); - NOTIFICATION_DBG("Deleted count[%d]", idx); + DBG("Deleted count[%d]", idx); noti_op = _ipc_create_op(NOTIFICATION_OP_DELETE, idx, buf, idx, NULL); if (noti_op == NULL) { - NOTIFICATION_ERR("Failed to create op"); + ERR("Failed to create op"); return; } @@ -506,7 +506,7 @@ static void _change_dnd_notify(GVariant *parameters) uid_t uid; g_variant_get(parameters, "(ii)", &do_not_disturb, &uid); - NOTIFICATION_DBG("do_not_disturb[%d], uid[%d]", do_not_disturb, uid); + DBG("do_not_disturb[%d], uid[%d]", do_not_disturb, uid); notification_call_dnd_changed_cb_for_uid(do_not_disturb, uid); } @@ -521,7 +521,7 @@ static void _handle_noti_notify(GDBusConnection *connection, GVariant *parameters, gpointer user_data) { - NOTIFICATION_DBG("own_name : %s signal_name: %s", + DBG("own_name : %s signal_name: %s", g_dbus_connection_get_unique_name(connection), signal_name); @@ -551,7 +551,7 @@ static void _send_event(GVariant *parameters) noti = notification_create(NOTIFICATION_TYPE_NOTI); if (noti == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to create notification handle"); + ERR("Failed to create notification handle"); return; /* LCOV_EXCL_STOP */ } @@ -563,7 +563,7 @@ static void _send_event(GVariant *parameters) g_variant_unref(coupled_body); g_variant_unref(body); if (ret != NOTIFICATION_ERROR_NONE) { - NOTIFICATION_ERR("Failed to make notification handle from gvariant"); + ERR("Failed to make notification handle from gvariant"); notification_free(noti); return; } @@ -590,7 +590,7 @@ static void _handle_noti_event_handler_notify(GDBusConnection *connection, GVariant *parameters, gpointer user_data) { - NOTIFICATION_DBG("own_name : %s signal_name: %s", + DBG("own_name : %s signal_name: %s", g_dbus_connection_get_unique_name(connection), signal_name); if (g_strcmp0(signal_name, "send_event") == 0) @@ -616,11 +616,11 @@ static int _dbus_event_handler_signal_init(void) NULL, NULL); - NOTIFICATION_DBG("subscribe id[%d]", id); + DBG("subscribe id[%d]", id); if (id == 0) { /* LCOV_EXCL_START */ ret = NOTIFICATION_ERROR_IO_ERROR; - NOTIFICATION_ERR("Failed to subscribe connection signal"); + ERR("Failed to subscribe connection signal"); /* LCOV_EXCL_STOP */ } else { event_monitor_id = id; @@ -647,11 +647,11 @@ static int _dbus_signal_init() NULL, NULL); - NOTIFICATION_DBG("subscribe id : %d", id); + DBG("subscribe id : %d", id); if (id == 0) { /* LCOV_EXCL_START */ ret = NOTIFICATION_ERROR_IO_ERROR; - NOTIFICATION_ERR("Failed to register dbus_interface"); + ERR("Failed to register dbus_interface"); /* LCOV_EXCL_STOP */ } else { monitor_id = id; @@ -675,7 +675,7 @@ static int _send_sync_noti(GVariant *body, GDBusMessage **reply, char *cmd) cmd); if (!msg) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc new method call"); + ERR("Failed to alloc new method call"); if (body) g_variant_unref(body); return NOTIFICATION_ERROR_OUT_OF_MEMORY; @@ -700,7 +700,7 @@ static int _send_sync_noti(GVariant *body, GDBusMessage **reply, char *cmd) /* LCOV_EXCL_START */ ret = NOTIFICATION_ERROR_SERVICE_NOT_READY; if (err != NULL) { - NOTIFICATION_ERR("No reply. cmd[%s] err[%s]", cmd, err->message); + ERR("No reply. cmd[%s] err[%s]", cmd, err->message); if (err->code == G_DBUS_ERROR_ACCESS_DENIED) ret = NOTIFICATION_ERROR_PERMISSION_DENIED; g_error_free(err); @@ -715,12 +715,12 @@ static int _send_sync_noti(GVariant *body, GDBusMessage **reply, char *cmd) else ret = err->code; - NOTIFICATION_ERR("Failed to send message[%s] err[%d]", cmd, ret); + ERR("Failed to send message[%s] err[%d]", cmd, ret); g_error_free(err); return ret; } - NOTIFICATION_DBG("Success to send sync message"); + DBG("Success to send sync message"); return NOTIFICATION_ERROR_NONE; } @@ -737,7 +737,7 @@ static void _send_message_with_reply_async_cb(GDBusConnection *connection, if (cb_item == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to get a callback item"); + ERR("Failed to get a callback item"); return; /* LCOV_EXCL_START */ } @@ -750,7 +750,7 @@ static void _send_message_with_reply_async_cb(GDBusConnection *connection, if (!reply) { /* LCOV_EXCL_START */ if (err != NULL) { - NOTIFICATION_ERR("No reply[%s]", err->message); + ERR("No reply[%s]", err->message); g_error_free(err); } result = NOTIFICATION_ERROR_SERVICE_NOT_READY; @@ -763,12 +763,12 @@ static void _send_message_with_reply_async_cb(GDBusConnection *connection, else result = err->code; - NOTIFICATION_ERR("Failed to send message[%s]", err->message); + ERR("Failed to send message[%s]", err->message); g_error_free(err); /* LCOV_EXCL_STOP */ } - NOTIFICATION_INFO("Async message callback result[%d]", result); + INFO("Async message callback result[%d]", result); if (result == NOTIFICATION_ERROR_NONE) { body = g_dbus_message_get_body(reply); g_variant_get(body, "(i)", &priv_id); @@ -796,7 +796,7 @@ static int _send_async_noti(GVariant *body, result_cb_item *cb_item, char *cmd) cmd); if (!msg) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc new method call"); + ERR("Failed to alloc new method call"); return NOTIFICATION_ERROR_OUT_OF_MEMORY; /* LCOV_EXCL_STOP */ } @@ -820,7 +820,7 @@ static int _send_async_noti(GVariant *body, result_cb_item *cb_item, char *cmd) if (msg) g_object_unref(msg); - NOTIFICATION_DBG("Success to send async message"); + DBG("Success to send async message"); return NOTIFICATION_ERROR_NONE; } @@ -836,7 +836,7 @@ int notification_ipc_request_insert(notification_h noti, int *priv_id) result = _dbus_init(); if (result != NOTIFICATION_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to init dbus connection[%d]", result); + ERR("Failed to init dbus connection[%d]", result); return result; /* LCOV_EXCL_STOP */ } @@ -859,13 +859,13 @@ int notification_ipc_request_insert(notification_h noti, int *priv_id) body = notification_ipc_make_gvariant_from_noti(noti, false); if (body == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to make gvariant from notification handle"); + ERR("Failed to make gvariant from notification handle"); return NOTIFICATION_ERROR_OUT_OF_MEMORY; /* LCOV_EXCL_STOP */ } result = _send_sync_noti(body, &reply, "add_noti"); - NOTIFICATION_DBG("_send_sync_noti %d", result); + DBG("_send_sync_noti %d", result); if (result == NOTIFICATION_ERROR_NONE) { reply_body = g_dbus_message_get_body(reply); @@ -878,7 +878,7 @@ int notification_ipc_request_insert(notification_h noti, int *priv_id) if (reply) g_object_unref(reply); - NOTIFICATION_DBG("priv_id[%d] result[%d]", id, result); + DBG("priv_id[%d] result[%d]", id, result); return result; } @@ -894,7 +894,7 @@ int notification_ipc_request_update(notification_h noti) result = _dbus_init(); if (result != NOTIFICATION_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to init dbus connection[%d]", result); + ERR("Failed to init dbus connection[%d]", result); return result; /* LCOV_EXCL_STOP */ } @@ -902,7 +902,7 @@ int notification_ipc_request_update(notification_h noti) body = notification_ipc_make_gvariant_from_noti(noti, false); if (body == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("cannot make gvariant"); + ERR("cannot make gvariant"); return NOTIFICATION_ERROR_OUT_OF_MEMORY; /* LCOV_EXCL_STOP */ } @@ -916,7 +916,7 @@ int notification_ipc_request_update(notification_h noti) if (reply) g_object_unref(reply); - NOTIFICATION_DBG("priv_id[%d] result[%d]", priv_id, result); + DBG("priv_id[%d] result[%d]", priv_id, result); return result; } @@ -930,7 +930,7 @@ int notification_ipc_request_update_async(notification_h noti, result = _dbus_init(); if (result != NOTIFICATION_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to init dbus connection[%d]", result); + ERR("Failed to init dbus connection[%d]", result); return result; /* LCOV_EXCL_STOP */ } @@ -945,14 +945,14 @@ int notification_ipc_request_update_async(notification_h noti, body = notification_ipc_make_gvariant_from_noti(noti, false); if (body == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to make gvariant from notification handle"); + ERR("Failed to make gvariant from notification handle"); free(cb_item); return NOTIFICATION_ERROR_OUT_OF_MEMORY; /* LCOV_EXCL_STOP */ } result = _send_async_noti(body, cb_item, "update_noti"); - NOTIFICATION_DBG("Update async result[%d]", result); + DBG("Update async result[%d]", result); if (result != NOTIFICATION_ERROR_NONE) { /* LCOV_EXCL_START */ @@ -975,7 +975,7 @@ int notification_ipc_request_refresh(uid_t uid) result = _dbus_init(); if (result != NOTIFICATION_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to init dbus connection[%d]", result); + ERR("Failed to init dbus connection[%d]", result); return result; /* LCOV_EXCL_STOP */ } @@ -986,7 +986,7 @@ int notification_ipc_request_refresh(uid_t uid) if (reply) g_object_unref(reply); - NOTIFICATION_DBG("result[%d]", result); + DBG("result[%d]", result); return result; } @@ -1001,7 +1001,7 @@ int notification_ipc_request_delete_single(notification_type_e type, char *app_i result = _dbus_init(); if (result != NOTIFICATION_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to init dbus connection[%d]", result); + ERR("Failed to init dbus connection[%d]", result); return result; /* LCOV_EXCL_STOP */ } @@ -1017,7 +1017,7 @@ int notification_ipc_request_delete_single(notification_type_e type, char *app_i if (reply) g_object_unref(reply); - NOTIFICATION_DBG("result[%d]", result); + DBG("result[%d]", result); return result; } @@ -1032,7 +1032,7 @@ int notification_ipc_request_delete_multiple(notification_type_e type, char *app result = _dbus_init(); if (result != NOTIFICATION_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to init dbus connection[%d]", result); + ERR("Failed to init dbus connection[%d]", result); return result; /* LCOV_EXCL_STOP */ } @@ -1046,13 +1046,13 @@ int notification_ipc_request_delete_multiple(notification_type_e type, char *app if (result == NOTIFICATION_ERROR_NONE) { reply_body = g_dbus_message_get_body(reply); g_variant_get(reply_body, "(i)", &num_deleted); - NOTIFICATION_DBG("Deleted count[%d]", num_deleted); + DBG("Deleted count[%d]", num_deleted); } if (reply) g_object_unref(reply); - NOTIFICATION_DBG("result[%d]", result); + DBG("result[%d]", result); return result; } @@ -1067,7 +1067,7 @@ int notification_ipc_request_load_noti_by_tag(notification_h noti, const char *a result = _dbus_init(); if (result != NOTIFICATION_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to init dbus connection[%d]", result); + ERR("Failed to init dbus connection[%d]", result); return result; /* LCOV_EXCL_STOP */ } @@ -1088,7 +1088,7 @@ int notification_ipc_request_load_noti_by_tag(notification_h noti, const char *a if (reply) g_object_unref(reply); - NOTIFICATION_DBG("tag[%s] result[%d]", tag, result); + DBG("tag[%s] result[%d]", tag, result); return result; } @@ -1103,7 +1103,7 @@ int notification_ipc_request_load_noti_by_priv_id(notification_h noti, const cha result = _dbus_init(); if (result != NOTIFICATION_ERROR_NONE) { - NOTIFICATION_ERR("Failed to init dbus connection[%d]", result); + ERR("Failed to init dbus connection[%d]", result); return result; } @@ -1125,7 +1125,7 @@ int notification_ipc_request_load_noti_by_priv_id(notification_h noti, const cha if (reply) g_object_unref(reply); - NOTIFICATION_DBG("priv id[%d], result[%d]", priv_id, result); + DBG("priv id[%d], result[%d]", priv_id, result); return result; } /* LCOV_EXCL_STOP */ @@ -1142,7 +1142,7 @@ int notification_ipc_request_get_count(notification_type_e type, result = _dbus_init(); if (result != NOTIFICATION_ERROR_NONE) { - NOTIFICATION_ERR("Failed to init dbus connection[%d]", result); + ERR("Failed to init dbus connection[%d]", result); return result; } @@ -1154,13 +1154,13 @@ int notification_ipc_request_get_count(notification_type_e type, g_variant_get(reply_body, "(i)", &re_count); *count = re_count; - NOTIFICATION_DBG("notification count[%d]", re_count); + DBG("notification count[%d]", re_count); } if (reply) g_object_unref(reply); - NOTIFICATION_DBG("Count notification result[%d]", result); + DBG("Count notification result[%d]", result); return result; } /* LCOV_EXCL_STOP */ @@ -1180,7 +1180,7 @@ int notification_ipc_request_load_noti_grouping_list(notification_type_e type, i result = _dbus_init(); if (result != NOTIFICATION_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to init dbus connection[%d]", result); + ERR("Failed to init dbus connection[%d]", result); return result; /* LCOV_EXCL_STOP */ } @@ -1197,7 +1197,7 @@ int notification_ipc_request_load_noti_grouping_list(notification_type_e type, i if (!noti) { /* LCOV_EXCL_START */ result = NOTIFICATION_ERROR_OUT_OF_MEMORY; - NOTIFICATION_ERR("failed to create a notification"); + ERR("failed to create a notification"); notification_free_list(*list); break; /* LCOV_EXCL_STOP */ @@ -1213,7 +1213,7 @@ int notification_ipc_request_load_noti_grouping_list(notification_type_e type, i if (reply) g_object_unref(reply); - NOTIFICATION_DBG("result[%d]", result); + DBG("result[%d]", result); return result; } @@ -1235,7 +1235,7 @@ int notification_ipc_request_load_noti_detail_list(const char *app_id, result = _dbus_init(); if (result != NOTIFICATION_ERROR_NONE) { - NOTIFICATION_ERR("Failed to init dbus connection[%d]", result); + ERR("Failed to init dbus connection[%d]", result); return result; } @@ -1250,7 +1250,7 @@ int notification_ipc_request_load_noti_detail_list(const char *app_id, noti = notification_create(NOTIFICATION_TYPE_NOTI); if (!noti) { result = NOTIFICATION_ERROR_OUT_OF_MEMORY; - NOTIFICATION_ERR("failed to create a notification"); + ERR("failed to create a notification"); notification_free_list(*list); break; } @@ -1265,7 +1265,7 @@ int notification_ipc_request_load_noti_detail_list(const char *app_id, if (reply) g_object_unref(reply); - NOTIFICATION_DBG("result[%d]", result); + DBG("result[%d]", result); return result; } @@ -1287,7 +1287,7 @@ int notification_ipc_request_get_setting_array( result = _dbus_init(); if (result != NOTIFICATION_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to init dbus connection[%d]", result); + ERR("Failed to init dbus connection[%d]", result); return result; /* LCOV_EXCL_STOP */ } @@ -1298,11 +1298,11 @@ int notification_ipc_request_get_setting_array( reply_body = g_dbus_message_get_body(reply); g_variant_get(reply_body, "(ia(v))", &setting_cnt, &iter); - NOTIFICATION_DBG("get setting arr cnt: %d", setting_cnt); + DBG("get setting arr cnt: %d", setting_cnt); result_setting_array = (struct notification_setting *)malloc(sizeof(struct notification_setting) * setting_cnt); if (result_setting_array == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("malloc failed"); + ERR("malloc failed"); g_object_unref(reply); g_variant_iter_free(iter); return NOTIFICATION_ERROR_OUT_OF_MEMORY; @@ -1324,7 +1324,7 @@ int notification_ipc_request_get_setting_array( if (reply) g_object_unref(reply); - NOTIFICATION_DBG("result[%d]", result); + DBG("result[%d]", result); return result; } @@ -1340,7 +1340,7 @@ int notification_ipc_request_get_setting_by_app_id( result = _dbus_init(); if (result != NOTIFICATION_ERROR_NONE) { - NOTIFICATION_ERR("Failed to init dbus connection[%d]", result); + ERR("Failed to init dbus connection[%d]", result); return result; } @@ -1354,7 +1354,7 @@ int notification_ipc_request_get_setting_by_app_id( result_setting = (struct notification_setting *)malloc(sizeof(struct notification_setting)); if (result_setting == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("malloc failed"); + ERR("malloc failed"); g_object_unref(reply); g_variant_unref(body); return NOTIFICATION_ERROR_OUT_OF_MEMORY; @@ -1369,7 +1369,7 @@ int notification_ipc_request_get_setting_by_app_id( if (reply) g_object_unref(reply); - NOTIFICATION_DBG("result[%d]", result); + DBG("result[%d]", result); return result; } @@ -1388,7 +1388,7 @@ int notification_ipc_request_load_system_setting(notification_system_setting_h * result = _dbus_init(); if (result != NOTIFICATION_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to init dbus connection[%d]", result); + ERR("Failed to init dbus connection[%d]", result); return result; /* LCOV_EXCL_STOP */ } @@ -1401,7 +1401,7 @@ int notification_ipc_request_load_system_setting(notification_system_setting_h * result_setting = (struct notification_system_setting *)calloc(1, sizeof(struct notification_system_setting)); if (result_setting == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("malloc failed"); + ERR("malloc failed"); result = NOTIFICATION_ERROR_OUT_OF_MEMORY; goto out; /* LCOV_EXCL_STOP */ @@ -1440,7 +1440,7 @@ out: if (reply) g_object_unref(reply); - NOTIFICATION_DBG("result[%d]", result); + DBG("result[%d]", result); return result; } @@ -1453,7 +1453,7 @@ int notification_ipc_update_setting(notification_setting_h setting, uid_t uid) result = _dbus_init(); if (result != NOTIFICATION_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to init dbus connection[%d]", result); + ERR("Failed to init dbus connection[%d]", result); return result; /* LCOV_EXCL_STOP */ } @@ -1473,7 +1473,7 @@ int notification_ipc_update_setting(notification_setting_h setting, uid_t uid) if (reply) g_object_unref(reply); - NOTIFICATION_DBG("result[%d]", result); + DBG("result[%d]", result); return result; } @@ -1488,7 +1488,7 @@ int notification_ipc_update_system_setting(notification_system_setting_h system_ result = _dbus_init(); if (result != NOTIFICATION_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to init dbus connection[%d]", result); + ERR("Failed to init dbus connection[%d]", result); return result; /* LCOV_EXCL_STOP */ } @@ -1523,7 +1523,7 @@ int notification_ipc_update_system_setting(notification_system_setting_h system_ if (reply) g_object_unref(reply); - NOTIFICATION_DBG("result[%d]", result); + DBG("result[%d]", result); return result; } @@ -1536,14 +1536,14 @@ int notification_ipc_request_save_as_template(notification_h noti, const char *t result = _dbus_init(); if (result != NOTIFICATION_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to init dbus connection[%d]", result); + ERR("Failed to init dbus connection[%d]", result); return result; /* LCOV_EXCL_STOP */ } body = notification_ipc_make_gvariant_from_noti(noti, false); if (body == NULL) { - NOTIFICATION_ERR("Failed to make gvariant from notification handle"); + ERR("Failed to make gvariant from notification handle"); return NOTIFICATION_ERROR_OUT_OF_MEMORY; } @@ -1552,7 +1552,7 @@ int notification_ipc_request_save_as_template(notification_h noti, const char *t if (reply) g_object_unref(reply); - NOTIFICATION_DBG("result[%d]", result); + DBG("result[%d]", result); return result; } @@ -1567,7 +1567,7 @@ int notification_ipc_request_create_from_template(notification_h noti, const cha result = _dbus_init(); if (result != NOTIFICATION_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to init dbus connection[%d]", result); + ERR("Failed to init dbus connection[%d]", result); return result; /* LCOV_EXCL_STOP */ } @@ -1587,7 +1587,7 @@ int notification_ipc_request_create_from_template(notification_h noti, const cha if (reply) g_object_unref(reply); - NOTIFICATION_DBG("result[%d]", result); + DBG("result[%d]", result); return result; } @@ -1603,7 +1603,7 @@ int notification_ipc_request_create_from_package_template(notification_h noti, c result = _dbus_init(); if (result != NOTIFICATION_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to init dbus connection[%d]", result); + ERR("Failed to init dbus connection[%d]", result); return result; /* LCOV_EXCL_STOP */ } @@ -1623,7 +1623,7 @@ int notification_ipc_request_create_from_package_template(notification_h noti, c if (reply) g_object_unref(reply); - NOTIFICATION_DBG("result[%d]", result); + DBG("result[%d]", result); return result; } @@ -1647,7 +1647,7 @@ int notification_ipc_get_noti_block_state(const char *app_id, int *do_not_distur ret = _dbus_init(); if (ret != NOTIFICATION_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to init dbus connection[%d]", ret); + ERR("Failed to init dbus connection[%d]", ret); return ret; /* LCOV_EXCL_STOP */ } @@ -1669,7 +1669,7 @@ int notification_ipc_get_noti_block_state(const char *app_id, int *do_not_distur if (reply) g_object_unref(reply); - NOTIFICATION_DBG("result[%d]", ret); + DBG("result[%d]", ret); return ret; } @@ -1683,7 +1683,7 @@ int notification_ipc_request_get_all_count(notification_type_e type, int *count, ret = _dbus_init(); if (ret != NOTIFICATION_ERROR_NONE) { - NOTIFICATION_ERR("Failed to init dbus connection[%d]", ret); + ERR("Failed to init dbus connection[%d]", ret); return ret; } @@ -1710,7 +1710,7 @@ int notification_ipc_send_event(notification_h noti, int event_type, int priv_id ret = _dbus_init(); if (ret != NOTIFICATION_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to init dbus connection[%d]", ret); + ERR("Failed to init dbus connection[%d]", ret); return ret; /* LCOV_EXCL_STOP */ } @@ -1720,7 +1720,7 @@ int notification_ipc_send_event(notification_h noti, int event_type, int priv_id } else { body = notification_ipc_make_gvariant_from_noti(noti, false); if (body == NULL) { - NOTIFICATION_ERR("Can't make gvariant to noti"); + ERR("Can't make gvariant to noti"); return NOTIFICATION_ERROR_OUT_OF_MEMORY; } @@ -1730,7 +1730,7 @@ int notification_ipc_send_event(notification_h noti, int event_type, int priv_id if (reply) g_object_unref(reply); - NOTIFICATION_DBG("result[%d]", ret); + DBG("result[%d]", ret); return ret; } @@ -1745,7 +1745,7 @@ int notification_ipc_check_event_receiver(int priv_id, bool *available) ret = _dbus_init(); if (ret != NOTIFICATION_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to init dbus connection[%d]", ret); + ERR("Failed to init dbus connection[%d]", ret); return ret; /* LCOV_EXCL_STOP */ } @@ -1760,7 +1760,7 @@ int notification_ipc_check_event_receiver(int priv_id, bool *available) if (reply) g_object_unref(reply); - NOTIFICATION_DBG("result[%d]", ret); + DBG("result[%d]", ret); return ret; } @@ -1772,7 +1772,7 @@ void notification_ipc_reset_event_handler(int priv_id) ret = _dbus_init(); if (ret != NOTIFICATION_ERROR_NONE) { - NOTIFICATION_ERR("Failed to init dbus connection[%d]", ret); + ERR("Failed to init dbus connection[%d]", ret); return; } @@ -1785,7 +1785,7 @@ void notification_ipc_reset_event_handler(int priv_id) EXPORT_API GVariant *notification_ipc_make_gvariant_from_noti(notification_h noti, bool translate) { - NOTIFICATION_DBG("make gvariant from noti"); + DBG("make gvariant from noti"); int i = 0; int b_encode_len = 0; bundle_raw *args = NULL; @@ -2061,7 +2061,7 @@ static gboolean _variant_dict_lookup(GHashTable *dict, EXPORT_API int notification_ipc_make_noti_from_gvariant(notification_h noti, GVariant *variant) { - NOTIFICATION_DBG("make noti from GVariant"); + DBG("make noti from GVariant"); GHashTable *dict; int i; @@ -2093,12 +2093,12 @@ EXPORT_API int notification_ipc_make_noti_from_gvariant(notification_h noti, char *tag = NULL; if (noti == NULL) { - NOTIFICATION_ERR("Invalid noti NULL"); + ERR("Invalid noti NULL"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } if (variant == NULL) { - NOTIFICATION_ERR("Invalid variant NULL"); + ERR("Invalid variant NULL"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -2253,7 +2253,7 @@ EXPORT_API int notification_ipc_make_system_setting_from_gvariant(struct notific int lock_screen_content_level; if (noti_setting == NULL) { - NOTIFICATION_ERR("Invalid setting handle"); + ERR("Invalid setting handle"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -2269,7 +2269,7 @@ EXPORT_API int notification_ipc_make_system_setting_from_gvariant(struct notific &dnd_end_min, &lock_screen_content_level); - NOTIFICATION_DBG("system setting %d, %d, %d, %d, [%d:%d] [%d:%d], %d", + DBG("system setting %d, %d, %d, %d, [%d:%d] [%d:%d], %d", do_not_disturb, visibility_class, dnd_schedule_enabled, dnd_schedule_day, dnd_start_hour, dnd_start_min, dnd_end_hour, dnd_end_min, lock_screen_content_level); @@ -2317,7 +2317,7 @@ EXPORT_API int notification_ipc_make_setting_from_gvariant(struct notification_s int app_disabled; if (noti_setting == NULL || variant == NULL) { - NOTIFICATION_ERR("invalid data"); + ERR("invalid data"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } g_variant_get(variant, @@ -2331,7 +2331,7 @@ EXPORT_API int notification_ipc_make_setting_from_gvariant(struct notification_s &lock_screen_content_level, &app_disabled); - NOTIFICATION_DBG("setting from variant %s !!", pkgname); + DBG("setting from variant %s !!", pkgname); noti_setting->package_name = _dup_string(pkgname); noti_setting->app_id = _dup_string(app_id); @@ -2342,7 +2342,7 @@ EXPORT_API int notification_ipc_make_setting_from_gvariant(struct notification_s noti_setting->lock_screen_content_level = lock_screen_content_level; noti_setting->app_disabled = app_disabled; - NOTIFICATION_DBG("setting->pkgname[%s] pkgname[%s]", + DBG("setting->pkgname[%s] pkgname[%s]", noti_setting->package_name, pkgname); return NOTIFICATION_ERROR_NONE; @@ -2365,7 +2365,7 @@ int notification_ipc_make_dnd_allow_exception_from_gvariant(struct notification_ int value; if (dnd_allow_exception == NULL) { - NOTIFICATION_ERR("Invalid data"); + ERR("Invalid data"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -2393,10 +2393,10 @@ static int _send_service_register(uid_t uid) notification_call_changed_cb_for_uid(noti_op, 1, uid); free(noti_op); } else { - NOTIFICATION_ERR("Failed to create op"); + ERR("Failed to create op"); } - NOTIFICATION_DBG("bus name[%s] result[%d]", _bus_name, result); + DBG("bus name[%s] result[%d]", _bus_name, result); return result; } @@ -2413,7 +2413,7 @@ static void _on_name_appeared(GDBusConnection *connection, { int uid = GPOINTER_TO_INT(user_data); - NOTIFICATION_DBG("uid[%d] name[%s]", uid, name); + DBG("uid[%d] name[%s]", uid, name); is_master_started = 1; _ipc_monitor_register(uid); @@ -2429,7 +2429,7 @@ static void _on_name_vanished(GDBusConnection *connection, { int uid = GPOINTER_TO_INT(user_data); - NOTIFICATION_DBG("uid[%d] name[%s]", uid, name); + DBG("uid[%d] name[%s]", uid, name); is_master_started = 0; } /* LCOV_EXCL_STOP */ @@ -2441,7 +2441,7 @@ int notification_ipc_monitor_init(uid_t uid) ret = _dbus_init(); if (ret != NOTIFICATION_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to init dbus connection[%d]", ret); + ERR("Failed to init dbus connection[%d]", ret); return ret; /* LCOV_EXCL_STOP */ } @@ -2449,7 +2449,7 @@ int notification_ipc_monitor_init(uid_t uid) ret = _dbus_signal_init(); if (ret != NOTIFICATION_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to init signal[%d]", ret); + ERR("Failed to init signal[%d]", ret); return ret; /* LCOV_EXCL_STOP */ } @@ -2457,7 +2457,7 @@ int notification_ipc_monitor_init(uid_t uid) ret = _ipc_monitor_register(uid); if (ret != NOTIFICATION_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to register service[%d]", ret); + ERR("Failed to register service[%d]", ret); return ret; /* LCOV_EXCL_STOP */ } @@ -2476,7 +2476,7 @@ int notification_ipc_monitor_init(uid_t uid) /* LCOV_EXCL_START */ g_dbus_connection_signal_unsubscribe(_gdbus_conn, monitor_id); monitor_id = 0; - NOTIFICATION_ERR("Failed to watch name"); + ERR("Failed to watch name"); return NOTIFICATION_ERROR_IO_ERROR; /* LCOV_EXCL_STOP */ } diff --git a/src/notification_list.c b/src/notification_list.c index 30724cd..61d5555 100755 --- a/src/notification_list.c +++ b/src/notification_list.c @@ -39,7 +39,7 @@ notification_list_h _notification_list_create(void) list = (notification_list_h)malloc(sizeof(struct _notification_list)); if (list == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc memory"); + ERR("Failed to alloc memory"); return NULL; /* LCOV_EXCL_STOP */ } @@ -57,7 +57,7 @@ EXPORT_API notification_list_h notification_list_get_head(notification_list_h li notification_list_h cur_list = NULL; if (list == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); set_last_result(NOTIFICATION_ERROR_INVALID_PARAMETER); return NULL; } @@ -76,7 +76,7 @@ EXPORT_API notification_list_h notification_list_get_tail(notification_list_h li notification_list_h cur_list = NULL; if (list == NULL) { - NOTIFICATION_ERR("INVALID DATA : list == NULL"); + ERR("INVALID DATA : list == NULL"); set_last_result(NOTIFICATION_ERROR_INVALID_PARAMETER); return NULL; } @@ -95,7 +95,7 @@ EXPORT_API notification_list_h notification_list_get_prev(notification_list_h li notification_list_h cur_list = NULL; if (list == NULL) { - NOTIFICATION_ERR("INVALID DATA : list == NULL"); + ERR("INVALID DATA : list == NULL"); set_last_result(NOTIFICATION_ERROR_INVALID_PARAMETER); return NULL; } @@ -111,7 +111,7 @@ EXPORT_API notification_list_h notification_list_get_next(notification_list_h li notification_list_h cur_list = NULL; if (list == NULL) { - NOTIFICATION_ERR("INVALID DATA : list == NULL"); + ERR("INVALID DATA : list == NULL"); set_last_result(NOTIFICATION_ERROR_INVALID_PARAMETER); return NULL; } @@ -127,7 +127,7 @@ EXPORT_API notification_h notification_list_get_data(notification_list_h list) notification_list_h cur_list = NULL; if (list == NULL) { - NOTIFICATION_ERR("INVALID DATA : list == NULL"); + ERR("INVALID DATA : list == NULL"); set_last_result(NOTIFICATION_ERROR_INVALID_PARAMETER); return NULL; } @@ -144,7 +144,7 @@ EXPORT_API int notification_list_get_count(notification_list_h list) notification_list_h cur_list = NULL; if (list == NULL) { - NOTIFICATION_ERR("Invalid paramter"); + ERR("Invalid paramter"); set_last_result(NOTIFICATION_ERROR_INVALID_PARAMETER); return 0; } @@ -167,7 +167,7 @@ EXPORT_API notification_list_h notification_list_append(notification_list_h list notification_list_h cur_list = NULL; if (noti == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); set_last_result(NOTIFICATION_ERROR_INVALID_PARAMETER); return NULL; } @@ -178,7 +178,7 @@ EXPORT_API notification_list_h notification_list_append(notification_list_h list new_list = _notification_list_create(); if (new_list == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc memory"); + ERR("Failed to alloc memory"); set_last_result(NOTIFICATION_ERROR_OUT_OF_MEMORY); return NULL; /* LCOV_EXCL_STOP */ @@ -192,7 +192,7 @@ EXPORT_API notification_list_h notification_list_append(notification_list_h list cur_list = _notification_list_create(); if (cur_list == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc memory"); + ERR("Failed to alloc memory"); set_last_result(NOTIFICATION_ERROR_OUT_OF_MEMORY); return NULL; /* LCOV_EXCL_STOP */ diff --git a/src/notification_noti.c b/src/notification_noti.c index 51768e2..4a54b93 100755 --- a/src/notification_noti.c +++ b/src/notification_noti.c @@ -144,7 +144,7 @@ static int _notification_noti_check_priv_id(notification_h noti, sqlite3 *db) noti->caller_app_id, noti->priv_id); if (query == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc query"); + ERR("Failed to alloc query"); ret = NOTIFICATION_ERROR_OUT_OF_MEMORY; goto err; /* LCOV_EXCL_STOP */ @@ -153,7 +153,7 @@ static int _notification_noti_check_priv_id(notification_h noti, sqlite3 *db) ret = sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL); if (ret != SQLITE_OK) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to sqlite3_prepare_v2 Failed [%d][%s]", + ERR("Failed to sqlite3_prepare_v2 Failed [%d][%s]", ret, sqlite3_errmsg(db)); ret = NOTIFICATION_ERROR_FROM_DB; goto err; @@ -194,7 +194,7 @@ static int _notification_noti_get_internal_group_id_by_priv_id(const char *app_i app_id, priv_id); if (query == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc query"); /* LCOV_EXCL_LINE */ + ERR("Failed to alloc query"); /* LCOV_EXCL_LINE */ ret = NOTIFICATION_ERROR_OUT_OF_MEMORY; goto err; /* LCOV_EXCL_STOP */ @@ -203,7 +203,7 @@ static int _notification_noti_get_internal_group_id_by_priv_id(const char *app_i ret = sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL); if (ret != SQLITE_OK) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("sqlite3_prepare_v2 Failed [%d][%s]", ret, + ERR("sqlite3_prepare_v2 Failed [%d][%s]", ret, sqlite3_errmsg(db)); ret = NOTIFICATION_ERROR_FROM_DB; goto err; @@ -224,7 +224,7 @@ err: sqlite3_free(query); if (ret != NOTIFICATION_ERROR_NONE) - NOTIFICATION_ERR("Failed to get internal group ID [%d]", ret); + ERR("Failed to get internal group ID [%d]", ret); return result; } @@ -588,7 +588,7 @@ static int _get_notification(char *query_where, notification_h noti) ret = sqlite3_prepare_v2(db, query, -1, &stmt, NULL); if (ret != SQLITE_OK) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("sqlite3_prepare_v2 failed [%d][%s]", ret, + ERR("sqlite3_prepare_v2 failed [%d][%s]", ret, sqlite3_errmsg(db)); ret = NOTIFICATION_ERROR_FROM_DB; goto err; @@ -601,9 +601,9 @@ static int _get_notification(char *query_where, notification_h noti) ret = NOTIFICATION_ERROR_NONE; } else { if (ret == SQLITE_DONE) - NOTIFICATION_DBG("No valid record found"); + DBG("No valid record found"); else - NOTIFICATION_ERR("sqlite3_step failed [%d][%s]", ret, + ERR("sqlite3_step failed [%d][%s]", ret, sqlite3_errmsg(db)); ret = NOTIFICATION_ERROR_FROM_DB; } @@ -647,7 +647,7 @@ static int _get_notification_list(char *query_where, notification_list_h *list, ret = sqlite3_prepare_v2(db, query, -1, &stmt, NULL); if (ret != SQLITE_OK) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("sqlite3_prepare_v2 failed [%d][%s]", ret, + ERR("sqlite3_prepare_v2 failed [%d][%s]", ret, sqlite3_errmsg(db)); ret = NOTIFICATION_ERROR_FROM_DB; goto err; @@ -670,8 +670,7 @@ static int _get_notification_list(char *query_where, notification_list_h *list, get_list = notification_list_append(get_list, noti); if (count != -1 && internal_count >= count) { - NOTIFICATION_INFO - ("internal count[%d] count[%d]", + INFO("internal count[%d] count[%d]", internal_count, count); break; } @@ -760,31 +759,31 @@ static int __get_setting_from_app_control(notification_h noti, notification_sett NULL, &b); if (ret != NOTIFICATION_ERROR_NONE || b == NULL) { - NOTIFICATION_WARN("Failed to get or no the excute option [%x]", ret); + WARN("Failed to get or no the excute option [%x]", ret); return NOTIFICATION_ERROR_INVALID_PARAMETER; } ret = app_control_create(&app_control); if (ret != APP_CONTROL_ERROR_NONE) { - NOTIFICATION_ERR("Failed to create app_control [%x]", ret); + ERR("Failed to create app_control [%x]", ret); goto out; } ret = app_control_import_from_bundle(app_control, b); if (ret != APP_CONTROL_ERROR_NONE) { - NOTIFICATION_ERR("Failed to import from bundle to app_control [%x]", ret); + ERR("Failed to import from bundle to app_control [%x]", ret); goto out; } ret = app_control_get_app_id(app_control, &app_id); if (ret != APP_CONTROL_ERROR_NONE || app_id == NULL) { - NOTIFICATION_ERR("Failed to get app id from app_control [%x]", ret); + ERR("Failed to get app id from app_control [%x]", ret); goto out; } ret = noti_setting_service_get_setting_by_app_id(app_id, &setting_new, noti->uid); if (ret != APP_CONTROL_ERROR_NONE || setting == NULL) { - NOTIFICATION_ERR("Failed to get setting by app id[%s][%x]", + ERR("Failed to get setting by app id[%s][%x]", app_id, ret); goto out; } @@ -820,13 +819,13 @@ static bool _is_allowed_to_notify(notification_h noti) err = notification_setting_get_allow_to_notify(setting, &allow_to_notify); if (err != NOTIFICATION_ERROR_NONE) { - NOTIFICATION_ERR("Failed to get allow_to_notify [%x]", err); + ERR("Failed to get allow_to_notify [%x]", err); goto out; } err = notification_setting_get_app_disabled(setting, &app_disabled); if (err != NOTIFICATION_ERROR_NONE) { - NOTIFICATION_ERR("Failed to get app_disabled [%x]", err); + ERR("Failed to get app_disabled [%x]", err); goto out; } @@ -849,37 +848,37 @@ static int _handle_do_not_disturb_option(notification_h noti) notification_system_setting_h system_setting = NULL; if (noti == NULL) { - NOTIFICATION_ERR("Invalid notification handle"); + ERR("Invalid notification handle"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } /* Get system setting */ err = noti_system_setting_load_system_setting(&system_setting, noti->uid); if (err != NOTIFICATION_ERROR_NONE) { - NOTIFICATION_ERR("Failed to load system setting [%d]", err); + ERR("Failed to load system setting [%d]", err); goto out; } err = notification_system_setting_get_do_not_disturb(system_setting, &do_not_disturb); if (err != NOTIFICATION_ERROR_NONE) { - NOTIFICATION_ERR("Failed to get do_not_disturb [%d]", err); + ERR("Failed to get do_not_disturb [%d]", err); goto out; } - NOTIFICATION_DBG("do_not_disturb [%d]", do_not_disturb); + DBG("do_not_disturb [%d]", do_not_disturb); if (do_not_disturb) { /* Check exception option of the caller app_id */ err = noti_setting_service_get_setting_by_app_id(noti->caller_app_id, &setting, noti->uid); if (err != NOTIFICATION_ERROR_NONE) { - NOTIFICATION_ERR("Failed to get setting by app_id [%d]", err); + ERR("Failed to get setting by app_id [%d]", err); goto out; } err = notification_setting_get_do_not_disturb_except(setting, &do_not_disturb_exception); if (err != NOTIFICATION_ERROR_NONE) { - NOTIFICATION_ERR("Failed to get do_not_disturb_exception [%d]", err); + ERR("Failed to get do_not_disturb_exception [%d]", err); goto out; } @@ -921,18 +920,18 @@ static bool _is_pop_up_notification(const char *app_id, uid_t uid) err = noti_setting_service_get_setting_by_app_id(app_id, &setting, uid); if (err != NOTIFICATION_ERROR_NONE) { - NOTIFICATION_WARN("Failed get the setting for [%s] [%x]", app_id, err); + WARN("Failed get the setting for [%s] [%x]", app_id, err); goto out; } err = notification_setting_get_pop_up_notification(setting, &ret); if (err != NOTIFICATION_ERROR_NONE) { - NOTIFICATION_ERR("Failed to get pop_up_notification [%d]", err); + ERR("Failed to get pop_up_notification [%d]", err); goto out; } if (ret != true) - NOTIFICATION_DBG("[%s] is not allowed Pop-up notification", app_id); + DBG("[%s] is not allowed Pop-up notification", app_id); out: if (setting) @@ -951,7 +950,7 @@ static int _check_text_input(notification_h noti) if (err == NOTIFICATION_ERROR_NONE && text_input_max_length != 0) { err = notification_get_event_handler(noti, NOTIFICATION_EVENT_TYPE_CLICK_ON_TEXT_INPUT_BUTTON, &app_control); if (err != NOTIFICATION_ERROR_NONE || app_control == NULL) { - NOTIFICATION_ERR("Event handler for text_input is not set"); + ERR("Event handler for text_input is not set"); return -1; } } @@ -967,21 +966,21 @@ EXPORT_API int notification_noti_insert(notification_h noti) char *query = NULL; if (noti == NULL) { - NOTIFICATION_ERR("Invalid notification handle"); + ERR("Invalid notification handle"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } if (_is_allowed_to_notify(noti) == false) { - NOTIFICATION_ERR("[%s] is not allowed to notify", noti->caller_app_id); + ERR("[%s] is not allowed to notify", noti->caller_app_id); return NOTIFICATION_ERROR_PERMISSION_DENIED; } if (_handle_do_not_disturb_option(noti) != NOTIFICATION_ERROR_NONE) - NOTIFICATION_WARN("Failed to handle do_not_disturb"); + WARN("Failed to handle do_not_disturb"); if (_is_pop_up_notification((const char *)noti->caller_app_id, noti->uid) == false) { noti->display_applist = (noti->display_applist & (~NOTIFICATION_DISPLAY_APP_ACTIVE)); - NOTIFICATION_DBG("notification display applist - app_id [%s], applist [%d]", + DBG("notification display applist - app_id [%s], applist [%d]", noti->caller_app_id, noti->display_applist); } @@ -1000,7 +999,7 @@ EXPORT_API int notification_noti_insert(notification_h noti) NOTI_LIST_DB_ATTRIBUTES_INSERT, NOTI_LIST_INSERT_VALUES); if (query == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("sqlite3_mprintf Failed"); + ERR("sqlite3_mprintf Failed"); ret = NOTIFICATION_ERROR_OUT_OF_MEMORY; goto err; /* LCOV_EXCL_STOP */ @@ -1009,7 +1008,7 @@ EXPORT_API int notification_noti_insert(notification_h noti) ret = sqlite3_prepare_v2(db, query, -1, &stmt, NULL); if (ret != SQLITE_OK) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("sqlite3_prepare_v2 Failed [%d][%s]", ret, + ERR("sqlite3_prepare_v2 Failed [%d][%s]", ret, sqlite3_errmsg(db)); ret = NOTIFICATION_ERROR_FROM_DB; goto err; @@ -1048,7 +1047,7 @@ EXPORT_API int notification_noti_get_by_priv_id(notification_h noti, int priv_id char *query_where = NULL; if (priv_id < 0 || noti == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -1076,7 +1075,7 @@ EXPORT_API int notification_noti_get_by_tag(notification_h noti, char *app_id, c char *query_where; if (tag == NULL || noti == NULL) { - NOTIFICATION_ERR("Invalid paramter"); + ERR("Invalid paramter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -1106,21 +1105,21 @@ EXPORT_API int notification_noti_update(notification_h noti) char *query = NULL; if (noti == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } if (_is_allowed_to_notify(noti) == false) { - NOTIFICATION_DBG("[%s] is not allowed to notify", noti->caller_app_id); + DBG("[%s] is not allowed to notify", noti->caller_app_id); return NOTIFICATION_ERROR_PERMISSION_DENIED; } if (_handle_do_not_disturb_option(noti) != NOTIFICATION_ERROR_NONE) - NOTIFICATION_WARN("Failed to handle do_not_disturb"); + WARN("Failed to handle do_not_disturb"); if (_is_pop_up_notification((const char *)noti->caller_app_id, noti->uid) == false) { noti->display_applist = (noti->display_applist & (~NOTIFICATION_DISPLAY_APP_ACTIVE)); - NOTIFICATION_DBG("notification display applist - app_id [%s], applist [%d]", + DBG("notification display applist - app_id [%s], applist [%d]", noti->caller_app_id, noti->display_applist); } @@ -1131,7 +1130,7 @@ EXPORT_API int notification_noti_update(notification_h noti) /* Check private ID is exist */ ret = _notification_noti_check_priv_id(noti, db); if (ret != NOTIFICATION_ERROR_ALREADY_EXIST_ID) { - NOTIFICATION_ERR("The ID is not existed"); + ERR("The ID is not existed"); ret = NOTIFICATION_ERROR_NOT_EXIST_ID; goto err; } @@ -1148,7 +1147,7 @@ EXPORT_API int notification_noti_update(notification_h noti) ret = sqlite3_prepare_v2(db, query, -1, &stmt, NULL); if (ret != SQLITE_OK) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("sqlite3_prepare_v2 Failed [%d][%s]", ret, + ERR("sqlite3_prepare_v2 Failed [%d][%s]", ret, sqlite3_errmsg(db)); ret = NOTIFICATION_ERROR_FROM_DB; goto err; @@ -1249,7 +1248,7 @@ EXPORT_API int notification_noti_delete_all(notification_type_e type, ret = sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL); if (ret != SQLITE_OK) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to sqlite3_prepare_V2 [%d][%s]", + ERR("Failed to sqlite3_prepare_V2 [%d][%s]", ret, sqlite3_errmsg(db)); ret = NOTIFICATION_ERROR_FROM_DB; @@ -1266,7 +1265,7 @@ EXPORT_API int notification_noti_delete_all(notification_type_e type, *list_deleted_rowid = tmp; } else { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to realloc memory [%s]", strerror_r(errno, err_buf, sizeof(err_buf))); + ERR("Failed to realloc memory [%s]", strerror_r(errno, err_buf, sizeof(err_buf))); /*! * \TODO * How can I handle this? @@ -1528,7 +1527,7 @@ EXPORT_API int notification_noti_get_count(notification_type_e type, ret = sqlite3_prepare_v2(db, query, -1, &stmt, NULL); if (ret != SQLITE_OK) { - NOTIFICATION_ERR("Failed to sqlite3_prepare_v2[%d][%s]", + ERR("Failed to sqlite3_prepare_v2[%d][%s]", ret, sqlite3_errmsg(db)); ret = NOTIFICATION_ERROR_FROM_DB; @@ -1575,14 +1574,14 @@ EXPORT_API int notification_noti_get_all_count(notification_type_e type, int *co char *sql_buf = NULL; if (count == NULL) { - NOTIFICATION_ERR("Invalid parameter - count is null"); + ERR("Invalid parameter - count is null"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } db = notification_db_open(); if (db == NULL) { ret = get_last_result(); - NOTIFICATION_ERR("Failed to open db [%d]", ret); + ERR("Failed to open db [%d]", ret); return ret; } @@ -1596,14 +1595,14 @@ EXPORT_API int notification_noti_get_all_count(notification_type_e type, int *co if (sql_buf == NULL) { ret = NOTIFICATION_ERROR_FROM_DB; - NOTIFICATION_ERR("OOM - sqlite3_mprintf"); + ERR("OOM - sqlite3_mprintf"); goto out; } sql_ret = sqlite3_prepare_v2(db, sql_buf, -1, &stmt, NULL); if (sql_ret != SQLITE_OK) { ret = NOTIFICATION_ERROR_FROM_DB; - NOTIFICATION_ERR("SQLITE3 Error - sqlite3_prepare_v2 [%d][%s]", + ERR("SQLITE3 Error - sqlite3_prepare_v2 [%d][%s]", sql_ret, sqlite3_errmsg(db)); goto out; } @@ -1614,7 +1613,7 @@ EXPORT_API int notification_noti_get_all_count(notification_type_e type, int *co else *count = 0; - NOTIFICATION_INFO("The numbers of all notification is [%d]", *count); + INFO("The numbers of all notification is [%d]", *count); out: if (stmt) @@ -1801,7 +1800,7 @@ EXPORT_API int notification_noti_check_tag(notification_h noti) ret = sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL); if (ret != SQLITE_OK) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to sqlite3_prepare_v2[%d][%s]", + ERR("Failed to sqlite3_prepare_v2[%d][%s]", ret, sqlite3_errmsg(db)); goto err; /* LCOV_EXCL_STOP */ @@ -1862,7 +1861,7 @@ EXPORT_API int notification_noti_check_count_for_template(notification_h noti, i ret = sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL); if (ret != SQLITE_OK) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to sqlite3_prepare_v2[%d][%s]", + ERR("Failed to sqlite3_prepare_v2[%d][%s]", ret, sqlite3_errmsg(db)); ret = NOTIFICATION_ERROR_FROM_DB; goto err; @@ -1899,7 +1898,7 @@ EXPORT_API int notification_noti_add_template(notification_h noti, char *templat int ret = NOTIFICATION_ERROR_NONE; if (noti == NULL || template_name == NULL) { - NOTIFICATION_ERR("NOTIFICATION_ERROR_INVALID_PARAMETER"); + ERR("NOTIFICATION_ERROR_INVALID_PARAMETER"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -1926,7 +1925,7 @@ EXPORT_API int notification_noti_add_template(notification_h noti, char *templat ret = sqlite3_prepare_v2(db, query, -1, &stmt, NULL); if (ret != SQLITE_OK) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to sqlite3_prepare_v2[%d][%s]", + ERR("Failed to sqlite3_prepare_v2[%d][%s]", ret, sqlite3_errmsg(db)); ret = NOTIFICATION_ERROR_FROM_DB; goto err; @@ -1962,7 +1961,7 @@ EXPORT_API int notification_noti_get_package_template(notification_h noti, char char *query_where = NULL; if (noti == NULL || app_id == NULL || template_name == NULL) { - NOTIFICATION_ERR("NOTIFICATION_ERROR_INVALID_PARAMETER"); + ERR("NOTIFICATION_ERROR_INVALID_PARAMETER"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -1973,7 +1972,7 @@ EXPORT_API int notification_noti_get_package_template(notification_h noti, char ret = _get_notification(query_where, noti); if (ret != NOTIFICATION_ERROR_NONE) - NOTIFICATION_ERR("Failed to get notification [%d]", ret); + ERR("Failed to get notification [%d]", ret); if (query_where) sqlite3_free(query_where); diff --git a/src/notification_ongoing.c b/src/notification_ongoing.c index a5f4ec8..89ee0c9 100755 --- a/src/notification_ongoing.c +++ b/src/notification_ongoing.c @@ -59,7 +59,7 @@ static void __notification_ongoing_update_callback(GDBusConnection *connection, info = calloc(1, sizeof(struct ongoing_info_s)); if (info == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc memory"); + ERR("Failed to alloc memory"); return; /* LCOV_EXCL_STOP */ } @@ -77,7 +77,7 @@ static void __notification_ongoing_update_callback(GDBusConnection *connection, if (app_id == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("app_id is NULL"); + ERR("app_id is NULL"); free(info); return; /* LCOV_EXCL_STOP */ @@ -106,7 +106,7 @@ static int __send_ongoing_update_signal(const char *signal_name, GVariant *param conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &err); if (conn == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to connect to the D-BUS Daemon[%s]", + ERR("Failed to connect to the D-BUS Daemon[%s]", err->message); ret = NOTIFICATION_ERROR_FROM_DBUS; goto end; @@ -121,7 +121,7 @@ static int __send_ongoing_update_signal(const char *signal_name, GVariant *param param, &err) == FALSE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to emit gdbus signal[%s]", + ERR("Failed to emit gdbus signal[%s]", err->message); ret = NOTIFICATION_ERROR_FROM_DBUS; goto end; @@ -130,7 +130,7 @@ static int __send_ongoing_update_signal(const char *signal_name, GVariant *param if (g_dbus_connection_flush_sync(conn, NULL, &err) == FALSE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to flush connection sync[%s]", + ERR("Failed to flush connection sync[%s]", err->message); ret = NOTIFICATION_ERROR_FROM_DBUS; goto end; @@ -162,7 +162,7 @@ int notification_ongoing_update_cb_set(notification_ongoing_update_cb callback, od.conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error); if (od.conn == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to connect to the D-BUS Daemon: %s", + ERR("Failed to connect to the D-BUS Daemon: %s", error->message); g_error_free(error); return NOTIFICATION_ERROR_FROM_DBUS; @@ -183,7 +183,7 @@ int notification_ongoing_update_cb_set(notification_ongoing_update_cb callback, NULL); if (od.subscribe_id == 0) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to subscribe signal"); + ERR("Failed to subscribe signal"); g_object_unref(od.conn); return NOTIFICATION_ERROR_FROM_DBUS; /* LCOV_EXCL_STOP */ @@ -226,7 +226,7 @@ int notification_ongoing_update_progress(const char *caller_app_id, ret = __send_ongoing_update_signal(MEMBER_PROGRESS, param); if (ret != NOTIFICATION_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to update progress[%d]", ret); + ERR("Failed to update progress[%d]", ret); return ret; /* LCOV_EXCL_STOP */ } @@ -245,7 +245,7 @@ int notification_ongoing_update_size(const char *caller_app_id, ret = __send_ongoing_update_signal(MEMBER_SIZE, param); if (ret != NOTIFICATION_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to update size[%d]", ret); + ERR("Failed to update size[%d]", ret); return ret; /* LCOV_EXCL_STOP */ } @@ -264,7 +264,7 @@ int notification_ongoing_update_content(const char *caller_app_id, ret = __send_ongoing_update_signal(MEMBER_CONTENT, param); if (ret != NOTIFICATION_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to update content[%d]", + ERR("Failed to update content[%d]", ret); return ret; /* LCOV_EXCL_STOP */ diff --git a/src/notification_setting.c b/src/notification_setting.c index 7eb6e86..ab34aae 100755 --- a/src/notification_setting.c +++ b/src/notification_setting.c @@ -52,7 +52,7 @@ static GHashTable *_noti_dnd_cb_hash = NULL; EXPORT_API int notification_setting_get_setting_array_for_uid(notification_setting_h *setting_array, int *count, uid_t uid) { if (setting_array == NULL || count == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -67,7 +67,7 @@ EXPORT_API int notification_setting_get_setting_array(notification_setting_h *se EXPORT_API int notification_setting_get_setting_by_appid_for_uid(const char *app_id, notification_setting_h *setting, uid_t uid) { if (app_id == NULL || setting == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -103,12 +103,12 @@ EXPORT_API int notification_setting_get_setting(notification_setting_h *setting) EXPORT_API int notification_setting_get_package_name(notification_setting_h setting, char **value) { if (setting == NULL || value == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } if (setting->package_name == NULL) { - NOTIFICATION_ERR("setting->package_name is null"); + ERR("setting->package_name is null"); return NOTIFICATION_ERROR_NOT_EXIST_ID; } @@ -120,12 +120,12 @@ EXPORT_API int notification_setting_get_package_name(notification_setting_h sett EXPORT_API int notification_setting_get_appid(notification_setting_h setting, char **app_id) { if (setting == NULL || app_id == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } if (setting->app_id == NULL) { - NOTIFICATION_ERR("setting->app_id is null"); + ERR("setting->app_id is null"); return NOTIFICATION_ERROR_NOT_EXIST_ID; } @@ -137,7 +137,7 @@ EXPORT_API int notification_setting_get_appid(notification_setting_h setting, ch EXPORT_API int notification_setting_get_allow_to_notify(notification_setting_h setting, bool *value) { if (setting == NULL || value == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -149,7 +149,7 @@ EXPORT_API int notification_setting_get_allow_to_notify(notification_setting_h s EXPORT_API int notification_setting_set_allow_to_notify(notification_setting_h setting, bool value) { if (setting == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -161,7 +161,7 @@ EXPORT_API int notification_setting_set_allow_to_notify(notification_setting_h s EXPORT_API int notification_setting_get_do_not_disturb_except(notification_setting_h setting, bool *value) { if (setting == NULL || value == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -173,7 +173,7 @@ EXPORT_API int notification_setting_get_do_not_disturb_except(notification_setti EXPORT_API int notification_setting_set_do_not_disturb_except(notification_setting_h setting, bool value) { if (setting == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -185,7 +185,7 @@ EXPORT_API int notification_setting_set_do_not_disturb_except(notification_setti EXPORT_API int notification_setting_get_visibility_class(notification_setting_h setting, int *value) { if (setting == NULL || value == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -197,7 +197,7 @@ EXPORT_API int notification_setting_get_visibility_class(notification_setting_h EXPORT_API int notification_setting_set_visibility_class(notification_setting_h setting, int value) { if (setting == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -209,7 +209,7 @@ EXPORT_API int notification_setting_set_visibility_class(notification_setting_h EXPORT_API int notification_setting_get_pop_up_notification(notification_setting_h setting, bool *value) { if (setting == NULL || value == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -220,7 +220,7 @@ EXPORT_API int notification_setting_get_pop_up_notification(notification_setting EXPORT_API int notification_setting_set_pop_up_notification(notification_setting_h setting, bool value) { if (setting == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -231,7 +231,7 @@ EXPORT_API int notification_setting_set_pop_up_notification(notification_setting EXPORT_API int notification_setting_get_lock_screen_content(notification_setting_h setting, lock_screen_content_level_e *level) { if (setting == NULL || level == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -243,7 +243,7 @@ EXPORT_API int notification_setting_get_lock_screen_content(notification_setting EXPORT_API int notification_setting_set_lock_screen_content(notification_setting_h setting, lock_screen_content_level_e level) { if (setting == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -255,7 +255,7 @@ EXPORT_API int notification_setting_set_lock_screen_content(notification_setting EXPORT_API int notification_setting_get_app_disabled(notification_setting_h setting, bool *value) { if (setting == NULL || value == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -267,7 +267,7 @@ EXPORT_API int notification_setting_get_app_disabled(notification_setting_h sett EXPORT_API int notification_setting_update_setting_for_uid(notification_setting_h setting, uid_t uid) { if (setting == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -282,7 +282,7 @@ EXPORT_API int notification_setting_update_setting(notification_setting_h settin EXPORT_API int notification_setting_free_notification(notification_setting_h setting) { if (setting == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -316,7 +316,7 @@ static bool _is_package_in_setting_table(sqlite3 *db, const char *package_name, if (query == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("fail to alloc query"); + ERR("fail to alloc query"); return false; /* LCOV_EXCL_STOP */ } @@ -324,7 +324,7 @@ static bool _is_package_in_setting_table(sqlite3 *db, const char *package_name, sql_ret = sqlite3_prepare_v2(db, query, -1, &stmt, NULL); if (sql_ret != SQLITE_OK) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("sqlite3_prepare_v2 failed [%d][%s]", sql_ret, + ERR("sqlite3_prepare_v2 failed [%d][%s]", sql_ret, sqlite3_errmsg(db)); err = false; goto out; @@ -333,7 +333,7 @@ static bool _is_package_in_setting_table(sqlite3 *db, const char *package_name, sql_ret = sqlite3_step(stmt); if (sql_ret == SQLITE_DONE) { - NOTIFICATION_INFO("No matched [%s] from package_name [%s], [%d]", + INFO("No matched [%s] from package_name [%s], [%d]", app_id, package_name, sql_ret); err = false; goto out; @@ -341,7 +341,7 @@ static bool _is_package_in_setting_table(sqlite3 *db, const char *package_name, if (sql_ret != SQLITE_OK && sql_ret != SQLITE_ROW) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("sqlite3_step failed [%d][%s]", sql_ret, + ERR("sqlite3_step failed [%d][%s]", sql_ret, sqlite3_errmsg(db)); err = false; goto out; @@ -372,7 +372,7 @@ static int _foreach_app_info_callback(const pkgmgrinfo_appinfo_h handle, ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id); if (ret != PACKAGE_MANAGER_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to get appid from pkgmgrinfo [%d]", + ERR("Failed to get appid from pkgmgrinfo [%d]", ret); err = false; goto out; @@ -382,14 +382,14 @@ static int _foreach_app_info_callback(const pkgmgrinfo_appinfo_h handle, ret = pkgmgrinfo_appinfo_get_pkgname(handle, &package_name); if (ret != PACKAGE_MANAGER_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to get pkgname from pkgmgrinfo[%d]", + ERR("Failed to get pkgname from pkgmgrinfo[%d]", ret); goto out; /* LCOV_EXCL_STOP */ } if (_is_package_in_setting_table(db, package_name, app_id, info->uid) == true) { - NOTIFICATION_INFO("uid %d [%s] is exist", info->uid, app_id); + INFO("uid %d [%s] is exist", info->uid, app_id); err = false; goto out; } @@ -400,7 +400,7 @@ static int _foreach_app_info_callback(const pkgmgrinfo_appinfo_h handle, info->uid, package_name, app_id); if (query == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("fail to alloc query"); + ERR("fail to alloc query"); err = false; goto out; /* LCOV_EXCL_STOP */ @@ -410,7 +410,7 @@ static int _foreach_app_info_callback(const pkgmgrinfo_appinfo_h handle, if (ret != NOTIFICATION_ERROR_NONE) err = false; else - NOTIFICATION_INFO("uid [%d] package_name [%s] appid [%s] is inserted", + INFO("uid [%d] package_name [%s] appid [%s] is inserted", info->uid, package_name, app_id); out: @@ -431,7 +431,7 @@ static int _foreach_package_info_callback(const pkgmgrinfo_pkginfo_h package_inf pkgmgr_ret = pkgmgrinfo_pkginfo_get_pkgname(package_info, &package_name); if (pkgmgr_ret != PACKAGE_MANAGER_ERROR_NONE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to get pkgname from pkgmgrinfo[%d]", pkgmgr_ret); + ERR("Failed to get pkgname from pkgmgrinfo[%d]", pkgmgr_ret); err = false; goto out; /* LCOV_EXCL_STOP */ @@ -440,7 +440,7 @@ static int _foreach_package_info_callback(const pkgmgrinfo_pkginfo_h package_inf pkgmgr_ret = pkgmgrinfo_appinfo_filter_create(&handle); if (pkgmgr_ret != PMINFO_R_OK) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to create appinofo[%d]", + ERR("Failed to create appinofo[%d]", pkgmgr_ret); err = false; goto out; @@ -450,7 +450,7 @@ static int _foreach_package_info_callback(const pkgmgrinfo_pkginfo_h package_inf pkgmgr_ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_PACKAGE, package_name); if (pkgmgr_ret != PMINFO_R_OK) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to add string to appinfo[%d]", pkgmgr_ret); + ERR("Failed to add string to appinfo[%d]", pkgmgr_ret); err = false; goto out; /* LCOV_EXCL_STOP */ @@ -459,7 +459,7 @@ static int _foreach_package_info_callback(const pkgmgrinfo_pkginfo_h package_inf pkgmgr_ret = pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(handle, _foreach_app_info_callback, info, info->uid); if (pkgmgr_ret != PMINFO_R_OK) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to iterate appinfo[%d]", pkgmgr_ret); + ERR("Failed to iterate appinfo[%d]", pkgmgr_ret); err = false; goto out; /* LCOV_EXCL_STOP */ @@ -487,7 +487,7 @@ static int _install_and_update_package(const char *package_name, uid_t uid) pkgmgr_ret = pkgmgrinfo_pkginfo_filter_create(&handle); if (pkgmgr_ret != PMINFO_R_OK) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to create pkginfo_filter[%d]", pkgmgr_ret); + ERR("Failed to create pkginfo_filter[%d]", pkgmgr_ret); err = NOTIFICATION_ERROR_FROM_DB; goto out; /* LCOV_EXCL_STOP */ @@ -496,7 +496,7 @@ static int _install_and_update_package(const char *package_name, uid_t uid) pkgmgr_ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE, NOTIFICATION_PRIVILEGE); if (pkgmgr_ret != PMINFO_R_OK) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to add string to pkginfo_filter[%d]", pkgmgr_ret); + ERR("Failed to add string to pkginfo_filter[%d]", pkgmgr_ret); err = NOTIFICATION_ERROR_FROM_DB; goto out; /* LCOV_EXCL_STOP */ @@ -505,7 +505,7 @@ static int _install_and_update_package(const char *package_name, uid_t uid) pkgmgr_ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_ID, package_name); if (pkgmgr_ret != PMINFO_R_OK) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to add string to pkginfo_filter[%d]", pkgmgr_ret); + ERR("Failed to add string to pkginfo_filter[%d]", pkgmgr_ret); err = NOTIFICATION_ERROR_FROM_DB; goto out; /* LCOV_EXCL_STOP */ @@ -516,7 +516,7 @@ static int _install_and_update_package(const char *package_name, uid_t uid) pkgmgr_ret = pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(handle, _foreach_package_info_callback, &info, uid); if (pkgmgr_ret != PMINFO_R_OK) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to iterate pkginfo[%d]", pkgmgr_ret); + ERR("Failed to iterate pkginfo[%d]", pkgmgr_ret); err = NOTIFICATION_ERROR_FROM_DB; goto out; /* LCOV_EXCL_STOP */ @@ -546,7 +546,7 @@ static int _delete_package_from_setting_db(const char *package_name, uid_t uid) is_package_in_setting_table = _is_package_in_setting_table(db, package_name, NULL, uid); if (is_package_in_setting_table == false) { - NOTIFICATION_INFO("[%s] is not exist", package_name); + INFO("[%s] is not exist", package_name); goto out; } @@ -556,7 +556,7 @@ static int _delete_package_from_setting_db(const char *package_name, uid_t uid) package_name); if (query == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc query"); + ERR("Failed to alloc query"); err = NOTIFICATION_ERROR_OUT_OF_MEMORY; goto out; /* LCOV_EXCL_STOP */ @@ -582,7 +582,7 @@ EXPORT_API int notification_setting_refresh_setting_table(uid_t uid) pkgmgrinfo_pkginfo_filter_h filter = NULL; setting_local_info info; - NOTIFICATION_INFO("Refresh setting table [%d]", uid); + INFO("Refresh setting table [%d]", uid); db = notification_db_open(); if (!db) @@ -591,7 +591,7 @@ EXPORT_API int notification_setting_refresh_setting_table(uid_t uid) pkgmgr_ret = pkgmgrinfo_pkginfo_filter_create(&filter); if (pkgmgr_ret != PMINFO_R_OK) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to create pkginfo_filter[%d]", pkgmgr_ret); + ERR("Failed to create pkginfo_filter[%d]", pkgmgr_ret); err = NOTIFICATION_ERROR_FROM_DB; goto out; /* LCOV_EXCL_STOP */ @@ -600,7 +600,7 @@ EXPORT_API int notification_setting_refresh_setting_table(uid_t uid) pkgmgr_ret = pkgmgrinfo_pkginfo_filter_add_string(filter, PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE, NOTIFICATION_PRIVILEGE); if (pkgmgr_ret != PMINFO_R_OK) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to add string to pkginfo_filter[%d]", pkgmgr_ret); + ERR("Failed to add string to pkginfo_filter[%d]", pkgmgr_ret); err = NOTIFICATION_ERROR_FROM_DB; goto out; /* LCOV_EXCL_STOP */ @@ -611,7 +611,7 @@ EXPORT_API int notification_setting_refresh_setting_table(uid_t uid) pkgmgr_ret = pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(filter, _foreach_package_info_callback, &info, uid); if (pkgmgr_ret != PMINFO_R_OK) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to foreach pkginfo[%d]", pkgmgr_ret); + ERR("Failed to foreach pkginfo[%d]", pkgmgr_ret); err = NOTIFICATION_ERROR_FROM_DB; goto out; /* LCOV_EXCL_STOP */ @@ -640,7 +640,7 @@ EXPORT_API int notification_setting_delete_package_for_uid(const char *package_n EXPORT_API int notification_system_setting_load_system_setting_for_uid(notification_system_setting_h *system_setting, uid_t uid) { if (system_setting == NULL) { - NOTIFICATION_ERR("NOTIFICATION_ERROR_INVALID_PARAMETER"); + ERR("NOTIFICATION_ERROR_INVALID_PARAMETER"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -655,7 +655,7 @@ EXPORT_API int notification_system_setting_load_system_setting(notification_syst EXPORT_API int notification_system_setting_update_system_setting_for_uid(notification_system_setting_h system_setting, uid_t uid) { if (system_setting == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -670,7 +670,7 @@ EXPORT_API int notification_system_setting_update_system_setting(notification_sy EXPORT_API int notification_system_setting_free_system_setting(notification_system_setting_h system_setting) { if (system_setting == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -687,7 +687,7 @@ EXPORT_API int notification_system_setting_free_system_setting(notification_syst EXPORT_API int notification_system_setting_get_do_not_disturb(notification_system_setting_h system_setting, bool *value) { if (system_setting == NULL || value == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -699,7 +699,7 @@ EXPORT_API int notification_system_setting_get_do_not_disturb(notification_syste EXPORT_API int notification_system_setting_set_do_not_disturb(notification_system_setting_h system_setting, bool value) { if (system_setting == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -711,7 +711,7 @@ EXPORT_API int notification_system_setting_set_do_not_disturb(notification_syste EXPORT_API int notification_system_setting_get_visibility_class(notification_system_setting_h system_setting, int *value) { if (system_setting == NULL || value == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -723,7 +723,7 @@ EXPORT_API int notification_system_setting_get_visibility_class(notification_sys EXPORT_API int notification_system_setting_set_visibility_class(notification_system_setting_h system_setting, int value) { if (system_setting == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -735,7 +735,7 @@ EXPORT_API int notification_system_setting_set_visibility_class(notification_sys EXPORT_API int notification_system_setting_dnd_schedule_get_enabled(notification_system_setting_h system_setting, bool *enabled) { if (system_setting == NULL || enabled == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -747,7 +747,7 @@ EXPORT_API int notification_system_setting_dnd_schedule_get_enabled(notification EXPORT_API int notification_system_setting_dnd_schedule_set_enabled(notification_system_setting_h system_setting, bool enabled) { if (system_setting == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -759,7 +759,7 @@ EXPORT_API int notification_system_setting_dnd_schedule_set_enabled(notification EXPORT_API int notification_system_setting_dnd_schedule_get_day(notification_system_setting_h system_setting, int *day) { if (system_setting == NULL || day == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -771,7 +771,7 @@ EXPORT_API int notification_system_setting_dnd_schedule_get_day(notification_sys EXPORT_API int notification_system_setting_dnd_schedule_set_day(notification_system_setting_h system_setting, int day) { if (system_setting == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -783,7 +783,7 @@ EXPORT_API int notification_system_setting_dnd_schedule_set_day(notification_sys EXPORT_API int notification_system_setting_dnd_schedule_get_start_time(notification_system_setting_h system_setting, int *hour, int *min) { if (system_setting == NULL || hour == NULL || min == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -796,7 +796,7 @@ EXPORT_API int notification_system_setting_dnd_schedule_get_start_time(notificat EXPORT_API int notification_system_setting_dnd_schedule_set_start_time(notification_system_setting_h system_setting, int hour, int min) { if (system_setting == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -809,7 +809,7 @@ EXPORT_API int notification_system_setting_dnd_schedule_set_start_time(notificat EXPORT_API int notification_system_setting_dnd_schedule_get_end_time(notification_system_setting_h system_setting, int *hour, int *min) { if (system_setting == NULL || hour == NULL || min == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -822,7 +822,7 @@ EXPORT_API int notification_system_setting_dnd_schedule_get_end_time(notificatio EXPORT_API int notification_system_setting_dnd_schedule_set_end_time(notification_system_setting_h system_setting, int hour, int min) { if (system_setting == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -835,7 +835,7 @@ EXPORT_API int notification_system_setting_dnd_schedule_set_end_time(notificatio EXPORT_API int notification_system_setting_get_lock_screen_content(notification_system_setting_h system_setting, lock_screen_content_level_e *level) { if (system_setting == NULL || level == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -847,7 +847,7 @@ EXPORT_API int notification_system_setting_get_lock_screen_content(notification_ EXPORT_API int notification_system_setting_set_lock_screen_content(notification_system_setting_h system_setting, lock_screen_content_level_e level) { if (system_setting == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -877,7 +877,7 @@ EXPORT_API int notification_system_setting_get_dnd_allow_exceptions(notification GList *list; if (system_setting == NULL || value == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -886,7 +886,7 @@ EXPORT_API int notification_system_setting_get_dnd_allow_exceptions(notification dnd_allow_exception_data = (dnd_allow_exception_h)list->data; *value = dnd_allow_exception_data->value; } else { - NOTIFICATION_ERR("Invalid type"); + ERR("Invalid type"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -899,7 +899,7 @@ EXPORT_API int notification_system_setting_set_dnd_allow_exceptions(notification GList *list = NULL; if (system_setting == NULL) { - NOTIFICATION_ERR("Invalid parameter"); + ERR("Invalid parameter"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -947,7 +947,7 @@ void notification_call_dnd_changed_cb_for_uid(int do_not_disturb, uid_t uid) noti_dnd_cb_list = (GList *)g_hash_table_lookup(_noti_dnd_cb_hash, GUINT_TO_POINTER(uid)); if (noti_dnd_cb_list == NULL) { - NOTIFICATION_ERR("Invalid data"); + ERR("Invalid data"); return; } @@ -972,7 +972,7 @@ EXPORT_API int notification_register_system_setting_dnd_changed_cb_for_uid(dnd_c return NOTIFICATION_ERROR_INVALID_PARAMETER; if (notification_ipc_monitor_init(uid) != NOTIFICATION_ERROR_NONE) { - NOTIFICATION_ERR("Failed to init monitor"); + ERR("Failed to init monitor"); return NOTIFICATION_ERROR_IO_ERROR; } @@ -995,7 +995,7 @@ EXPORT_API int notification_register_system_setting_dnd_changed_cb_for_uid(dnd_c noti_dnd_found_list = g_list_find_custom(noti_dnd_list, (gconstpointer)callback, (GCompareFunc)_noti_dnd_cb_compare); if (noti_dnd_found_list) { - NOTIFICATION_ERR("Already existing callback"); + ERR("Already existing callback"); free(dnd_data); return NOTIFICATION_ERROR_INVALID_PARAMETER; } else { @@ -1068,7 +1068,7 @@ static bool _is_uid_in_system_setting_table(sqlite3 *db, uid_t uid) NOTIFICATION_SYSTEM_SETTING_DB_TABLE, uid); if (query == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc query"); + ERR("Failed to alloc query"); return NOTIFICATION_ERROR_OUT_OF_MEMORY; /* LCOV_EXCL_STOP */ } @@ -1076,7 +1076,7 @@ static bool _is_uid_in_system_setting_table(sqlite3 *db, uid_t uid) sql_ret = sqlite3_prepare_v2(db, query, -1, &stmt, NULL); if (sql_ret != SQLITE_OK) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("sqlite3_prepare_v2 failed [%d][%s]", sql_ret, + ERR("sqlite3_prepare_v2 failed [%d][%s]", sql_ret, sqlite3_errmsg(db)); err = false; goto out; @@ -1085,13 +1085,13 @@ static bool _is_uid_in_system_setting_table(sqlite3 *db, uid_t uid) sql_ret = sqlite3_step(stmt); if (sql_ret == SQLITE_DONE) { - NOTIFICATION_INFO("No matched uid[%d] err[%d]", uid, sql_ret); + INFO("No matched uid[%d] err[%d]", uid, sql_ret); err = false; goto out; } if (sql_ret != SQLITE_OK && sql_ret != SQLITE_ROW) { - NOTIFICATION_ERR("sqlite3_step failed [%d][%s]", + ERR("sqlite3_step failed [%d][%s]", sql_ret, sqlite3_errmsg(db)); err = false; } @@ -1113,14 +1113,14 @@ EXPORT_API int notification_system_setting_init_system_setting_table(uid_t uid) char *query_dnd_allow_exception = NULL; int ret = NOTIFICATION_ERROR_NONE; - NOTIFICATION_INFO("init system setting table [%d]", uid); + INFO("init system setting table [%d]", uid); db = notification_db_open(); if (db == NULL) return get_last_result(); /* LCOV_EXCL_LINE */ if (_is_uid_in_system_setting_table(db, uid) == true) { - NOTIFICATION_INFO("Setting table is already initialized."); + INFO("Setting table is already initialized."); goto out; } @@ -1131,7 +1131,7 @@ EXPORT_API int notification_system_setting_init_system_setting_table(uid_t uid) uid); if (query_system_setting == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("fail to alloc query"); + ERR("fail to alloc query"); ret = NOTIFICATION_ERROR_OUT_OF_MEMORY; goto out; /* LCOV_EXCL_STOP */ @@ -1148,7 +1148,7 @@ EXPORT_API int notification_system_setting_init_system_setting_table(uid_t uid) uid); if (query_dnd_allow_exception == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc query"); + ERR("Failed to alloc query"); ret = NOTIFICATION_ERROR_OUT_OF_MEMORY; goto out; /* LCOV_EXCL_STOP */ @@ -1158,7 +1158,7 @@ EXPORT_API int notification_system_setting_init_system_setting_table(uid_t uid) if (ret != NOTIFICATION_ERROR_NONE) goto out; - NOTIFICATION_DBG("Initialization is success."); + DBG("Initialization is success."); out: if (query_system_setting) diff --git a/src/notification_setting_service.c b/src/notification_setting_service.c index a585617..6445686 100755 --- a/src/notification_setting_service.c +++ b/src/notification_setting_service.c @@ -37,7 +37,7 @@ static int _get_table_field_data_int(char **table, int *buf, int index) { if (table == NULL || buf == NULL || index < 0) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("table[%p], buf[%p], index[%d]", table, buf, index); + ERR("table[%p], buf[%p], index[%d]", table, buf, index); return false; /* LCOV_EXCL_STOP */ } @@ -61,7 +61,7 @@ static int _get_table_field_data_string(char **table, char **buf, int ucs2, int if (table == NULL || buf == NULL || index < 0) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("table[%p], buf[%p], index[%d]", table, buf, index); + ERR("table[%p], buf[%p], index[%d]", table, buf, index); return false; /* LCOV_EXCL_STOP */ } @@ -75,7 +75,7 @@ static int _get_table_field_data_string(char **table, char **buf, int ucs2, int if (sLen) { *buf = (char *)malloc(sLen + 1); if (*buf == NULL) { - NOTIFICATION_ERR("Failed to alloc memory"); /* LCOV_EXCL_LINE */ + ERR("Failed to alloc memory"); /* LCOV_EXCL_LINE */ goto out; } memset(*buf, 0, sLen + 1); @@ -106,7 +106,7 @@ int noti_setting_service_get_setting_by_app_id(const char *app_id, notification_ notification_setting_h result_setting_array = NULL; if (app_id == NULL || setting == NULL) { - NOTIFICATION_ERR("Invalid parameter"); /* LCOV_EXCL_LINE */ + ERR("Invalid parameter"); /* LCOV_EXCL_LINE */ return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -119,7 +119,7 @@ int noti_setting_service_get_setting_by_app_id(const char *app_id, notification_ app_id, uid); if (query == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc query"); + ERR("Failed to alloc query"); ret = NOTIFICATION_ERROR_OUT_OF_MEMORY; goto out; /* LCOV_EXCL_STOP */ @@ -128,7 +128,7 @@ int noti_setting_service_get_setting_by_app_id(const char *app_id, notification_ sql_ret = sqlite3_get_table(db, query, &query_result, &row_count, &column_count, NULL); if (sql_ret != SQLITE_OK && sql_ret != -1) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("sqlite3_get_table failed [%d][%s]", sql_ret, + ERR("sqlite3_get_table failed [%d][%s]", sql_ret, query); ret = NOTIFICATION_ERROR_FROM_DB; goto out; @@ -136,18 +136,18 @@ int noti_setting_service_get_setting_by_app_id(const char *app_id, notification_ } if (!row_count) { - NOTIFICATION_DBG("No setting found for [%s]", app_id); + DBG("No setting found for [%s]", app_id); ret = NOTIFICATION_ERROR_NOT_EXIST_ID; goto out; } - NOTIFICATION_DBG("row_count[%d] column_count[%d]", row_count, column_count); + DBG("row_count[%d] column_count[%d]", row_count, column_count); row_count = 1; if (!(result_setting_array = (struct notification_setting *)malloc(sizeof(struct notification_setting) * row_count))) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc memory"); + ERR("Failed to alloc memory"); ret = NOTIFICATION_ERROR_OUT_OF_MEMORY; goto out; /* LCOV_EXCL_STOP */ @@ -194,7 +194,7 @@ int noti_setting_get_setting_array(notification_setting_h *setting_array, int *c notification_setting_h result_setting_array = NULL; if (setting_array == NULL || count == NULL) { - NOTIFICATION_ERR("NOTIFICATION_ERROR_INVALID_PARAMETER"); /* LCOV_EXCL_LINE */ + ERR("NOTIFICATION_ERROR_INVALID_PARAMETER"); /* LCOV_EXCL_LINE */ return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -208,7 +208,7 @@ int noti_setting_get_setting_array(notification_setting_h *setting_array, int *c NOTIFICATION_SETTING_DB_TABLE, uid, 0); if (query == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc query"); /* LCOV_EXCL_LINE */ + ERR("Failed to alloc query"); /* LCOV_EXCL_LINE */ ret = NOTIFICATION_ERROR_OUT_OF_MEMORY; goto out; /* LCOV_EXCL_STOP */ @@ -217,7 +217,7 @@ int noti_setting_get_setting_array(notification_setting_h *setting_array, int *c sql_ret = sqlite3_get_table(db, query, &query_result, &row_count, &column_count, NULL); if (sql_ret != SQLITE_OK && sql_ret != -1) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to get db table [%d][%s]", + ERR("Failed to get db table [%d][%s]", sql_ret, query); /* LCOV_EXCL_LINE */ ret = NOTIFICATION_ERROR_FROM_DB; goto out; @@ -225,16 +225,16 @@ int noti_setting_get_setting_array(notification_setting_h *setting_array, int *c } if (!row_count) { - NOTIFICATION_DBG("No setting found"); /* LCOV_EXCL_LINE */ + DBG("No setting found"); /* LCOV_EXCL_LINE */ ret = NOTIFICATION_ERROR_NOT_EXIST_ID; goto out; } - NOTIFICATION_DBG("row_count[%d] column_count[%d]", row_count, column_count); + DBG("row_count[%d] column_count[%d]", row_count, column_count); if (!(result_setting_array = (struct notification_setting *)malloc(sizeof(struct notification_setting) * row_count))) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc memory"); /* LCOV_EXCL_LINE */ + ERR("Failed to alloc memory"); /* LCOV_EXCL_LINE */ ret = NOTIFICATION_ERROR_OUT_OF_MEMORY; goto out; /* LCOV_EXCL_STOP */ @@ -284,7 +284,7 @@ int noti_system_setting_load_system_setting(notification_system_setting_h *syste notification_system_setting_h result_system_setting = NULL; if (system_setting == NULL) { - NOTIFICATION_ERR("Invalid parameter"); /* LCOV_EXCL_LINE */ + ERR("Invalid parameter"); /* LCOV_EXCL_LINE */ return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -297,7 +297,7 @@ int noti_system_setting_load_system_setting(notification_system_setting_h *syste NOTIFICATION_SYSTEM_SETTING_DB_TABLE, uid); if (query == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc query"); /* LCOV_EXCL_LINE */ + ERR("Failed to alloc query"); /* LCOV_EXCL_LINE */ ret = NOTIFICATION_ERROR_OUT_OF_MEMORY; goto out; /* LCOV_EXCL_STOP */ @@ -306,18 +306,18 @@ int noti_system_setting_load_system_setting(notification_system_setting_h *syste sql_ret = sqlite3_get_table(db, query, &query_result, &row_count, &column_count, NULL); if (sql_ret != SQLITE_OK && sql_ret != -1) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to get db table [%d][%s]", sql_ret, query); /* LCOV_EXCL_LINE */ + ERR("Failed to get db table [%d][%s]", sql_ret, query); /* LCOV_EXCL_LINE */ ret = NOTIFICATION_ERROR_FROM_DB; goto out; /* LCOV_EXCL_STOP */ } - NOTIFICATION_DBG("row_count [%d] column_count [%d]", row_count, column_count); + DBG("row_count [%d] column_count [%d]", row_count, column_count); result_system_setting = (struct notification_system_setting *)malloc(sizeof(struct notification_system_setting)); if (result_system_setting == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc memory"); /* LCOV_EXCL_LINE */ + ERR("Failed to alloc memory"); /* LCOV_EXCL_LINE */ ret = NOTIFICATION_ERROR_OUT_OF_MEMORY; goto out; /* LCOV_EXCL_STOP */ @@ -325,7 +325,7 @@ int noti_system_setting_load_system_setting(notification_system_setting_h *syste /* no system setting record. allow everyting */ if (!row_count) { - NOTIFICATION_DBG("No setting found"); /* LCOV_EXCL_LINE */ + DBG("No setting found"); /* LCOV_EXCL_LINE */ result_system_setting->do_not_disturb = 0; result_system_setting->visibility_class = 0; result_system_setting->dnd_schedule_enabled = 0; @@ -378,7 +378,7 @@ int notification_setting_db_update(const char *package_name, const char *app_id, int ret = NOTIFICATION_ERROR_NONE; if (package_name == NULL || app_id == NULL) { - NOTIFICATION_ERR("Invalid paramter"); /* LCOV_EXCL_LINE */ + ERR("Invalid paramter"); /* LCOV_EXCL_LINE */ return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -449,7 +449,7 @@ int notification_setting_db_update_system_setting(int do_not_disturb, int visibi goto out; if (num_changes == 0) - NOTIFICATION_WARN("No changes on DB"); + WARN("No changes on DB"); out: if (query) @@ -479,7 +479,7 @@ int notification_setting_db_update_do_not_disturb(int do_not_disturb, uid_t uid) do_not_disturb, uid); if (query == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc query"); /* LCOV_EXCL_LINE */ + ERR("Failed to alloc query"); /* LCOV_EXCL_LINE */ ret = NOTIFICATION_ERROR_OUT_OF_MEMORY; goto out; /* LCOV_EXCL_STOP */ @@ -528,21 +528,21 @@ int notification_system_setting_get_dnd_schedule_enabled_uid(uid_t **uids, int * ret = sqlite3_get_table(db, query, &query_result, &row_count, &column_count, NULL); if (ret != SQLITE_OK && ret != -1) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to get DB table [%d][%s]", ret, query); /* LCOV_EXCL_LINE */ + ERR("Failed to get DB table [%d][%s]", ret, query); /* LCOV_EXCL_LINE */ ret = NOTIFICATION_ERROR_FROM_DB; goto out; /* LCOV_EXCL_STOP */ } if (row_count == 0) { - NOTIFICATION_DBG("No enabled do_not_disturb user"); + DBG("No enabled do_not_disturb user"); ret = NOTIFICATION_ERROR_NONE; goto out; } if (!(result_uids = (uid_t *)malloc(sizeof(int) * row_count))) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc memory"); + ERR("Failed to alloc memory"); ret = NOTIFICATION_ERROR_OUT_OF_MEMORY; goto out; /* LCOV_EXCL_STOP */ @@ -600,7 +600,7 @@ int notification_get_dnd_and_allow_to_notify(const char *app_id, uid, tzplatform_getuid(TZ_SYS_GLOBALAPP_USER)); if (query_setting == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc memory"); + ERR("Failed to alloc memory"); ret = NOTIFICATION_ERROR_OUT_OF_MEMORY; goto out; /* LCOV_EXCL_STOP */ @@ -611,7 +611,7 @@ int notification_get_dnd_and_allow_to_notify(const char *app_id, NOTIFICATION_SYSTEM_SETTING_DB_TABLE, uid); if (query_system_setting == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc memory"); + ERR("Failed to alloc memory"); ret = NOTIFICATION_ERROR_OUT_OF_MEMORY; goto out; /* LCOV_EXCL_STOP */ @@ -620,14 +620,14 @@ int notification_get_dnd_and_allow_to_notify(const char *app_id, sql_ret = sqlite3_get_table(db, query_setting, &query_setting_result, &row_count, &col_count, NULL); if (sql_ret != SQLITE_OK && sql_ret != -1) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to get DB table [%d][%s]", sql_ret, query_setting); + ERR("Failed to get DB table [%d][%s]", sql_ret, query_setting); ret = NOTIFICATION_ERROR_FROM_DB; goto out; /* LCOV_EXCL_STOP */ } if (row_count == 0) { - NOTIFICATION_ERR("Invalid uid [%d] or app id [%s]", uid, app_id); + ERR("Invalid uid [%d] or app id [%s]", uid, app_id); ret = NOTIFICATION_ERROR_INVALID_PARAMETER; goto out; } @@ -639,14 +639,14 @@ int notification_get_dnd_and_allow_to_notify(const char *app_id, sql_ret = sqlite3_get_table(db, query_system_setting, &query_system_setting_result, &row_count, &col_count, NULL); if (sql_ret != SQLITE_OK && sql_ret != -1) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to get DB table [%d][%s]", sql_ret, query_setting); + ERR("Failed to get DB table [%d][%s]", sql_ret, query_setting); ret = NOTIFICATION_ERROR_FROM_DB; goto out; /* LCOV_EXCL_STOP */ } if (row_count == 0) { - NOTIFICATION_ERR("Invalid uid [%d]", uid); + ERR("Invalid uid [%d]", uid); ret = NOTIFICATION_ERROR_INVALID_PARAMETER; goto out; } @@ -687,7 +687,7 @@ EXPORT_API int notification_system_setting_load_dnd_allow_exception(dnd_allow_ex dnd_allow_exception_h dnd_allow_exception_data = NULL; if (dnd_allow_exception == NULL) { - NOTIFICATION_ERR("Invalid paramter"); /* LCOV_EXCL_LINE */ + ERR("Invalid paramter"); /* LCOV_EXCL_LINE */ return NOTIFICATION_ERROR_INVALID_PARAMETER; } @@ -699,7 +699,7 @@ EXPORT_API int notification_system_setting_load_dnd_allow_exception(dnd_allow_ex NOTIFICATION_DND_ALLOW_EXCEPTION, uid); if (query == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc memory"); + ERR("Failed to alloc memory"); ret = NOTIFICATION_ERROR_OUT_OF_MEMORY; goto out; /* LCOV_EXCL_STOP */ @@ -708,19 +708,19 @@ EXPORT_API int notification_system_setting_load_dnd_allow_exception(dnd_allow_ex sql_ret = sqlite3_get_table(db, query, &query_result, &row_count, &column_count, NULL); if (sql_ret != SQLITE_OK && sql_ret != -1) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to get DB table [%d][%s]", sql_ret, query); /* LCOV_EXCL_LINE */ + ERR("Failed to get DB table [%d][%s]", sql_ret, query); /* LCOV_EXCL_LINE */ ret = NOTIFICATION_ERROR_FROM_DB; goto out; /* LCOV_EXCL_STOP */ } if (!row_count) { - NOTIFICATION_DBG("No setting found"); /* LCOV_EXCL_LINE */ + DBG("No setting found"); /* LCOV_EXCL_LINE */ goto out; } else { dnd_allow_exception_data = (dnd_allow_exception_h)malloc(sizeof(struct notification_system_setting_dnd_allow_exception) * row_count); if (dnd_allow_exception_data == NULL) { - NOTIFICATION_ERR("Failed to alloc memory"); + ERR("Failed to alloc memory"); return NOTIFICATION_ERROR_OUT_OF_MEMORY; } @@ -766,7 +766,7 @@ int notification_system_setting_update_dnd_allow_exception(int type, int value, uid, type, value); if (query == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc memory"); + ERR("Failed to alloc memory"); ret = NOTIFICATION_ERROR_OUT_OF_MEMORY; goto out; /* LCOV_EXCL_STOP */ @@ -777,7 +777,7 @@ int notification_system_setting_update_dnd_allow_exception(int type, int value, goto out; if (num_changes == 0) - NOTIFICATION_WARN("No changes on DB"); + WARN("No changes on DB"); out: if (query) @@ -808,7 +808,7 @@ int noti_system_setting_get_do_not_disturb(int *do_not_disturb, uid_t uid) NOTIFICATION_SYSTEM_SETTING_DB_TABLE, uid); if (query == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to alloc memory"); + ERR("Failed to alloc memory"); ret = NOTIFICATION_ERROR_OUT_OF_MEMORY; goto out; /* LCOV_EXCL_STOP */ @@ -817,7 +817,7 @@ int noti_system_setting_get_do_not_disturb(int *do_not_disturb, uid_t uid) ret = sqlite3_get_table(db, query, &query_result, &row_count, &col_count, NULL); if (ret != SQLITE_OK && ret != -1) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to get DB table [%d][%s]", ret, query); + ERR("Failed to get DB table [%d][%s]", ret, query); ret = NOTIFICATION_ERROR_FROM_DB; goto out; /* LCOV_EXCL_STOP */ @@ -826,7 +826,7 @@ int noti_system_setting_get_do_not_disturb(int *do_not_disturb, uid_t uid) col_index = col_count; if (row_count == 0) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("No system setting found"); + ERR("No system setting found"); ret = NOTIFICATION_ERROR_INVALID_PARAMETER; /* LCOV_EXCL_STOP */ } else { @@ -867,7 +867,7 @@ int notification_setting_db_update_app_disabled(const char *app_id, bool value, NOTIFICATION_SETTING_DB_TABLE, value, app_id, uid); if (query == NULL) { - NOTIFICATION_ERR("Failed to alloc memory"); /* LCOV_EXCL_LINE */ + ERR("Failed to alloc memory"); /* LCOV_EXCL_LINE */ ret = NOTIFICATION_ERROR_OUT_OF_MEMORY; goto out; } diff --git a/src/notification_shared_file.c b/src/notification_shared_file.c index 9bf91e6..45367c6 100755 --- a/src/notification_shared_file.c +++ b/src/notification_shared_file.c @@ -42,7 +42,7 @@ #define __OOM_CHECK(value, ret_value, free_fun) \ do { \ if (value == NULL) { \ - NOTIFICATION_ERR("out of memory"); \ + ERR("out of memory"); \ free_fun; \ return ret_value; \ } \ @@ -84,7 +84,7 @@ static bool __make_sharing_dir(const char *dir) if (g_file_make_directory(noti_dir, NULL, &g_err) == false) { /* LCOV_EXCL_START */ if (g_err) { - NOTIFICATION_ERR("Failed to make sharing dir[%s]", + ERR("Failed to make sharing dir[%s]", g_err->message); g_error_free(g_err); } @@ -194,7 +194,7 @@ int notification_copy_private_file(const char *src_path, dst = g_file_new_for_path(dst_path); if (dst == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("dst path is wrong [%s]", dst_path); + ERR("dst path is wrong [%s]", dst_path); ret = NOTIFICATION_ERROR_IO_ERROR; goto out; /* LCOV_EXCL_STOP */ @@ -202,14 +202,14 @@ int notification_copy_private_file(const char *src_path, if (g_file_query_exists(dst, NULL) == true) { ret = NOTIFICATION_ERROR_ALREADY_EXIST_ID; - NOTIFICATION_INFO("dst path existed [%s]", dst_path); + INFO("dst path existed [%s]", dst_path); goto out; } src = g_file_new_for_path(src_path); if (src == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("src path is wrong [%s]", src_path); + ERR("src path is wrong [%s]", src_path); ret = NOTIFICATION_ERROR_IO_ERROR; goto out; /* LCOV_EXCL_STOP */ @@ -219,7 +219,7 @@ int notification_copy_private_file(const char *src_path, /* LCOV_EXCL_START */ NULL, NULL, NULL, &g_err)) { if (g_err) { - NOTIFICATION_ERR( + ERR( "Copying file from [%s] to [%s] is failed [%s]", src_path, dst_path, g_err->message); g_error_free(g_err); @@ -231,7 +231,7 @@ int notification_copy_private_file(const char *src_path, ut.modtime = time(NULL); if (g_utime(dst_path, &ut) != 0) - NOTIFICATION_DBG("Failed to set g_utime %d ", errno); + DBG("Failed to set g_utime %d ", errno); out: if (src) @@ -386,7 +386,7 @@ static void __make_file_info(char *src_path, char *dst_path, __free_file_info(file_info)); if (stat(dst_path, &stat_buf) != 0) - NOTIFICATION_ERR("Failed to get stat info"); + ERR("Failed to get stat info"); file_info->modification_time = stat_buf.st_mtime; *new_file_list = g_list_append(*new_file_list, file_info); @@ -394,7 +394,7 @@ static void __make_file_info(char *src_path, char *dst_path, file_info = (sharing_file_info_s *)tmp->data; if (stat(file_info->dst_path, &stat_buf) != 0) - NOTIFICATION_ERR("Failed to get stat info"); + ERR("Failed to get stat info"); if (file_info->modification_time != stat_buf.st_mtime) { dup_file_info = __dup_file_info(file_info); @@ -494,13 +494,13 @@ static char *__get_shared_dir(notification_h noti) path = noti->priv_vibration_path; if (path == NULL) { - NOTIFICATION_DBG("No private resource"); + DBG("No private resource"); return NULL; } index = __last_index_of(path, "/"); if (index == NULL) { - NOTIFICATION_ERR("Failed to find directory separator"); + ERR("Failed to find directory separator"); return NULL; } @@ -620,13 +620,13 @@ EXPORT_API void notification_add_private_sharing_target_id(pid_t pid, if (target_app == NULL) { app_id = notification_get_app_id_by_pid((int)pid); if (app_id == NULL) { - NOTIFICATION_ERR("Failed to get app id by pid"); + ERR("Failed to get app id by pid"); return; } target_info = (target_app_info_s *)calloc(1, sizeof(target_app_info_s)); if (target_info == NULL) { - NOTIFICATION_ERR("Failed to alloc memory"); + ERR("Failed to alloc memory"); free(app_id); return; } @@ -634,7 +634,7 @@ EXPORT_API void notification_add_private_sharing_target_id(pid_t pid, target_info->app_id = app_id; target_info->dbus_sender_name = strdup(sender); if (target_info->dbus_sender_name == NULL) { - NOTIFICATION_ERR("Failed to alloc memory"); + ERR("Failed to alloc memory"); free(target_info); free(app_id); return; @@ -656,7 +656,7 @@ char *notification_check_file_path_is_private(const char *pkg_id, size = smack_new_label_from_path(file_path, XATTR_NAME_SMACK, TRUE, &smack_label); if (size <= 0) { - NOTIFICATION_ERR("Failed to get smack info"); + ERR("Failed to get smack info"); return NULL; } @@ -667,7 +667,7 @@ char *notification_check_file_path_is_private(const char *pkg_id, if (dst_path == NULL && __is_private_file(smack_label, pkg_id)) { dst_path = strdup(file_path); if (dst_path == NULL) - NOTIFICATION_ERR("Failed to strdup"); + ERR("Failed to strdup"); } free(smack_label); @@ -756,7 +756,7 @@ EXPORT_API void notification_calibrate_private_sharing( free(updated_noti->sound_path); updated_noti->sound_path = strdup(source_noti->sound_path); if (updated_noti->sound_path == NULL) - NOTIFICATION_ERR("out of memory"); + ERR("out of memory"); } } @@ -767,7 +767,7 @@ EXPORT_API void notification_calibrate_private_sharing( updated_noti->vibration_path = strdup(source_noti->priv_vibration_path); if (updated_noti->vibration_path == NULL) - NOTIFICATION_ERR("out of memory"); + ERR("out of memory"); } } } @@ -794,7 +794,7 @@ int __set_sharing_for_new_target(sharing_req_data_s *req_data, app_info = strdup(target_info->app_id); if (app_info == NULL) { - NOTIFICATION_ERR("out of memory"); + ERR("out of memory"); goto out; } @@ -802,7 +802,7 @@ int __set_sharing_for_new_target(sharing_req_data_s *req_data, ret = security_manager_private_sharing_req_new(&handle); if (ret != SECURITY_MANAGER_SUCCESS) { ret = NOTIFICATION_ERROR_IO_ERROR; - NOTIFICATION_ERR("Failed to create PS handle"); + ERR("Failed to create PS handle"); goto out; } @@ -810,7 +810,7 @@ int __set_sharing_for_new_target(sharing_req_data_s *req_data, handle, req_data->app_id); if (ret != SECURITY_MANAGER_SUCCESS) { ret = NOTIFICATION_ERROR_IO_ERROR; - NOTIFICATION_ERR( + ERR( "Failed to set owner appid(%s) %d", req_data->app_id, ret); goto out; @@ -826,7 +826,7 @@ int __set_sharing_for_new_target(sharing_req_data_s *req_data, handle, (const char **)path_array, len); if (ret != SECURITY_MANAGER_SUCCESS) { ret = NOTIFICATION_ERROR_IO_ERROR; - NOTIFICATION_ERR("Failed to add paths %d", ret); + ERR("Failed to add paths %d", ret); goto out; } } @@ -835,7 +835,7 @@ int __set_sharing_for_new_target(sharing_req_data_s *req_data, handle, target_info->app_id); if (ret != SECURITY_MANAGER_SUCCESS) { ret = NOTIFICATION_ERROR_IO_ERROR; - NOTIFICATION_ERR("Failed to set target appid(%s)", + ERR("Failed to set target appid(%s)", (const char *)iter->data); goto out; } @@ -843,7 +843,7 @@ int __set_sharing_for_new_target(sharing_req_data_s *req_data, ret = security_manager_private_sharing_apply(handle); if (ret != SECURITY_MANAGER_SUCCESS) { ret = NOTIFICATION_ERROR_IO_ERROR; - NOTIFICATION_ERR("Failed to apply PS %d", ret); + ERR("Failed to apply PS %d", ret); goto out; } @@ -879,7 +879,7 @@ int __set_sharing_for_new_file(sharing_req_data_s *req_data, ret = security_manager_private_sharing_req_new(&handle); if (ret != SECURITY_MANAGER_SUCCESS) { ret = NOTIFICATION_ERROR_IO_ERROR; - NOTIFICATION_ERR("Failed to create private sharing request handle[%d]", ret); + ERR("Failed to create private sharing request handle[%d]", ret); goto out; } @@ -887,7 +887,7 @@ int __set_sharing_for_new_file(sharing_req_data_s *req_data, req_data->app_id); if (ret != SECURITY_MANAGER_SUCCESS) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to set owner appid[%s][%d]", + ERR("Failed to set owner appid[%s][%d]", req_data->app_id, ret); ret = NOTIFICATION_ERROR_IO_ERROR; goto out; @@ -898,7 +898,7 @@ int __set_sharing_for_new_file(sharing_req_data_s *req_data, (const char **)path_array, len); if (ret != SECURITY_MANAGER_SUCCESS) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to add paths [%d]", ret); + ERR("Failed to add paths [%d]", ret); ret = NOTIFICATION_ERROR_IO_ERROR; goto out; /* LCOV_EXCL_STOP */ @@ -911,7 +911,7 @@ int __set_sharing_for_new_file(sharing_req_data_s *req_data, handle, (const char *)iter->data); if (ret != SECURITY_MANAGER_SUCCESS) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to set target appid [%s]", + ERR("Failed to set target appid [%s]", (const char *)iter->data); ret = NOTIFICATION_ERROR_IO_ERROR; goto out; @@ -921,7 +921,7 @@ int __set_sharing_for_new_file(sharing_req_data_s *req_data, ret = security_manager_private_sharing_drop(handle); if (ret != SECURITY_MANAGER_SUCCESS) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to drop [%d]", ret); + ERR("Failed to drop [%d]", ret); ret = NOTIFICATION_ERROR_IO_ERROR; goto out; /* LCOV_EXCL_STOP */ @@ -935,7 +935,7 @@ int __set_sharing_for_new_file(sharing_req_data_s *req_data, (const char *)iter->data); if (ret != SECURITY_MANAGER_SUCCESS) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to set target appid [%s]", + ERR("Failed to set target appid [%s]", (const char *)iter->data); ret = NOTIFICATION_ERROR_IO_ERROR; goto out; @@ -945,7 +945,7 @@ int __set_sharing_for_new_file(sharing_req_data_s *req_data, ret = security_manager_private_sharing_apply(handle); if (ret != SECURITY_MANAGER_SUCCESS) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to apply PS [%d]", ret); + ERR("Failed to apply PS [%d]", ret); ret = NOTIFICATION_ERROR_IO_ERROR; goto out; /* LCOV_EXCL_STOP */ @@ -1051,7 +1051,7 @@ EXPORT_API int notification_set_private_sharing(notification_h noti, ret = NOTIFICATION_ERROR_IO_ERROR; goto out; } - NOTIFICATION_INFO("PS success priv id[%d] shared file count[%d] target app count[%d]", + INFO("PS success priv id[%d] shared file count[%d] target app count[%d]", noti->priv_id, g_list_length(req_data->shared_file_list), g_list_length(req_data->target_app_table)); @@ -1115,21 +1115,21 @@ EXPORT_API void notification_remove_private_sharing( if (g_list_length(req_data->target_app_table) > 0) { ret = security_manager_private_sharing_req_new(&handle); if (ret != SECURITY_MANAGER_SUCCESS) { - NOTIFICATION_ERR("Failed to create PS request handle"); + ERR("Failed to create PS request handle"); goto out; } ret = security_manager_private_sharing_req_set_owner_appid( handle, src_app_id); if (ret != SECURITY_MANAGER_SUCCESS) { - NOTIFICATION_ERR("Failed to set owner appid(%s) %d", + ERR("Failed to set owner appid(%s) %d", req_data->app_id, ret); goto out; } path_array = __convert_list_to_array(req_data->shared_file_list, &len); if (path_array == NULL) { - NOTIFICATION_ERR("path_array is null %d", + ERR("path_array is null %d", g_list_length(req_data->shared_file_list)); goto out; } @@ -1137,7 +1137,7 @@ EXPORT_API void notification_remove_private_sharing( ret = security_manager_private_sharing_req_add_paths(handle, (const char **)path_array, len); if (ret != SECURITY_MANAGER_SUCCESS) { - NOTIFICATION_ERR("Failed to add paths %d", ret); + ERR("Failed to add paths %d", ret); goto out; } @@ -1146,14 +1146,14 @@ EXPORT_API void notification_remove_private_sharing( ret = security_manager_private_sharing_req_set_target_appid( handle, (const char *)iter->data); if (ret != SECURITY_MANAGER_SUCCESS) { - NOTIFICATION_ERR("Failed to set target appid(%s)", + ERR("Failed to set target appid(%s)", (const char *)iter->data); goto out; } ret = security_manager_private_sharing_drop(handle); if (ret != SECURITY_MANAGER_SUCCESS) { - NOTIFICATION_ERR("Failed to drop %d", ret); + ERR("Failed to drop %d", ret); goto out; } } @@ -1162,7 +1162,7 @@ EXPORT_API void notification_remove_private_sharing( iter = req_data->shared_file_list; for (; iter != NULL; iter = g_list_next(iter)) { if (g_remove(((sharing_file_info_s *)(iter->data))->dst_path) != 0) - NOTIFICATION_ERR("Failed [%s] [%d]", + ERR("Failed [%s] [%d]", (const char *)iter->data, errno); } diff --git a/src/notification_status.c b/src/notification_status.c index a83e0fd..cb69bbc 100755 --- a/src/notification_status.c +++ b/src/notification_status.c @@ -57,14 +57,14 @@ static void __notification_status_message_dbus_callback(GDBusConnection *connect g_variant_get(parameters, "(&s)", &message); if (strlen(message) <= 0) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("message is NULL"); + ERR("message is NULL"); return; /* LCOV_EXCL_STOP */ } if (!md.callback) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("No callback"); + ERR("No callback"); return; /* LCOV_EXCL_STOP */ } @@ -84,7 +84,7 @@ int notification_status_monitor_message_cb_set(notification_status_message_cb ca md.conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error); if (md.conn == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to connect to the D-BUS Daemon[%s]", + ERR("Failed to connect to the D-BUS Daemon[%s]", error->message); g_error_free(error); return NOTIFICATION_ERROR_FROM_DBUS; @@ -105,7 +105,7 @@ int notification_status_monitor_message_cb_set(notification_status_message_cb ca NULL); if (md.message_id == 0) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to subscribe signal"); + ERR("Failed to subscribe signal"); g_object_unref(md.conn); return NOTIFICATION_ERROR_FROM_DBUS; /* LCOV_EXCL_STOP */ @@ -146,14 +146,14 @@ int notification_status_message_post(const char *message) int ret = NOTIFICATION_ERROR_NONE; if (!message) { - NOTIFICATION_ERR("message is NULL"); + ERR("message is NULL"); return NOTIFICATION_ERROR_INVALID_PARAMETER; } conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &err); if (conn == NULL) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to connect to the D-BUS Daemon[%s]", + ERR("Failed to connect to the D-BUS Daemon[%s]", err->message); ret = NOTIFICATION_ERROR_FROM_DBUS; goto end; @@ -170,7 +170,7 @@ int notification_status_message_post(const char *message) param, &err) == FALSE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to emit signal[%s]", + ERR("Failed to emit signal[%s]", err->message); ret = NOTIFICATION_ERROR_FROM_DBUS; goto end; @@ -179,7 +179,7 @@ int notification_status_message_post(const char *message) if (g_dbus_connection_flush_sync(conn, NULL, &err) == FALSE) { /* LCOV_EXCL_START */ - NOTIFICATION_ERR("Failed to flush connection sync[%s]", + ERR("Failed to flush connection sync[%s]", err->message); ret = NOTIFICATION_ERROR_FROM_DBUS; goto end; diff --git a/src/notification_viewer.c b/src/notification_viewer.c index f3e8b1a..5b841e1 100644 --- a/src/notification_viewer.c +++ b/src/notification_viewer.c @@ -32,14 +32,14 @@ EXPORT_API int notification_get_default_viewer(const char *path, char **default_ dictionary *dict = NULL; if (access(path, F_OK) != 0) { - NOTIFICATION_ERR("can't access file_path(%s)", path); + ERR("can't access file_path(%s)", path); return -1; } /* LCOV_EXCL_START */ dict = iniparser_load(path); if (!dict) { - NOTIFICATION_ERR("can't load file"); + ERR("can't load file"); return -1; } @@ -63,13 +63,13 @@ EXPORT_API int notification_launch_default_viewer(const char *default_viewer, b = bundle_create(); if (b == NULL) { - NOTIFICATION_ERR("Failed to create bundle"); + ERR("Failed to create bundle"); return NOTIFICATION_ERROR_OUT_OF_MEMORY; } ret = aul_svc_set_appid(b, default_viewer); if (ret != AUL_SVC_RET_OK) { - NOTIFICATION_ERR("Failed to set appid to bundle[%x]", ret); + ERR("Failed to set appid to bundle[%x]", ret); goto out; } @@ -77,7 +77,7 @@ EXPORT_API int notification_launch_default_viewer(const char *default_viewer, ret = aul_svc_add_data(b, "NOTIFICATION_PRIVATE_ID", buf); if (ret != AUL_SVC_RET_OK) { - NOTIFICATION_ERR("Failed to add extra_data[%x]", ret); + ERR("Failed to add extra_data[%x]", ret); goto out; } @@ -86,15 +86,15 @@ EXPORT_API int notification_launch_default_viewer(const char *default_viewer, ret = aul_svc_add_data(b, "NOTIFICATION_OP_TYPE", buf); if (ret != AUL_SVC_RET_OK) { - NOTIFICATION_ERR("Failed to add extra_data[%x]", ret); + ERR("Failed to add extra_data[%x]", ret); goto out; } ret = aul_svc_run_service_async_for_uid(b, 0, NULL, NULL, uid); if (ret < 0) { - NOTIFICATION_ERR("Failed to request app launch[%d]", ret); + ERR("Failed to request app launch[%d]", ret); } else { - NOTIFICATION_INFO("successed to request app launch[%d],[%d]", + INFO("successed to request app launch[%d],[%d]", ret, uid); ret = APP_CONTROL_ERROR_NONE; } -- 2.7.4