return NOTIFICATION_ERROR_NONE;
}
+/* LCOV_EXCL_START */
void notification_call_posted_toast_cb(const char *message)
{
if (posted_toast_message_cb != NULL)
posted_toast_message_cb((void *)message);
}
+/* LCOV_EXCL_STOP */
EXPORT_API int notification_set_ongoing_flag(notification_h noti, bool ongoing_flag)
{
char *query = NULL;
const char *db_path = tzplatform_getenv(TZ_SYS_DB);
if (db_path == NULL) {
- NOTIFICATION_ERR("fail to get db_path");
+ NOTIFICATION_ERR("fail to get db_path"); /* LCOV_EXCL_LINE */
return NOTIFICATION_ERROR_OUT_OF_MEMORY;
}
snprintf(defname, sizeof(defname), "%s/%s", db_path, NOTIFICATION_DB_NAME);
NOTIFICATION_DBG("db path : %s", defname);
r = sqlite3_open_v2(defname, &db, SQLITE_OPEN_CREATE | SQLITE_OPEN_READWRITE, NULL);
if (r) {
+ /* LCOV_EXCL_START */
db_util_close(db);
NOTIFICATION_ERR("fail to open notification db %d", r);
return NOTIFICATION_ERROR_IO_ERROR;
+ /* LCOV_EXCL_STOP */
}
query = sqlite3_mprintf(CREATE_NOTIFICATION_TABLE, tzplatform_getuid(TZ_SYS_DEFAULT_USER));
NOTIFICATION_DBG("@@@ query : %s", query);
if (query)
sqlite3_free(query);
if (r != SQLITE_OK) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("query error(%d)(%s)", r, errmsg);
sqlite3_free(errmsg);
db_util_close(db);
return NOTIFICATION_ERROR_IO_ERROR;
+ /* LCOV_EXCL_STOP */
}
db_util_close(db);
ret = db_util_open(dbfile, &db, 0);
if (ret != SQLITE_OK) {
+ /* LCOV_EXCL_START */
if (ret == SQLITE_PERM)
set_last_result(NOTIFICATION_ERROR_PERMISSION_DENIED);
else
set_last_result(NOTIFICATION_ERROR_FROM_DB);
return NULL;
+ /* LCOV_EXCL_STOP */
}
return db;
ret = db_util_close(*db);
if (ret != SQLITE_OK) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("DB close error(%d)", ret);
return NOTIFICATION_ERROR_FROM_DB;
+ /* LCOV_EXCL_STOP */
}
*db = NULL;
ret = sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL);
if (ret != SQLITE_OK) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("DB err(%d) : %s", ret,
sqlite3_errmsg(db));
return NOTIFICATION_ERROR_FROM_DB;
+ /* LCOV_EXCL_STOP */
}
if (stmt != NULL) {
sqlite3_finalize(stmt);
} else {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("DB err(%d) : %s", ret,
sqlite3_errmsg(db));
sqlite3_finalize(stmt);
return NOTIFICATION_ERROR_FROM_DB;
+ /* LCOV_EXCL_STOP */
}
} else {
return NOTIFICATION_ERROR_FROM_DB;
}
/* LCOV_EXCL_STOP */
+/* LCOV_EXCL_START */
EXPORT_API notification_h notification_load(char *pkgname,
int priv_id)
{
return notification_load_for_uid(pkgname, priv_id, getuid());
}
+/* LCOV_EXCL_STOP */
/* LCOV_EXCL_START */
EXPORT_API notification_h notification_new(notification_type_e type,
return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
+/* LCOV_EXCL_START */
EXPORT_API int notification_is_service_ready(void)
{
return notification_ipc_is_master_ready();
}
+/* LCOV_EXCL_STOP */
EXPORT_API int notification_set_uid(notification_h noti,
uid_t uid)
caller_pkgname = notification_get_pkgname_by_pid();
if (!caller_pkgname) {
+ /* LCOV_EXCL_START */
NOTIFICATION_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");
set_last_result(NOTIFICATION_ERROR_OUT_OF_MEMORY);
free(caller_pkgname);
return NULL;
+ /* LCOV_EXCL_STOP */
}
ret = notification_ipc_request_load_noti_by_tag(noti, caller_pkgname, (char *)tag, uid);
return ret;
}
+/* LCOV_EXCL_START */
int notification_ipc_is_master_ready(void)
{
GVariant *result;
return is_master_started;
}
+/* LCOV_EXCL_STOP */
/* TODO: dbus activation isn't enough ? */
/*
return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
+/* LCOV_EXCL_START */
static void _do_deffered_task(void)
{
task_list *list_do;
list_do = list_temp;
}
}
+/* LCOV_EXCL_STOP */
/*!
* functions to create operation list
return bundle_decode(string, strlen((char *)string));
}
+/* LCOV_EXCL_START */
static void _add_noti_notify(GVariant *parameters)
{
notification_h noti;
}
notification_free(noti);
}
+/* LCOV_EXCL_STOP */
+/* LCOV_EXCL_START */
static void _update_noti_notify(GVariant *parameters)
{
notification_h noti;
}
notification_free(noti);
}
+/* LCOV_EXCL_STOP */
+/* LCOV_EXCL_START */
static void _refresh_noti_notify(GVariant *parameters)
{
notification_op *noti_op = _ipc_create_op(NOTIFICATION_OP_REFRESH, 1, NULL, 0, NULL);
free(noti_op);
}
}
+/* LCOV_EXCL_STOP */
+/* LCOV_EXCL_START */
static void _delete_single_notify(GVariant *parameters)
{
int num_deleted;
free(noti_op);
}
}
+/* LCOV_EXCL_STOP */
+/* LCOV_EXCL_START */
static void _delete_multiple_notify(GVariant *parameters)
{
int buf[100] = {0,};
notification_call_changed_cb(noti_op, idx);
free(noti_op);
}
+/* LCOV_EXCL_STOP */
+/* LCOV_EXCL_START */
static void _handle_noti_notify(GDBusConnection *connection,
const gchar *sender_name,
const gchar *object_path,
else if (g_strcmp0(signal_name, "refresh_noti_notify") == 0)
_refresh_noti_notify(parameters);
}
+/* LCOV_EXCL_STOP */
static int _dbus_signal_init()
NOTIFICATION_DBG("subscribe id : %d", id);
if (id == 0) {
+ /* LCOV_EXCL_START */
ret = NOTIFICATION_ERROR_IO_ERROR;
NOTIFICATION_ERR("Failed to _register_noti_dbus_interface");
+ /* LCOV_EXCL_STOP */
} else {
monitor_id = id;
ret = NOTIFICATION_ERROR_NONE;
PROVIDER_NOTI_INTERFACE_NAME,
cmd);
if (!msg) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("Can't allocate new method call");
if (body)
g_variant_unref(body);
return NOTIFICATION_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
if (body != NULL)
g_object_unref(msg);
if (!*reply) {
+ /* LCOV_EXCL_START */
ret = NOTIFICATION_ERROR_SERVICE_NOT_READY;
if (err != NULL) {
NOTIFICATION_ERR("No reply. cmd = %s, error = %s", cmd, err->message);
g_error_free(err);
}
return ret;
+ /* LCOV_EXCL_STOP */
}
if (g_dbus_message_to_gerror(*reply, &err)) {
&err);
if (!reply) {
+ /* LCOV_EXCL_START */
if (err != NULL) {
NOTIFICATION_ERR("No reply. error = %s", err->message);
g_error_free(err);
}
result = NOTIFICATION_ERROR_SERVICE_NOT_READY;
+ /* LCOV_EXCL_STOP */
} else if (g_dbus_message_to_gerror(reply, &err)) {
+ /* LCOV_EXCL_START */
if (err->code == G_DBUS_ERROR_ACCESS_DENIED)
result = NOTIFICATION_ERROR_PERMISSION_DENIED;
else
NOTIFICATION_ERR("_send_async_noti error %s", err->message);
g_error_free(err);
+ /* LCOV_EXCL_STOP */
}
NOTIFICATION_DBG("_send_async_noti done !![%d]", result);
PROVIDER_NOTI_INTERFACE_NAME,
cmd);
if (!msg) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("Can't allocate new method call");
return NOTIFICATION_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
if (body != NULL)
_print_noti(noti);
body = notification_ipc_make_gvariant_from_noti(noti, false);
if (body == NULL) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("cannot make gvariant");
return NOTIFICATION_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
result = _send_sync_noti(body, &reply, "add_noti");
result = _dbus_init();
if (result != NOTIFICATION_ERROR_NONE) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("Can't init dbus %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");
return NOTIFICATION_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
result = _send_sync_noti(body, &reply, "update_noti");
result = _dbus_init();
if (result != NOTIFICATION_ERROR_NONE) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("Can't init dbus %d", result);
return result;
+ /* LCOV_EXCL_STOP */
}
cb_item = calloc(1, sizeof(result_cb_item));
body = notification_ipc_make_gvariant_from_noti(noti, false);
if (body == NULL) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("cannot make gvariant");
free(cb_item);
return NOTIFICATION_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
result = _send_async_noti(body, cb_item, "update_noti");
NOTIFICATION_DBG("notification_ipc_request_update_async done [result: %d]", result);
if (result != NOTIFICATION_ERROR_NONE) {
+ /* LCOV_EXCL_START */
free(cb_item);
cb_item = NULL;
+ /* LCOV_EXCL_STOP */
}
g_variant_unref(body);
return result;
}
+/* LCOV_EXCL_START */
int notification_ipc_request_load_noti_by_priv_id(notification_h noti, const char *pkgname, int priv_id, uid_t uid)
{
int result;
NOTIFICATION_DBG("notification_ipc_request_load_noti_by_priv_id done [result: %d]", result);
return result;
}
+/* LCOV_EXCL_STOP */
+/* LCOV_EXCL_START */
int notification_ipc_request_get_count(notification_type_e type,
const char *pkgname, int group_id, int priv_id, int *count, uid_t uid)
{
NOTIFICATION_DBG("notification_ipc_request_get_count done [result: %d]", result);
return result;
}
+/* LCOV_EXCL_STOP */
int notification_ipc_request_load_noti_grouping_list(notification_type_e type, int count,
notification_list_h *list, uid_t uid)
return _send_service_register(uid);
}
+/* LCOV_EXCL_START */
static void _on_name_appeared(GDBusConnection *connection,
const gchar *name,
const gchar *name_owner,
/* TODO: dbus activation isn't enough ? */
_do_deffered_task();
}
+/* LCOV_EXCL_STOP */
+/* LCOV_EXCL_START */
static void _on_name_vanished(GDBusConnection *connection,
const gchar *name,
gpointer user_data)
NOTIFICATION_DBG("name vanished [%d] : %s", uid, name);
is_master_started = 0;
}
+/* LCOV_EXCL_STOP */
int notification_ipc_monitor_init(uid_t uid)
{
ret = _dbus_init();
if (ret != NOTIFICATION_ERROR_NONE) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("Can't init dbus %d", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = _dbus_signal_init();
if (ret != NOTIFICATION_ERROR_NONE) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("Can't signal_init %d", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
ret = _ipc_monitor_register(uid);
if (ret != NOTIFICATION_ERROR_NONE) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("Can't init ipc_monitor_register %d", ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
if (provider_monitor_id == 0) {
NULL);
if (provider_monitor_id == 0) {
+ /* LCOV_EXCL_START */
g_dbus_connection_signal_unsubscribe(_gdbus_conn, monitor_id);
monitor_id = 0;
NOTIFICATION_ERR("watch on name fail");
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("NO MEMORY");
return NULL;
+ /* LCOV_EXCL_STOP */
}
list->prev = NULL;
new_list = _notification_list_create();
if (new_list == NULL) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("NO MEMORY");
set_last_result(NOTIFICATION_ERROR_OUT_OF_MEMORY);
return NULL;
+ /* LCOV_EXCL_STOP */
}
cur_list->next = new_list;
} else {
cur_list = _notification_list_create();
if (cur_list == NULL) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("NO MEMORY");
set_last_result(NOTIFICATION_ERROR_OUT_OF_MEMORY);
return NULL;
+ /* LCOV_EXCL_STOP */
}
new_list = cur_list;
return ret;
}
+/* LCOV_EXCL_START */
EXPORT_API int notification_noti_get_by_priv_id(notification_h noti, char *pkgname, int priv_id, uid_t uid)
{
int ret = 0;
return ret;
}
+/* LCOV_EXCL_STOP */
EXPORT_API int notification_noti_get_by_tag(notification_h noti, char *pkgname, char* tag, uid_t uid)
{
return ret;
}
+/* LCOV_EXCL_START */
EXPORT_API int notification_noti_delete_by_priv_id(const char *pkgname, int priv_id)
{
sqlite3 *db = NULL;
return ret;
}
+/* LCOV_EXCL_STOP */
EXPORT_API int notification_noti_delete_by_priv_id_get_changes(const char *pkgname, int priv_id, int *num_changes, uid_t uid)
{
}
/* todo refactoring */
+/* LCOV_EXCL_START */
EXPORT_API int notification_noti_get_count(notification_type_e type,
const char *pkgname,
int group_id, int priv_id,
return ret;
}
+/* LCOV_EXCL_STOP */
EXPORT_API int notification_noti_get_grouping_list(notification_type_e type,
int count,
info = calloc(1, sizeof(struct ongoing_info_s));
if (info == NULL) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("Out of memory");
return;
+ /* LCOV_EXCL_STOP */
}
if (g_strcmp0(signal_name, MEMBER_PROGRESS) == 0) {
}
if (pkgname == NULL) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("pkgname is null");
free(info);
return;
+ /* LCOV_EXCL_STOP */
}
info->pkgname = pkgname;
conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &err);
if (conn == NULL) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("g_bus_get_sync() failed: %s", err->message);
ret = NOTIFICATION_ERROR_FROM_DBUS;
goto end;
+ /* LCOV_EXCL_STOP */
}
if (g_dbus_connection_emit_signal(conn,
signal_name,
param,
&err) == FALSE) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("g_dbus_connection_emit_signal() failed: %s",
err->message);
ret = NOTIFICATION_ERROR_FROM_DBUS;
goto end;
+ /* LCOV_EXCL_STOP */
}
if (g_dbus_connection_flush_sync(conn, NULL, &err) == FALSE) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("g_dbus_connection_flush_sync() failed: %s",
err->message);
ret = NOTIFICATION_ERROR_FROM_DBUS;
goto end;
+ /* LCOV_EXCL_STOP */
}
if (od.conn == NULL) {
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",
error->message);
g_error_free(error);
return NOTIFICATION_ERROR_FROM_DBUS;
+ /* LCOV_EXCL_STOP */
}
}
NULL,
NULL);
if (od.subscribe_id == 0) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("g_dbus_connection_signal_subscribe() failed");
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("notification_ongoing_update_progress failed %d",
ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
return NOTIFICATION_ERROR_NONE;
ret = __send_ongoing_update_signal(MEMBER_SIZE, param);
if (ret != NOTIFICATION_ERROR_NONE) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("notification_ongoing_update_size failed %d",
ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
return NOTIFICATION_ERROR_NONE;
ret = __send_ongoing_update_signal(MEMBER_CONTENT, param);
if (ret != NOTIFICATION_ERROR_NONE) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("notification_ongoing_update_content failed %d",
ret);
return ret;
+ /* LCOV_EXCL_STOP */
}
return NOTIFICATION_ERROR_NONE;
}
return ret;
}
+/* LCOV_EXCL_START */
EXPORT_API int notification_setting_get_setting_by_package_name(const char *package_name, notification_setting_h *setting)
{
return notification_setting_get_setting_by_package_name_for_uid(package_name, setting, getuid());
}
+/* LCOV_EXCL_STOP */
+/* LCOV_EXCL_START */
EXPORT_API int notification_setting_get_setting(notification_setting_h *setting)
{
int ret;
return ret;
}
+/* LCOV_EXCL_STOP */
EXPORT_API int notification_setting_get_package_name(notification_setting_h setting, char **value)
{
return err;
}
+/* LCOV_EXCL_START */
bool privilege_info_cb(const char *privilege_name, void *user_data)
{
bool *found = user_data;
return true;
}
+/* LCOV_EXCL_STOP */
EXPORT_API int notification_setting_insert_package_for_uid(const char *package_id, uid_t uid)
{
}
sqlite3_exec(db, "BEGIN immediate;", NULL, NULL, NULL);
-
sqlret = sqlite3_prepare_v2(db, "INSERT OR REPLACE INTO notification_system_setting (uid, do_not_disturb, visibility_class) values(?, ?, ?);", -1, &db_statement, NULL);
if (sqlret != SQLITE_OK) {
static int _get_table_field_data_int(char **table, int *buf, int index)
{
if ((table == NULL) || (buf == NULL) || (index < 0)) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("table[%p], buf[%p], index[%d]", table, buf, index);
return false;
+ /* LCOV_EXCL_STOP */
}
if (table[index] != NULL) {
return true;
}
+ /* LCOV_EXCL_START */
*buf = 0;
return false;
+ /* LCOV_EXCL_STOP */
}
static int _get_table_field_data_string(char **table, char **buf, int ucs2, int index)
int ret = false;
if ((table == NULL) || (buf == NULL) || (index < 0)) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("table[%p], buf[%p], index[%d]", table, buf, index);
return false;
+ /* LCOV_EXCL_STOP */
}
char *pTemp = table[index];
int sLen = 0;
if (pTemp == NULL) {
- *buf = NULL;
+ *buf = NULL; /* LCOV_EXCL_LINE */
} else {
sLen = strlen(pTemp);
if (sLen) {
*buf = (char *) malloc(sLen + 1);
if (*buf == NULL) {
- NOTIFICATION_ERR("malloc is failed");
+ NOTIFICATION_ERR("malloc is failed"); /* LCOV_EXCL_LINE */
goto out;
}
memset(*buf, 0, sLen + 1);
strncpy(*buf, pTemp, sLen);
} else {
- *buf = NULL;
+ *buf = NULL; /* LCOV_EXCL_LINE */
}
}
notification_setting_h result_setting_array = NULL;
if (package_name == NULL || setting == NULL) {
- NOTIFICATION_ERR("NOTIFICATION_ERROR_INVALID_PARAMETER");
+ NOTIFICATION_ERR("NOTIFICATION_ERROR_INVALID_PARAMETER"); /* LCOV_EXCL_LINE */
err = NOTIFICATION_ERROR_INVALID_PARAMETER;
goto out;
}
sql_return = db_util_open(DBPATH, &local_db_handle, 0);
if (sql_return != SQLITE_OK || local_db_handle == NULL) {
- NOTIFICATION_ERR("db_util_open failed [%d]", sql_return);
+ NOTIFICATION_ERR("db_util_open failed [%d]", sql_return); /* LCOV_EXCL_LINE */
err = NOTIFICATION_ERROR_FROM_DB;
goto out;
}
"WHERE package_name = %Q AND uid = %d", NOTIFICATION_SETTING_DB_TABLE, package_name, uid);
if (!sql_query) {
- NOTIFICATION_ERR("fail to alloc query");
+ NOTIFICATION_ERR("fail to alloc query"); /* LCOV_EXCL_LINE */
err = NOTIFICATION_ERROR_OUT_OF_MEMORY;
goto out;
}
sql_return = sqlite3_get_table(local_db_handle, sql_query, &query_result, &row_count, &column_count, NULL);
if (sql_return != SQLITE_OK && sql_return != -1) {
- NOTIFICATION_ERR("sqlite3_get_table failed [%d][%s]", sql_return, sql_query);
+ NOTIFICATION_ERR("sqlite3_get_table failed [%d][%s]", sql_return, sql_query); /* LCOV_EXCL_LINE */
err = NOTIFICATION_ERROR_FROM_DB;
goto out;
}
if (!row_count) {
- NOTIFICATION_DBG("No setting found for [%s]", package_name);
+ NOTIFICATION_DBG("No setting found for [%s]", package_name); /* LCOV_EXCL_LINE */
err = NOTIFICATION_ERROR_NOT_EXIST_ID;
goto out;
}
row_count = 1;
if (!(result_setting_array = (struct notification_setting *)malloc(sizeof(struct notification_setting) * row_count))) {
- NOTIFICATION_ERR("malloc failed...");
+ NOTIFICATION_ERR("malloc failed..."); /* LCOV_EXCL_LINE */
err = NOTIFICATION_ERROR_OUT_OF_MEMORY;
goto out;
}
if (local_db_handle) {
sql_return = db_util_close(local_db_handle);
if (sql_return != SQLITE_OK)
- NOTIFICATION_WARN("fail to db_util_close - [%d]", sql_return);
+ NOTIFICATION_WARN("fail to db_util_close - [%d]", sql_return); /* LCOV_EXCL_LINE */
}
return err;
notification_setting_h result_setting_array = NULL;
if (setting_array == NULL || count == NULL) {
- NOTIFICATION_ERR("NOTIFICATION_ERROR_INVALID_PARAMETER");
+ NOTIFICATION_ERR("NOTIFICATION_ERROR_INVALID_PARAMETER"); /* LCOV_EXCL_LINE */
err = NOTIFICATION_ERROR_INVALID_PARAMETER;
goto out;
}
sql_return = db_util_open(DBPATH, &local_db_handle, 0);
if (sql_return != SQLITE_OK || local_db_handle == NULL) {
- NOTIFICATION_ERR("db_util_open failed [%d]", sql_return);
+ NOTIFICATION_ERR("db_util_open failed [%d]", sql_return); /* LCOV_EXCL_LINE */
err = NOTIFICATION_ERROR_FROM_DB;
goto out;
}
"ORDER BY package_name", NOTIFICATION_SETTING_DB_TABLE, uid);
if (!sql_query) {
- NOTIFICATION_ERR("fail to alloc query");
+ NOTIFICATION_ERR("fail to alloc query"); /* LCOV_EXCL_LINE */
err = NOTIFICATION_ERROR_OUT_OF_MEMORY;
goto out;
}
sql_return = sqlite3_get_table(local_db_handle, sql_query, &query_result, &row_count, &column_count, NULL);
if (sql_return != SQLITE_OK && sql_return != -1) {
- NOTIFICATION_ERR("NOTIFICATION_ERROR_FROM_DB failed [%d][%s]", sql_return, sql_query);
+ NOTIFICATION_ERR("NOTIFICATION_ERROR_FROM_DB failed [%d][%s]", sql_return, sql_query); /* LCOV_EXCL_LINE */
err = NOTIFICATION_ERROR_FROM_DB;
goto out;
}
if (!row_count) {
- NOTIFICATION_DBG("No setting found...");
+ NOTIFICATION_DBG("No setting found..."); /* LCOV_EXCL_LINE */
err = NOTIFICATION_ERROR_NOT_EXIST_ID;
goto out;
}
NOTIFICATION_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))) {
- NOTIFICATION_ERR("malloc failed...");
+ NOTIFICATION_ERR("malloc failed..."); /* LCOV_EXCL_LINE */
err = NOTIFICATION_ERROR_OUT_OF_MEMORY;
goto out;
}
if (local_db_handle) {
sql_return = db_util_close(local_db_handle);
if (sql_return != SQLITE_OK)
- NOTIFICATION_WARN("fail to db_util_close - [%d]", sql_return);
+ NOTIFICATION_WARN("fail to db_util_close - [%d]", sql_return); /* LCOV_EXCL_LINE */
}
return err;
notification_system_setting_h result_system_setting = NULL;
if (system_setting == NULL) {
- NOTIFICATION_ERR("NOTIFICATION_ERROR_INVALID_PARAMETER");
+ NOTIFICATION_ERR("NOTIFICATION_ERROR_INVALID_PARAMETER"); /* LCOV_EXCL_LINE */
err = NOTIFICATION_ERROR_INVALID_PARAMETER;
goto out;
}
sql_return = db_util_open(DBPATH, &local_db_handle, 0);
if (sql_return != SQLITE_OK || local_db_handle == NULL) {
- NOTIFICATION_ERR("db_util_open failed [%d]", sql_return);
+ NOTIFICATION_ERR("db_util_open failed [%d]", sql_return); /* LCOV_EXCL_LINE */
err = NOTIFICATION_ERROR_FROM_DB;
goto out;
}
"FROM %s WHERE uid = %d", NOTIFICATION_SYSTEM_SETTING_DB_TABLE, uid);
if (!sql_query) {
- NOTIFICATION_ERR("fail to alloc query");
+ NOTIFICATION_ERR("fail to alloc query"); /* LCOV_EXCL_LINE */
err = NOTIFICATION_ERROR_OUT_OF_MEMORY;
goto out;
}
sql_return = sqlite3_get_table(local_db_handle, sql_query, &query_result, &row_count, &column_count, NULL);
if (sql_return != SQLITE_OK && sql_return != -1) {
- NOTIFICATION_ERR("sqlite3_get_table failed [%d][%s]", sql_return, sql_query);
+ NOTIFICATION_ERR("sqlite3_get_table failed [%d][%s]", sql_return, sql_query); /* LCOV_EXCL_LINE */
err = NOTIFICATION_ERROR_FROM_DB;
goto out;
}
NOTIFICATION_DBG("row_count [%d] column_count [%d]", row_count, column_count);
if (!(result_system_setting = (struct notification_system_setting *)malloc(sizeof(struct notification_system_setting)))) {
- NOTIFICATION_ERR("malloc failed...");
+ NOTIFICATION_ERR("malloc failed..."); /* LCOV_EXCL_LINE */
err = NOTIFICATION_ERROR_OUT_OF_MEMORY;
goto out;
}
/* no system setting record. allow everyting */
if (!row_count) {
- NOTIFICATION_DBG("No setting found...");
+ NOTIFICATION_DBG("No setting found..."); /* LCOV_EXCL_LINE */
result_system_setting->do_not_disturb = 0;
result_system_setting->visibility_class = 0;
} else {
+ /* LCOV_EXCL_START */
col_index = column_count;
_get_table_field_data_int(query_result, (int *)&(result_system_setting->do_not_disturb), col_index++);
_get_table_field_data_int(query_result, &(result_system_setting->visibility_class), col_index++);
+ /* LCOV_EXCL_STOP */
}
*system_setting = result_system_setting;
if (local_db_handle) {
sql_return = db_util_close(local_db_handle);
if (sql_return != SQLITE_OK)
- NOTIFICATION_WARN("fail to db_util_close - [%d]", sql_return);
+ NOTIFICATION_WARN("fail to db_util_close - [%d]", sql_return); /* LCOV_EXCL_LINE */
}
return err;
g_variant_get(parameters, "(&s)", &message);
if (strlen(message) <= 0) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("message has only NULL");
return;
+ /* LCOV_EXCL_STOP */
}
if (!md.callback) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("no callback");
return;
+ /* LCOV_EXCL_STOP */
}
md.callback(message, md.data);
if (md.conn == NULL) {
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",
error->message);
g_error_free(error);
return NOTIFICATION_ERROR_FROM_DBUS;
+ /* LCOV_EXCL_STOP */
}
}
NULL,
NULL);
if (md.message_id == 0) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("g_dbus_connection_signal_subscribe() failed.");
g_object_unref(md.conn);
return NOTIFICATION_ERROR_FROM_DBUS;
+ /* LCOV_EXCL_STOP */
}
}
conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &err);
if (conn == NULL) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("g_bus_get_sync() failed: %s", err->message);
ret = NOTIFICATION_ERROR_FROM_DBUS;
goto end;
+ /* LCOV_EXCL_STOP */
}
param = g_variant_new("(s)", message);
MEMBER_NAME,
param,
&err) == FALSE) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("g_dbus_connection_emit_signal() failed: %s",
err->message);
return NOTIFICATION_ERROR_FROM_DBUS;
goto end;
+ /* LCOV_EXCL_STOP */
}
if (g_dbus_connection_flush_sync(conn, NULL, &err) == FALSE) {
+ /* LCOV_EXCL_START */
NOTIFICATION_ERR("g_dbus_connection_flush_sync() failed: %s",
err->message);
return NOTIFICATION_ERROR_FROM_DBUS;
goto end;
+ /* LCOV_EXCL_STOP */
}
end:
if (err)
- g_error_free(err);
+ g_error_free(err); /* LCOV_EXCL_LINE */
if (conn)
g_object_unref(conn);