summaryrefslogtreecommitdiff
path: root/src/notification_noti.c
diff options
context:
space:
mode:
authorseungha.son <seungha.son@samsung.com>2016-09-20 11:42:19 +0900
committerseungha.son <seungha.son@samsung.com>2016-09-23 16:50:37 +0900
commit112fcd8998329ca502bcf989219cf47a3eeca0c9 (patch)
tree55b31c07c46e0332c741bc6ff337484fa489838b /src/notification_noti.c
parentd1e95562738dd0de7886ddf3ea7d2e3460537556 (diff)
downloadnotification-112fcd8998329ca502bcf989219cf47a3eeca0c9.tar.gz
notification-112fcd8998329ca502bcf989219cf47a3eeca0c9.tar.bz2
notification-112fcd8998329ca502bcf989219cf47a3eeca0c9.zip
Add apis for notification post with event handler callback
- notification_post_with_event_cb() API provide one event callback and distinguish the event by parameter. - notification_send_event() API is for sending event to daemon or app. Signed-off-by: seungha.son <seungha.son@samsung.com> Change-Id: I4232568eb7bb02994f049f81685ae0310327dc69
Diffstat (limited to 'src/notification_noti.c')
-rwxr-xr-xsrc/notification_noti.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/notification_noti.c b/src/notification_noti.c
index 186bb3f..edfeec8 100755
--- a/src/notification_noti.c
+++ b/src/notification_noti.c
@@ -263,7 +263,7 @@ static int _insertion_query_create(notification_h noti, char **query)
"flags_for_property, flag_simmode, display_applist, "
"progress_size, progress_percentage, "
"ongoing_flag, ongoing_value_type, ongoing_current, ongoing_duration, "
- "auto_remove, default_button_index, timeout, text_input_max_length, uid) values ("
+ "auto_remove, default_button_index, timeout, text_input_max_length, event_flag, uid) values ("
"%d, "
"%d, "
"'%s', '%s', "
@@ -282,7 +282,7 @@ static int _insertion_query_create(notification_h noti, char **query)
"%d, '%s', %d, '%s', %d, %d, %d, %d,"
"%d, %d, %d, "
"$progress_size, $progress_percentage, "
- "%d, %d, %d, %d, %d, %d, %d, %d, %d)",
+ "%d, %d, %d, %d, %d, %d, %d, %d, %d, %d)",
noti->type,
noti->layout,
NOTIFICATION_CHECK_STR(noti->caller_pkgname),
@@ -323,6 +323,7 @@ static int _insertion_query_create(notification_h noti, char **query)
noti->default_button_index,
noti->timeout,
noti->text_input_max_length,
+ noti->event_flag,
noti->uid);
/* Free decoded data */
@@ -460,7 +461,7 @@ static int _update_query_create(notification_h noti, char **query)
"display_applist = %d, "
"progress_size = $progress_size, progress_percentage = $progress_percentage, "
"ongoing_flag = %d, ongoing_value_type = %d, ongoing_current = %d, ongoing_duration = %d, "
- "auto_remove = %d, default_button_index = %d, timeout = %d, text_input_max_length = %d "
+ "auto_remove = %d, default_button_index = %d, timeout = %d, text_input_max_length = %d, event_flag = %d "
"where priv_id = %d ",
noti->type,
noti->layout,
@@ -494,8 +495,8 @@ static int _update_query_create(notification_h noti, char **query)
noti->flags_for_property, flag_simmode, noti->display_applist,
noti->ongoing_flag, noti->ongoing_value_type,
noti->ongoing_current, noti->ongoing_duration,
- noti->auto_remove, noti->default_button_index,
- noti->timeout, noti->text_input_max_length, noti->priv_id);
+ noti->auto_remove, noti->default_button_index, noti->timeout,
+ noti->text_input_max_length, noti->event_flag, noti->priv_id);
/* Free decoded data */
if (args)
@@ -596,6 +597,8 @@ static void _notification_noti_populate_from_stmt(sqlite3_stmt *stmt, notificati
noti->auto_remove = sqlite3_column_int(stmt, col++);
noti->default_button_index = sqlite3_column_int(stmt, col++);
noti->timeout = sqlite3_column_int(stmt, col++);
+ noti->text_input_max_length = sqlite3_column_int(stmt, col++);
+ noti->event_flag = sqlite3_column_int(stmt, col++);
noti->app_icon_path = NULL;
noti->app_name = NULL;
@@ -1057,7 +1060,7 @@ EXPORT_API int notification_noti_get_by_priv_id(notification_h noti, char *pkgna
"b_event_handler_click_on_icon, b_event_handler_click_on_thumbnail, "
"sound_type, sound_path, vibration_type, vibration_path, led_operation, led_argb, led_on_ms, led_off_ms, "
"flags_for_property, display_applist, progress_size, progress_percentage, ongoing_flag, ongoing_value_type, "
- "ongoing_current, ongoing_duration, auto_remove, default_button_index, timeout, text_input_max_length "
+ "ongoing_current, ongoing_duration, auto_remove, default_button_index, timeout, text_input_max_length, event_flag "
"from noti_list ";
if (pkgname != NULL && strlen(pkgname) != 0)
@@ -1128,7 +1131,7 @@ EXPORT_API int notification_noti_get_by_tag(notification_h noti, char *pkgname,
"b_event_handler_click_on_icon, b_event_handler_click_on_thumbnail, "
"sound_type, sound_path, vibration_type, vibration_path, led_operation, led_argb, led_on_ms, led_off_ms, "
"flags_for_property, display_applist, progress_size, progress_percentage, ongoing_flag, ongoing_value_type, "
- "ongoing_current, ongoing_duration, auto_remove, default_button_index, timeout, text_input_max_length "
+ "ongoing_current, ongoing_duration, auto_remove, default_button_index, timeout, text_input_max_length, event_flag "
"from noti_list where caller_pkgname = ? and tag = ? and uid = ?", -1, &stmt, NULL);
if (ret != SQLITE_OK) {
NOTIFICATION_ERR("Error: %s\n", sqlite3_errmsg(db));
@@ -1164,7 +1167,7 @@ EXPORT_API int notification_noti_get_by_tag(notification_h noti, char *pkgname,
"b_event_handler_click_on_icon, b_event_handler_click_on_thumbnail, "
"sound_type, sound_path, vibration_type, vibration_path, led_operation, led_argb, led_on_ms, led_off_ms, "
"flags_for_property, display_applist, progress_size, progress_percentage, ongoing_flag, ongoing_value_type, "
- "ongoing_current, ongoing_duration, auto_remove, default_button_index, timeout, text_input_max_length "
+ "ongoing_current, ongoing_duration, auto_remove, default_button_index, timeout, text_input_max_length, event_flag "
"from noti_list where tag = ? and uid = ?", -1, &stmt, NULL);
if (ret != SQLITE_OK) {
NOTIFICATION_ERR("Error: %s\n", sqlite3_errmsg(db));
@@ -1623,7 +1626,7 @@ EXPORT_API int notification_noti_get_grouping_list(notification_type_e type,
"b_event_handler_click_on_icon, b_event_handler_click_on_thumbnail, "
"sound_type, sound_path, vibration_type, vibration_path, led_operation, led_argb, led_on_ms, led_off_ms, "
"flags_for_property, display_applist, progress_size, progress_percentage, ongoing_flag, ongoing_value_type, "
- "ongoing_current, ongoing_duration, auto_remove, default_button_index, timeout, text_input_max_length "
+ "ongoing_current, ongoing_duration, auto_remove, default_button_index, timeout, text_input_max_length, event_flag "
"from noti_list where 1 > 0 ");
if (status == VCONFKEY_TELEPHONY_SIM_INSERTED) {
@@ -1725,7 +1728,7 @@ EXPORT_API int notification_noti_get_detail_list(const char *pkgname,
"b_event_handler_click_on_icon, b_event_handler_click_on_thumbnail, "
"sound_type, sound_path, vibration_type, vibration_path, led_operation, led_argb, led_on_ms, led_off_ms, "
"flags_for_property, display_applist, progress_size, progress_percentage, ongoing_flag, ongoing_value_type, "
- "ongoing_current, ongoing_duration, auto_remove, default_button_index, timeout, text_input_max_length "
+ "ongoing_current, ongoing_duration, auto_remove, default_button_index, timeout, text_input_max_length, event_flag "
"from noti_list ");
if (priv_id == NOTIFICATION_PRIV_ID_NONE && group_id == NOTIFICATION_GROUP_ID_NONE) {
@@ -1985,7 +1988,8 @@ static int _template_query_create(notification_h noti, char *template_name, char
"b_event_handler_click_on_icon, b_event_handler_click_on_thumbnail, "
"sound_type, sound_path, vibration_type, vibration_path, led_operation, led_argb, led_on_ms, led_off_ms, "
"flags_for_property, flag_simmode, display_applist, progress_size, progress_percentage, ongoing_flag, ongoing_value_type, "
- "ongoing_current, ongoing_duration, auto_remove, default_button_index, timeout, text_input_max_length, uid, template_name) values ("
+ "ongoing_current, ongoing_duration, auto_remove, default_button_index, timeout, text_input_max_length, "
+ "event_flag, uid, template_name) values ("
"%d, "
"%d, "
"'%s', '%s', "
@@ -2045,6 +2049,7 @@ static int _template_query_create(notification_h noti, char *template_name, char
noti->default_button_index,
noti->timeout,
noti->text_input_max_length,
+ noti->event_flag,
noti->uid,
template_name);
@@ -2210,7 +2215,7 @@ EXPORT_API int notification_noti_get_package_template(notification_h noti, char
"b_event_handler_click_on_icon, b_event_handler_click_on_thumbnail, "
"sound_type, sound_path, vibration_type, vibration_path, led_operation, led_argb, led_on_ms, led_off_ms, "
"flags_for_property, display_applist, progress_size, progress_percentage, ongoing_flag, ongoing_value_type, "
- "ongoing_current, ongoing_duration, auto_remove, default_button_index, timeout, text_input_max_length "
+ "ongoing_current, ongoing_duration, auto_remove, default_button_index, timeout, text_input_max_length, event_flag "
"from noti_template where caller_pkgname = ? and template_name = ?", -1, &stmt, NULL);
if (ret != SQLITE_OK) {
NOTIFICATION_ERR("Error: %s\n", sqlite3_errmsg(db));