#include <dbus/dbus.h>
#include <dbus/dbus-glib-lowlevel.h>
+#include <app_control.h>
+#include <app_control_internal.h>
#include <aul.h>
#include <ail.h>
#include <appsvc.h>
/* Check noti and image_path are valid data */
if (noti == NULL || image_path == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Check image type is valid type */
if (type <= NOTIFICATION_IMAGE_TYPE_NONE
|| type >= NOTIFICATION_IMAGE_TYPE_MAX) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Check image path bundle is exist */
/* Check noti and image_path is valid data */
if (noti == NULL || image_path == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Check image type is valid data */
if (type <= NOTIFICATION_IMAGE_TYPE_NONE
|| type >= NOTIFICATION_IMAGE_TYPE_MAX) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Check image path bundle exist */
{
/* Check noti is valid data */
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (input_time == 0) {
{
/* Check noti and time is valid data */
if (noti == NULL || ret_time == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Set time infomation */
{
/* Check noti and ret_time is valid data */
if (noti == NULL || ret_time == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Set insert time information */
/* Check noti is valid data */
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Check text type is valid type */
if (type <= NOTIFICATION_TEXT_TYPE_NONE
|| type >= NOTIFICATION_TEXT_TYPE_MAX) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Check text bundle exist */
default:
NOTIFICATION_ERR("Error. invalid variable type. : %d",
var_type);
- noti_err = NOTIFICATION_ERROR_INVALID_DATA;
+ noti_err = NOTIFICATION_ERROR_INVALID_PARAMETER;
break;
}
/* Check noti is valid data */
if (noti == NULL || text == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Check text type is valid type */
if (type <= NOTIFICATION_TEXT_TYPE_NONE
|| type >= NOTIFICATION_TEXT_TYPE_MAX) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Check key */
{
/* check noti and domain is valid data */
if (noti == NULL || domain == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Check domain */
{
/* Check noti is valid data */
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Get domain */
char buf_tag[512] = { 0, };
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (time <= 0) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
snprintf(buf, sizeof(buf), "%lu", time);
notification_error_e ret = NOTIFICATION_ERROR_NONE;
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (time == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
char *ret_text = NULL;
ret = notification_get_text(noti, type, &ret_text);
if (ret != NOTIFICATION_ERROR_NONE || ret_text == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (notification_noti_get_tag_type(ret_text) == TAG_TYPE_INVALID) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
char *tag_value = NULL;
tag_value = notification_noti_strip_tag(ret_text);
if (tag_value == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
*time = atol(tag_value);
{
/* Check noti is valid data */
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Check type is valid */
if (type < NOTIFICATION_SOUND_TYPE_NONE
|| type >= NOTIFICATION_SOUND_TYPE_MAX) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Save sound type */
{
/* check noti and type is valid data */
if (noti == NULL || type == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Set sound type */
{
/* Check noti is valid data */
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Check type is valid */
if (type < NOTIFICATION_VIBRATION_TYPE_NONE
|| type >= NOTIFICATION_VIBRATION_TYPE_MAX) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Save vibration type */
{
/* check noti and type is valid data */
if (noti == NULL || type == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Set vibration type */
{
/* Check noti is valid data */
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Check operation is valid */
if (operation < NOTIFICATION_LED_OP_OFF
|| operation >= NOTIFICATION_LED_OP_MAX) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Save led operation */
{
/* check noti and operation is valid data */
if (noti == NULL || operation == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Set led operation */
{
/* Check noti is valid data */
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Save led operation */
{
/* check noti and operation is valid data */
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (on_ms)
const char *pkgname)
{
if (noti == NULL || pkgname == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (noti->launch_pkgname) {
char **pkgname)
{
if (noti == NULL || pkgname == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (noti->launch_pkgname) {
return NOTIFICATION_ERROR_NONE;
}
+EXPORT_API int notification_set_launch_option(notification_h noti,
+ notification_launch_option_type type, void *option)
+{
+ int ret = 0;
+ bundle *b = NULL;
+ app_control_h app_control = option;
+
+ if (noti == NULL) {
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+ if (app_control == NULL) {
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+ if (type != NOTIFICATION_LAUNCH_OPTION_APP_CONTROL) {
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+
+ if ((ret = app_control_to_bundle(app_control, &b)) == APP_CONTROL_ERROR_NONE) {
+ return notification_set_execute_option(noti,
+ NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH,
+ NULL, NULL,
+ b);
+ } else {
+ NOTIFICATION_ERR("Failed to convert appcontrol to bundle:%d", ret);
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+}
+
+EXPORT_API int notification_get_launch_option(notification_h noti,
+ notification_launch_option_type type, void *option)
+{
+ int ret = 0;
+ bundle *b = NULL;
+ app_control_h *app_control = (app_control_h *)option;
+ app_control_h app_control_new = NULL;
+
+ if (noti == NULL) {
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+ if (app_control == NULL) {
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+ if (type != NOTIFICATION_LAUNCH_OPTION_APP_CONTROL) {
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+
+ ret = notification_get_execute_option(noti,
+ NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH,
+ NULL,
+ &b);
+ if (ret == NOTIFICATION_ERROR_NONE && b != NULL) {
+ ret = app_control_create(&app_control_new);
+ if (ret == APP_CONTROL_ERROR_NONE && app_control_new != NULL) {
+ ret = app_control_import_from_bundle(app_control_new, b);
+ if (ret == APP_CONTROL_ERROR_NONE) {
+ *app_control = app_control_new;
+ } else {
+ app_control_destroy(app_control_new);
+ NOTIFICATION_ERR("Failed to import app control from bundle:%d", ret);
+ return NOTIFICATION_ERROR_IO_ERROR;
+ }
+ } else {
+ NOTIFICATION_ERR("Failed to create app control:%d", ret);
+ return NOTIFICATION_ERROR_IO_ERROR;
+ }
+ } else {
+ NOTIFICATION_ERR("Failed to get execute option:%d", ret);
+ return ret;
+ }
+
+ return NOTIFICATION_ERROR_NONE;
+}
+
EXPORT_API notification_error_e notification_set_execute_option(notification_h noti,
notification_execute_type_e type,
const char *text,
bundle *b = NULL;
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (type <= NOTIFICATION_EXECUTE_TYPE_NONE
|| type >= NOTIFICATION_EXECUTE_TYPE_MAX) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Create execute option bundle if does not exist */
bundle *b = NULL;
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (type <= NOTIFICATION_EXECUTE_TYPE_NONE
|| type >= NOTIFICATION_EXECUTE_TYPE_MAX) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
switch (type) {
{
/* Check noti is valid data */
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Set flags */
{
/* Check noti and flags are valid data */
if (noti == NULL || flags == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Set flags */
{
/* Check noti is valid data */
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Set app list */
{
/* Check noti and applist are valid data */
if (noti == NULL || applist == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Set app list */
{
/* Check noti is valid data */
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Save progress size */
{
/* Check noti and size is valid data */
if (noti == NULL || size == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Set progress size */
{
/* Check noti is valid data */
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Save progress percentage */
{
/* Check noti and percentage are valid data */
if (noti == NULL || percentage == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Set progress percentage */
{
/* check noti and pkgname are valid data */
if (noti == NULL || pkgname == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Remove previous caller pkgname */
{
/* Check noti and pkgname are valid data */
if (noti == NULL || pkgname == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Get caller pkgname */
{
/* check noti and pkgname are valid data */
if (noti == NULL || (layout < NOTIFICATION_LY_NONE || layout >= NOTIFICATION_LY_MAX)) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
noti->layout = layout;
{
/* Check noti and pkgname are valid data */
if (noti == NULL || layout == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
*layout = noti->layout;
{
/* check noti is valid data */
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Check group_id is valid data */
{
/* Check noti and type is valid data */
if (noti == NULL || type == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Set noti type */
return NOTIFICATION_ERROR_NONE;
}
+EXPORT_API int notification_post(notification_h noti)
+{
+ int ret = 0;
+ int id = 0;
+
+ /* Check noti is valid data */
+ if (noti == NULL) {
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+
+ /* Check noti type is valid type */
+ if (noti->type <= NOTIFICATION_TYPE_NONE
+ || noti->type >= NOTIFICATION_TYPE_MAX) {
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+
+ /* Save insert time */
+ noti->insert_time = time(NULL);
+
+ ret = notification_ipc_request_insert(noti, &id);
+ if (ret != NOTIFICATION_ERROR_NONE) {
+ return ret;
+ }
+ noti->priv_id = id;
+ NOTIFICATION_DBG("from master:%d", id);
+
+ return NOTIFICATION_ERROR_NONE;
+}
+
EXPORT_API notification_error_e notification_insert(notification_h noti,
int *priv_id)
{
int ret = 0;
int id = 0;
- /* Check noti is vaild data */
+ /* Check noti is valid data */
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Check noti type is valid type */
if (noti->type <= NOTIFICATION_TYPE_NONE
|| noti->type >= NOTIFICATION_TYPE_MAX) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Save insert time */
char *caller_pkgname = NULL;
if (priv_id <= NOTIFICATION_PRIV_ID_NONE) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (pkgname == NULL) {
int ret = 0;
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
ret = notification_ipc_request_delete_single(NOTIFICATION_TYPE_NONE, noti->caller_pkgname, noti->priv_id);
if (priv_id <= NOTIFICATION_PRIV_ID_NONE) {
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
} else {
input_priv_id = noti->priv_id;
}
if (priv_id <= NOTIFICATION_PRIV_ID_NONE) {
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
} else {
input_priv_id = noti->priv_id;
}
if (priv_id <= NOTIFICATION_PRIV_ID_NONE) {
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
} else {
input_priv_id = noti->priv_id;
}
return noti;
}
+EXPORT_API notification_h notification_load_by_tag(const char *tag)
+{
+ int ret = 0;
+ notification_h noti = NULL;
+ char *caller_pkgname = NULL;
+
+ if (tag == NULL) {
+ NOTIFICATION_ERR("Invalid parameter");
+ set_last_result(NOTIFICATION_ERROR_INVALID_PARAMETER);
+ return NULL;
+ }
+
+ caller_pkgname = _notification_get_pkgname_by_pid();
+ if (!caller_pkgname) {
+ NOTIFICATION_ERR("Failed to get a package name");
+ set_last_result(NOTIFICATION_ERROR_OUT_OF_MEMORY);
+
+ return NULL;
+ }
+
+ noti = (notification_h) calloc(1, sizeof(struct _notification));
+ if (noti == NULL) {
+ NOTIFICATION_ERR("Failed to alloc a new notification");
+ set_last_result(NOTIFICATION_ERROR_OUT_OF_MEMORY);
+ free(caller_pkgname);
+
+ return NULL;
+ }
+
+ ret = notification_ipc_request_load_noti_by_tag(noti, caller_pkgname, tag);
+
+ free(caller_pkgname);
+
+ set_last_result(ret);
+
+ if (ret != NOTIFICATION_ERROR_NONE) {
+ notification_free(noti);
+ return NULL;
+ }
+
+ return noti;
+}
+
EXPORT_API notification_error_e notification_clone(notification_h noti, notification_h *clone)
{
notification_h new_noti = NULL;
if (noti == NULL || clone == NULL) {
NOTIFICATION_ERR("INVALID PARAMETER.");
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
new_noti = (notification_h) calloc(1, sizeof(struct _notification));
if (new_noti == NULL) {
NOTIFICATION_ERR("NO MEMORY : noti == NULL");
- return NOTIFICATION_ERROR_NO_MEMORY;
+ return NOTIFICATION_ERROR_OUT_OF_MEMORY;
}
new_noti->type = noti->type;
EXPORT_API notification_error_e notification_free(notification_h noti)
{
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (noti->caller_pkgname) {
notification_cb_list_s *noti_cb_list = NULL;
if (changed_cb == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (notification_ipc_monitor_init() != NOTIFICATION_ERROR_NONE) {
- return NOTIFICATION_ERROR_IO;
+ return NOTIFICATION_ERROR_IO_ERROR;
}
noti_cb_list_new =
noti_cb_list = g_notification_cb_list;
if (changed_cb == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (noti_cb_list == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
while (noti_cb_list->prev != NULL) {
noti_cb_list = noti_cb_list->next;
} while (noti_cb_list != NULL);
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
EXPORT_API notification_error_e
notification_cb_list_s *noti_cb_list = NULL;
if (detailed_changed_cb == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (notification_ipc_monitor_init() != NOTIFICATION_ERROR_NONE) {
- return NOTIFICATION_ERROR_IO;
+ return NOTIFICATION_ERROR_IO_ERROR;
}
noti_cb_list_new =
noti_cb_list = g_notification_cb_list;
if (detailed_changed_cb == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (noti_cb_list == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
while (noti_cb_list->prev != NULL) {
noti_cb_list = noti_cb_list->next;
} while (noti_cb_list != NULL);
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
EXPORT_API notification_error_e notification_get_count(notification_type_e type,
int noti_count = 0;
if (count == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
ret =
int ret = 0;
if (list == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
ret = notification_noti_get_grouping_list(type, count, &get_list);
int ret = 0;
if (list == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
ret = notification_noti_get_grouping_list(type, count, &get_list);
int ret = 0;
if (list == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
ret =
notification_h noti = NULL;
if (list == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
cur_list = notification_list_get_head(list);
void *data)
{
if (noti_op == NULL || data == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
switch (type) {
*((int*)data) = noti_op->extra_info_2;
break;
default:
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
break;
}
void (*deffered_task_cb)(void *data), void *user_data)
{
if (deffered_task_cb == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
return notification_ipc_add_deffered_task(deffered_task_cb, user_data);
void (*deffered_task_cb)(void *data))
{
if (deffered_task_cb == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
return notification_ipc_del_deffered_task(deffered_task_cb);
bundle * group_args)
{
if (noti == NULL || args == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (noti->args) {
bundle ** group_args)
{
if (noti == NULL || args == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (noti->args) {
return NOTIFICATION_ERROR_NONE;
}
+EXPORT_API int notification_set_tag(notification_h noti, const char *tag)
+{
+ /* Check noti is valid data */
+ if (noti == NULL) {
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+
+ if (tag != NULL) {
+ /* save input TAG */
+ if (noti->tag != NULL) {
+ free(noti->tag);
+ }
+ noti->tag = strdup(tag);
+ }
+
+ return NOTIFICATION_ERROR_NONE;
+
+}
+
+EXPORT_API int notification_get_tag(notification_h noti, const char **tag)
+{
+ /* Check noti is valid data */
+ if (noti == NULL) {
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+
+ /* Set sound type */
+ *tag = noti->tag;
+ return NOTIFICATION_ERROR_NONE;
+}
+
EXPORT_API notification_error_e notification_wait_response(notification_h noti,
int timeout,
int *respi,
NULL, &b);
if (b == NULL)
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
tid_c = bundle_get_val(b, "tid");
if (tid_c == NULL) {
sock_fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
if (sock_fd == -1)
- return NOTIFICATION_ERROR_NO_MEMORY;
+ return NOTIFICATION_ERROR_OUT_OF_MEMORY;
sock_addr.sun_family = AF_UNIX;
asprintf(&sock_path, "/tmp/.notification-%s", tid_c);
close(sock_fd);
free(sock_path);
free((char *)tid_c);
- return NOTIFICATION_ERROR_NO_MEMORY;
+ return NOTIFICATION_ERROR_OUT_OF_MEMORY;
}
if (timeout > 0) {
NULL, &b);
if (b == NULL)
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
tid_c = bundle_get_val(b, "tid");
if (tid_c == NULL)
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
tid = atoi(tid_c);
sock_fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
if (sock_fd == -1)
- return NOTIFICATION_ERROR_NO_MEMORY;
+ return NOTIFICATION_ERROR_OUT_OF_MEMORY;
sock_addr.sun_family = AF_UNIX;
asprintf(&sock_path, "/tmp/.notification-%d", tid);
if (connect(sock_fd, (struct sockaddr *)&sock_addr, sizeof(sock_addr)) == -1) {
close(sock_fd);
free(sock_path);
- return NOTIFICATION_ERROR_NO_MEMORY;
+ return NOTIFICATION_ERROR_OUT_OF_MEMORY;
}
if (respc)