#ifndef _DLOG_H_
#include <stdio.h>
-#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)
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;
}
break;
default:
- NOTIFICATION_ERR("Invalid variable type. : %d",
- var_type);
+ ERR("Invalid variable type. : %d", var_type);
noti_err = NOTIFICATION_ERROR_INVALID_PARAMETER;
break;
}
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 (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') {
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;
}
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;
}
}
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;
}
}
}
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;
}
} 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 */
}
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;
}
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 */
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 */
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 */
/* 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 */
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;
}
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 */
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;
}
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. */
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 */
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 */
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;
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;
}
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 */
}
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;
}
notification_h noti = NULL;
if (template_name == NULL) {
- NOTIFICATION_ERR("Invalid parameter");
+ ERR("Invalid parameter");
set_last_result(NOTIFICATION_ERROR_INVALID_PARAMETER);
return NULL;
}
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 */
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;
}
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);
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;
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;
}
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 */
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 */
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;
}
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 */
}
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 */
}
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 */
}
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; \
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; \
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; \
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; \
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;
}
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;
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);
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);
return;
if (op_list == NULL) {
- NOTIFICATION_ERR("Invalid parameter");
+ ERR("Invalid parameter");
return;
}
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 */
}
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;
}
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 */
}
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);
}
char *caller_app_id;
if (tag == NULL) {
- NOTIFICATION_ERR("Invalid tag");
+ ERR("Invalid tag");
set_last_result(NOTIFICATION_ERROR_INVALID_PARAMETER);
return NULL;
}
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 */
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);
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;
}
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 */
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 */
}
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;
}
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;
}
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 */
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 */
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 */
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;
}
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 */
}
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 */
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;
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;
}
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);
}
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();
}
const gchar *name,
gpointer user_data)
{
- NOTIFICATION_INFO("name [%s]", name);
+ INFO("name [%s]", name);
}
/* LCOV_EXCL_STOP */
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);
}
/* 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();
}
__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);
}
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;
}
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;
}
}
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);
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 */
}
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;
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;
}
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 */
noti = notification_create(NOTIFICATION_TYPE_NOTI);
if (!noti) {
- NOTIFICATION_ERR("Failed to create notification handle");
+ ERR("Failed to create notification handle");
return;
}
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;
}
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);
}
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);
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 */
}
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;
}
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)
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;
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;
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;
/* 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);
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;
}
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 */
}
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;
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);
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 */
}
if (msg)
g_object_unref(msg);
- NOTIFICATION_DBG("Success to send async message");
+ DBG("Success to send async message");
return NOTIFICATION_ERROR_NONE;
}
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) {
/* 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);
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;
}
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) {
/* LCOV_EXCL_START */
- NOTIFICATION_ERR("cannot make gvariant");
+ ERR("cannot make gvariant");
return NOTIFICATION_ERROR_OUT_OF_MEMORY;
/* LCOV_EXCL_STOP */
}
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;
}
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) {
/* 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 */
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 */
}
if (reply)
g_object_unref(reply);
- NOTIFICATION_DBG("result[%d]", result);
+ DBG("result[%d]", result);
return result;
}
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 */
}
if (reply)
g_object_unref(reply);
- NOTIFICATION_DBG("result[%d]", result);
+ DBG("result[%d]", result);
return result;
}
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 */
}
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;
}
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 */
}
if (reply)
g_object_unref(reply);
- NOTIFICATION_DBG("tag[%s] result[%d]", tag, result);
+ DBG("tag[%s] result[%d]", tag, result);
return result;
}
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;
}
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 */
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;
}
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 */
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 */
}
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 */
if (reply)
g_object_unref(reply);
- NOTIFICATION_DBG("result[%d]", result);
+ DBG("result[%d]", result);
return result;
}
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;
}
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;
}
if (reply)
g_object_unref(reply);
- NOTIFICATION_DBG("result[%d]", result);
+ DBG("result[%d]", result);
return result;
}
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 */
}
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;
if (reply)
g_object_unref(reply);
- NOTIFICATION_DBG("result[%d]", result);
+ DBG("result[%d]", result);
return result;
}
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;
}
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;
if (reply)
g_object_unref(reply);
- NOTIFICATION_DBG("result[%d]", result);
+ DBG("result[%d]", result);
return result;
}
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 */
}
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 */
if (reply)
g_object_unref(reply);
- NOTIFICATION_DBG("result[%d]", result);
+ DBG("result[%d]", result);
return result;
}
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 */
}
if (reply)
g_object_unref(reply);
- NOTIFICATION_DBG("result[%d]", result);
+ DBG("result[%d]", result);
return result;
}
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 */
}
if (reply)
g_object_unref(reply);
- NOTIFICATION_DBG("result[%d]", result);
+ DBG("result[%d]", result);
return result;
}
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;
}
if (reply)
g_object_unref(reply);
- NOTIFICATION_DBG("result[%d]", result);
+ DBG("result[%d]", result);
return result;
}
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 */
}
if (reply)
g_object_unref(reply);
- NOTIFICATION_DBG("result[%d]", result);
+ DBG("result[%d]", result);
return result;
}
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 */
}
if (reply)
g_object_unref(reply);
- NOTIFICATION_DBG("result[%d]", result);
+ DBG("result[%d]", result);
return result;
}
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 */
}
if (reply)
g_object_unref(reply);
- NOTIFICATION_DBG("result[%d]", ret);
+ DBG("result[%d]", ret);
return ret;
}
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;
}
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 */
}
} 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;
}
if (reply)
g_object_unref(reply);
- NOTIFICATION_DBG("result[%d]", ret);
+ DBG("result[%d]", ret);
return ret;
}
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 */
}
if (reply)
g_object_unref(reply);
- NOTIFICATION_DBG("result[%d]", ret);
+ DBG("result[%d]", ret);
return ret;
}
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;
}
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;
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;
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;
}
int lock_screen_content_level;
if (noti_setting == NULL) {
- NOTIFICATION_ERR("Invalid setting handle");
+ ERR("Invalid setting handle");
return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
&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);
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,
&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);
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;
int value;
if (dnd_allow_exception == NULL) {
- NOTIFICATION_ERR("Invalid data");
+ ERR("Invalid data");
return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
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;
}
{
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);
{
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 */
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 */
}
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 */
}
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 */
}
/* 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 */
}
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 */
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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 */
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 */
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 */
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;
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 */
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;
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;
}
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;
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;
}
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;
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;
}
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;
}
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;
}
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;
}
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)
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;
}
}
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);
}
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 */
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;
char *query_where = NULL;
if (priv_id < 0 || noti == NULL) {
- NOTIFICATION_ERR("Invalid parameter");
+ ERR("Invalid parameter");
return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
char *query_where;
if (tag == NULL || noti == NULL) {
- NOTIFICATION_ERR("Invalid paramter");
+ ERR("Invalid paramter");
return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
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);
}
/* 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;
}
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;
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;
*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?
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;
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;
}
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;
}
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)
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 */
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;
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;
}
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;
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;
}
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);
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 */
}
if (app_id == NULL) {
/* LCOV_EXCL_START */
- NOTIFICATION_ERR("app_id is NULL");
+ ERR("app_id is NULL");
free(info);
return;
/* LCOV_EXCL_STOP */
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;
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;
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;
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;
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 */
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 */
}
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 */
}
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 */
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
if (query == NULL) {
/* LCOV_EXCL_START */
- NOTIFICATION_ERR("fail to alloc query");
+ ERR("fail to alloc query");
return false;
/* LCOV_EXCL_STOP */
}
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;
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;
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;
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;
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;
}
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 */
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:
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 */
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;
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 */
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 */
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 */
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 */
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 */
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 */
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;
}
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 */
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)
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 */
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 */
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 */
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
GList *list;
if (system_setting == NULL || value == NULL) {
- NOTIFICATION_ERR("Invalid parameter");
+ ERR("Invalid parameter");
return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
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;
}
GList *list = NULL;
if (system_setting == NULL) {
- NOTIFICATION_ERR("Invalid parameter");
+ ERR("Invalid parameter");
return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
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;
}
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;
}
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 {
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 */
}
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;
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;
}
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;
}
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 */
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 */
if (ret != NOTIFICATION_ERROR_NONE)
goto out;
- NOTIFICATION_DBG("Initialization is success.");
+ DBG("Initialization is success.");
out:
if (query_system_setting)
{
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 */
}
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 */
}
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);
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;
}
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 */
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;
}
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 */
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;
}
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 */
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;
}
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 */
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;
}
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 */
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 */
/* 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;
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;
}
goto out;
if (num_changes == 0)
- NOTIFICATION_WARN("No changes on DB");
+ WARN("No changes on DB");
out:
if (query)
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 */
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 */
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 */
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 */
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;
}
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;
}
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;
}
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 */
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;
}
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 */
goto out;
if (num_changes == 0)
- NOTIFICATION_WARN("No changes on DB");
+ WARN("No changes on DB");
out:
if (query)
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 */
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 */
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 {
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;
}
#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; \
} \
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);
}
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 */
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 */
/* 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);
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)
__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);
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);
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;
}
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;
}
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;
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;
}
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);
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");
}
}
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");
}
}
}
app_info = strdup(target_info->app_id);
if (app_info == NULL) {
- NOTIFICATION_ERR("out of memory");
+ ERR("out of memory");
goto out;
}
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;
}
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;
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;
}
}
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;
}
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;
}
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;
}
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;
(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 */
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;
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 */
(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;
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 */
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));
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;
}
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;
}
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;
}
}
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);
}
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 */
}
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;
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 */
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;
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;
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;
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;
}
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;
}
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;
}
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;
}