summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/notification.c2
-rwxr-xr-xsrc/notification_db.c2
-rwxr-xr-xsrc/notification_internal.c20
-rwxr-xr-xsrc/notification_ipc.c2
-rwxr-xr-xsrc/notification_noti.c11
5 files changed, 33 insertions, 4 deletions
diff --git a/src/notification.c b/src/notification.c
index 03c94d6..c012d5b 100755
--- a/src/notification.c
+++ b/src/notification.c
@@ -1430,6 +1430,7 @@ static notification_h _notification_create(notification_type_e type)
noti->ongoing_flag = false;
noti->default_button_index = 0;
noti->type = NOTIFICATION_ONGOING_VALUE_TYPE_PERCENT;
+ noti->timeout = 0;
if (getuid() >= REGULAR_UID_MIN) {
noti->caller_pkgname = notification_get_pkgname_by_pid();
@@ -1644,6 +1645,7 @@ EXPORT_API int notification_clone(notification_h noti, notification_h *clone)
new_noti->ongoing_duration = noti->ongoing_duration;
new_noti->auto_remove = noti->auto_remove;
new_noti->default_button_index = noti->default_button_index;
+ new_noti->timeout = noti->timeout;
new_noti->uid = noti->uid;
diff --git a/src/notification_db.c b/src/notification_db.c
index f331934..58b5151 100755
--- a/src/notification_db.c
+++ b/src/notification_db.c
@@ -84,6 +84,7 @@ create table if not exists noti_list ( \
ongoing_duration INTEGER default 0, \
auto_remove INTEGER default 1, \
default_button_index INTEGER default 0, \
+ timeout INTEGER default 0, \
uid INTEGER \
); \
create table if not exists noti_group_data ( \
@@ -197,6 +198,7 @@ create table if not exists noti_list ( \
ongoing_duration INTEGER default 0, \
auto_remove INTEGER default 1, \
default_button_index INTEGER default 0, \
+ timeout INTEGER default 0, \
uid INTEGER, \
template_name TEXT, \
UNIQUE (caller_pkgname, template_name) \
diff --git a/src/notification_internal.c b/src/notification_internal.c
index 8a463d1..e3b2719 100755
--- a/src/notification_internal.c
+++ b/src/notification_internal.c
@@ -1375,3 +1375,23 @@ EXPORT_API int notification_set_ongoing_time(notification_h noti, int current, i
return NOTIFICATION_ERROR_NONE;
}
+
+EXPORT_API int nofication_get_hide_timeout(notification_h noti, int *timeout)
+{
+ if (noti == NULL || timeout == NULL)
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+
+ *timeout = noti->timeout;
+
+ return NOTIFICATION_ERROR_NONE;
+}
+
+EXPORT_API int nofication_set_hide_timeout(notification_h noti, int timeout)
+{
+ if (noti == NULL)
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+
+ noti->timeout = timeout;
+
+ return NOTIFICATION_ERROR_NONE;
+}
diff --git a/src/notification_ipc.c b/src/notification_ipc.c
index 8b445b2..546f9a1 100755
--- a/src/notification_ipc.c
+++ b/src/notification_ipc.c
@@ -1669,6 +1669,7 @@ EXPORT_API GVariant *notification_ipc_make_gvariant_from_noti(notification_h not
g_variant_builder_add(&builder, "{iv}", NOTIFICATION_DATA_TYPE_ONGOING_DURATION, g_variant_new_int32(noti->ongoing_duration));
g_variant_builder_add(&builder, "{iv}", NOTIFICATION_DATA_TYPE_AUTO_REMOVE, g_variant_new_int32(noti->auto_remove));
g_variant_builder_add(&builder, "{iv}", NOTIFICATION_DATA_TYPE_DEFAULT_BUTTON, g_variant_new_int32(noti->default_button_index));
+ g_variant_builder_add(&builder, "{iv}", NOTIFICATION_DATA_TYPE_TIMEOUT, g_variant_new_int32(noti->timeout));
g_variant_builder_add(&builder, "{iv}", NOTIFICATION_DATA_TYPE_UID, g_variant_new_int32(noti->uid));
result_body = g_variant_builder_end(&builder);
@@ -1820,6 +1821,7 @@ EXPORT_API int notification_ipc_make_noti_from_gvariant(notification_h noti,
_variant_dict_lookup(dict, NOTIFICATION_DATA_TYPE_ONGOING_DURATION, "i", &noti->ongoing_duration);
_variant_dict_lookup(dict, NOTIFICATION_DATA_TYPE_AUTO_REMOVE, "i", &noti->auto_remove);
_variant_dict_lookup(dict, NOTIFICATION_DATA_TYPE_DEFAULT_BUTTON, "i", &noti->default_button_index);
+ _variant_dict_lookup(dict, NOTIFICATION_DATA_TYPE_TIMEOUT, "i", &noti->timeout);
_variant_dict_lookup(dict, NOTIFICATION_DATA_TYPE_UID, "i", &noti->uid);
noti->caller_pkgname = _dup_string(caller_pkgname);
diff --git a/src/notification_noti.c b/src/notification_noti.c
index 7fa4d19..133c26d 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, uid) values ("
+ "auto_remove, default_button_index, timeout, 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)",
noti->type,
noti->layout,
NOTIFICATION_CHECK_STR(noti->caller_pkgname),
@@ -321,6 +321,7 @@ static int _insertion_query_create(notification_h noti, char **query)
noti->ongoing_duration,
noti->auto_remove,
noti->default_button_index,
+ noti->timeout,
noti->uid);
/* Free decoded data */
@@ -458,7 +459,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 "
+ "auto_remove = %d, default_button_index = %d, timeout = %d "
"where priv_id = %d ",
noti->type,
noti->layout,
@@ -492,7 +493,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->priv_id);
+ noti->auto_remove, noti->default_button_index,
+ noti->timeout, noti->priv_id);
/* Free decoded data */
if (args)
@@ -592,6 +594,7 @@ static void _notification_noti_populate_from_stmt(sqlite3_stmt *stmt, notificati
noti->ongoing_duration = sqlite3_column_int(stmt, col++);
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->app_icon_path = NULL;
noti->app_name = NULL;