int notification_delete_by_display_applist(int display_applist);
int notification_delete_by_display_applist_for_uid(int display_applist, uid_t uid);
-int notification_set_do_not_show_again(notification_h noti, bool flag);
-int notification_get_do_not_show_again(notification_h noti, bool* flag);
+int notification_set_check_box(notification_h noti, bool flag, bool checked);
+int notification_get_check_box(notification_h noti, bool *flag, bool *checked);
+
+int notification_set_check_box_checked(notification_h noti, bool checked);
+int notification_get_check_box_checked(notification_h noti, bool *checked);
/**
bool is_translation;
int extension_image_size;
+ bool check_box; /* check box flag */
+ bool check_box_value; /* check box value */
+
uid_t uid;
};
NOTIFICATION_DATA_TYPE_EVENT_FLAG,
NOTIFICATION_DATA_TYPE_TRANSLATION,
NOTIFICATION_DATA_TYPE_EXTENSION_IMAGE_SIZE,
+ NOTIFICATION_DATA_TYPE_CHECK_BOX,
+ NOTIFICATION_DATA_TYPE_CHECK_BOX_VALUE,
NOTIFICATION_DATA_TYPE_UID,
} notification_data_type_e;
NOTIFICATION_EVENT_TYPE_HIDDEN_BY_EXTERNAL = 102, /**< Hidden by external */
NOTIFICATION_EVENT_TYPE_PRESSED = 200, /**< Pressed by user */
NOTIFICATION_EVENT_TYPE_DELETED = 201, /**< Deleted by user */
- NOTIFICATION_EVENT_TYPE_DO_NOT_SHOW_AGAIN = 300, /**< Do not show again */
+ NOTIFICATION_EVENT_TYPE_CHECK_BOX = 300, /**< Do not show again */
} notification_event_type_extension_e;
/**
goto out;
}
+ noti->check_box = false;
+ noti->check_box_value = false;
+
if (getuid() < REGULAR_UID_MIN) {
noti->pkg_id = strdup(noti->caller_app_id);
if (noti->pkg_id == NULL)
new_noti->uid = noti->uid;
+ new_noti->check_box = noti->check_box;
+ new_noti->check_box_value = noti->check_box_value;
+
*clone = new_noti;
return NOTIFICATION_ERROR_NONE;
" text_input_max_length INTEGER DEFAULT 0,\n" \
" event_flag INTEGER DEFAULT 0,\n" \
" extension_image_size INTEGER DEFAULT 0,\n" \
- " uid INTEGER );\n" \
+ " uid INTEGER,\n" \
+ " check_box INTEGER DEFAULT 0,\n" \
+ " check_box_value INTEGER DEFAULT 0 );\n" \
"CREATE TABLE IF NOT EXISTS noti_group_data (\n" \
" caller_app_id TEXT NOT NULL,\n" \
" group_id INTEGER DEFAULT 0,\n" \
" event_flag INTEGER DEFAULT 0,\n" \
" extension_image_size INTEGER DEFAULT 0,\n" \
" uid INTEGER,\n" \
+ " check_box INTEGER DEFAULT 0,\n" \
+ " check_box_value INTEGER DEFAULT 0,\n" \
" template_name TEXT,\n" \
" UNIQUE (caller_app_id, template_name));\n"
"progress_size, progress_percentage, ongoing_flag, ongoing_value_type, " \
"ongoing_current, ongoing_duration, auto_remove, default_button_index, " \
"hide_timeout, delete_timeout, text_input_max_length, event_flag, "\
- "extension_image_size, uid"
+ "extension_image_size, uid, check_box, check_box_value"
#define NOTI_LIST_DB_ATTRIBUTES_INSERT \
"type, layout, pkg_id, caller_app_id, launch_app_id, app_label, " \
"progress_size, progress_percentage, ongoing_flag, ongoing_value_type, " \
"ongoing_current, ongoing_duration, auto_remove, default_button_index, " \
"hide_timeout, delete_timeout, text_input_max_length, event_flag, " \
- "extension_image_size, uid"
+ "extension_image_size, uid, check_box, check_box_value"
#define NOTI_LIST_INSERT_VALUES \
"?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " \
"?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " \
"?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " \
- "?, ?, ?, ?, ?, ? "
+ "?, ?, ?, ?, ?, ?, ?, ? "
#define NOTI_LIST_DB_ATTRIBUTES_UPDATE \
"type = ?, layout = ?, launch_app_id = ?, app_label = ?, " \
"ongoing_current = ?, ongoing_duration = ?, " \
"auto_remove = ?, default_button_index = ?, " \
"hide_timeout = ?, delete_timeout = ?, " \
- "text_input_max_length = ?, event_flag = ?, extension_image_size = ? "
+ "text_input_max_length = ?, event_flag = ?, extension_image_size = ?, " \
+ "check_box = ?, check_box_value = ? "
#define NOTIFICATION_SETTING_DB_ATTRIBUTES \
"package_name, app_id, allow_to_notify, do_not_disturb_except, "\
&& event_type <= NOTIFICATION_EVENT_TYPE_HIDDEN_BY_EXTERNAL) ||
(event_type >= NOTIFICATION_EVENT_TYPE_PRESSED
&& event_type <= NOTIFICATION_EVENT_TYPE_DELETED) ||
- (event_type == NOTIFICATION_EVENT_TYPE_DO_NOT_SHOW_AGAIN)))
+ (event_type == NOTIFICATION_EVENT_TYPE_CHECK_BOX)))
return NOTIFICATION_ERROR_INVALID_PARAMETER;
ret = notification_get_event_flag(noti, &event_flag);
&& event_type <= NOTIFICATION_EVENT_TYPE_HIDDEN_BY_EXTERNAL) ||
(event_type >= NOTIFICATION_EVENT_TYPE_PRESSED
&& event_type <= NOTIFICATION_EVENT_TYPE_DELETED) ||
- (event_type == NOTIFICATION_EVENT_TYPE_DO_NOT_SHOW_AGAIN)))
+ (event_type == NOTIFICATION_EVENT_TYPE_CHECK_BOX)))
return NOTIFICATION_ERROR_INVALID_PARAMETER;
ret = notification_ipc_send_event(NULL, event_type, priv_id);
return notification_delete_by_display_applist_for_uid(display_applist, getuid());
}
-EXPORT_API int notification_set_do_not_show_again(notification_h noti,
- bool flag)
+EXPORT_API int notification_set_check_box(notification_h noti,
+ bool flag, bool checked)
{
- int err;
- int ret = NOTIFICATION_ERROR_NONE;
- char key[KEY_LEN];
- char *del = NULL;
-
if (noti == NULL) {
ERR("Invalid parameter");
return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
- if (noti->args == NULL)
- noti->args = bundle_create();
-
- snprintf(key, sizeof(key), "%s%d", EXTENSION_EVENT_KEY,
- NOTIFICATION_EVENT_TYPE_DO_NOT_SHOW_AGAIN);
- bundle_get_str(noti->args, key, &del);
- if (del != NULL) {
- bundle_del(noti->args, key);
- del = NULL;
- }
+ noti->check_box = flag;
+ noti->check_box_value = checked;
- if (flag)
- err = bundle_add_str(noti->args, key, "true");
- else
- err = bundle_add_str(noti->args, key, "false");
+ return NOTIFICATION_ERROR_NONE;
+}
- if (err != BUNDLE_ERROR_NONE) {
- ERR("Failed to add str to bundle [%d]", err);
- return NOTIFICATION_ERROR_IO_ERROR;
+EXPORT_API int notification_get_check_box(notification_h noti,
+ bool *flag, bool *checked)
+{
+ if (noti == NULL || flag == NULL || checked == NULL) {
+ ERR("Invalid parameter");
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
- return ret;
+ *flag = noti->check_box;
+ *checked = noti->check_box_value;
+
+ return NOTIFICATION_ERROR_NONE;
}
-EXPORT_API int notification_get_do_not_show_again(notification_h noti,
- bool* flag)
+EXPORT_API int notification_set_check_box_checked(notification_h noti,
+ bool checked)
{
- int err;
- int ret = NOTIFICATION_ERROR_NONE;
- char *ret_str = NULL;
- char key[KEY_LEN];
-
if (noti == NULL) {
ERR("Invalid parameter");
return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
- snprintf(key, sizeof(key), "%s%d", EXTENSION_EVENT_KEY,
- NOTIFICATION_EVENT_TYPE_DO_NOT_SHOW_AGAIN);
+ noti->check_box_value = checked;
- bundle_get_str(noti->args, key, &ret_str);
- if (ret_str == NULL) {
- ERR("No key");
+ return NOTIFICATION_ERROR_NONE;
+}
+
+EXPORT_API int notification_get_check_box_checked(notification_h noti,
+ bool *checked)
+{
+ if (noti == NULL || checked == NULL) {
+ ERR("Invalid parameter");
return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
- if (strncmp("true", ret_str, 4) == 0)
- *flag = true;
+ if (noti->check_box)
+ *checked = noti->check_box_value;
else
- *flag = false;
+ *checked = false;
- return ret;
+ return NOTIFICATION_ERROR_NONE;
}
g_variant_builder_add(&builder, "{iv}", NOTIFICATION_DATA_TYPE_EVENT_FLAG, g_variant_new_int32(noti->event_flag));
g_variant_builder_add(&builder, "{iv}", NOTIFICATION_DATA_TYPE_TRANSLATION, g_variant_new_int32(noti->is_translation));
g_variant_builder_add(&builder, "{iv}", NOTIFICATION_DATA_TYPE_EXTENSION_IMAGE_SIZE, g_variant_new_int32(noti->extension_image_size));
+ g_variant_builder_add(&builder, "{iv}", NOTIFICATION_DATA_TYPE_CHECK_BOX, g_variant_new_int32(noti->check_box));
+ g_variant_builder_add(&builder, "{iv}", NOTIFICATION_DATA_TYPE_CHECK_BOX_VALUE, g_variant_new_int32(noti->check_box_value));
g_variant_builder_add(&builder, "{iv}", NOTIFICATION_DATA_TYPE_UID, g_variant_new_int32(noti->uid));
result_body = g_variant_builder_end(&builder);
_variant_dict_lookup(dict, NOTIFICATION_DATA_TYPE_EVENT_FLAG, "i", ¬i->event_flag);
_variant_dict_lookup(dict, NOTIFICATION_DATA_TYPE_TRANSLATION, "i", ¬i->is_translation);
_variant_dict_lookup(dict, NOTIFICATION_DATA_TYPE_EXTENSION_IMAGE_SIZE, "i", ¬i->extension_image_size);
+ _variant_dict_lookup(dict, NOTIFICATION_DATA_TYPE_CHECK_BOX, "i", ¬i->check_box);
+ _variant_dict_lookup(dict, NOTIFICATION_DATA_TYPE_CHECK_BOX_VALUE, "i", ¬i->check_box_value);
_variant_dict_lookup(dict, NOTIFICATION_DATA_TYPE_UID, "i", ¬i->uid);
if (noti->pkg_id)
noti->event_flag = sqlite3_column_int(stmt, col++);
noti->extension_image_size = sqlite3_column_int(stmt, col++);
noti->uid = sqlite3_column_int(stmt, col++);
+ noti->check_box = sqlite3_column_int(stmt, col++);
+ noti->check_box_value = sqlite3_column_int(stmt, col++);
noti->app_icon_path = NULL;
noti->temp_title = NULL;
__BIND_INT(db, stmt, idx++, noti->event_flag, ret, out);
__BIND_INT(db, stmt, idx++, noti->extension_image_size, ret, out);
__BIND_INT(db, stmt, idx++, noti->uid, ret, out);
+ __BIND_INT(db, stmt, idx++, noti->check_box, ret, out);
+ __BIND_INT(db, stmt, idx++, noti->check_box_value, ret, out);
out:
__free_encoded_data(b_image_path);
noti_err = notification_set_ongoing_flag(noti_handle, true);
noti_err = notification_set_auto_remove(noti_handle, false);
+ noti_err = notification_set_check_box(noti_handle, true, false);
+ noti_err = notification_set_check_box_checked(noti_handle, true);
+
noti_err = notification_set_display_applist(noti_handle, NOTIFICATION_DISPLAY_APP_INDICATOR | NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY | NOTIFICATION_DISPLAY_APP_TICKER);
noti_err = notification_post_for_uid(noti_handle, 5002);
noti_err = notification_set_ongoing_flag(noti_handle, true);
noti_err = notification_set_auto_remove(noti_handle, false);
+ noti_err = notification_set_check_box(noti_handle, true, false);
+ noti_err = notification_set_check_box_checked(noti_handle, true);
+
noti_err = notification_set_display_applist(noti_handle, NOTIFICATION_DISPLAY_APP_INDICATOR | NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY | NOTIFICATION_DISPLAY_APP_TICKER);
noti_err = notification_post(noti_handle);
int type;
bool ongoing_flag;
bool auto_remove;
+ bool check_box;
+ bool checked;
noti_err = notification_get_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list_handle);
notification_get_ongoing_flag(noti_handle, &ongoing_flag);
notification_get_auto_remove(noti_handle, &auto_remove);
- testapp_print("priv_id[%d] type[%d] ongoing_flag[%d] auto_remove[%d]\n", priv_id, type, ongoing_flag, auto_remove);
+ notification_get_check_box(noti_handle, &check_box, &checked);
+ notification_get_check_box_checked(noti_handle, &checked);
+
+ testapp_print("priv_id[%d] type[%d] ongoing_flag[%d] auto_remove[%d] check_box[%d] checked[%d]\n",
+ priv_id, type, ongoing_flag, auto_remove, check_box, checked);
noti_list_cursor_handle = notification_list_get_next(noti_list_cursor_handle);
}
#!/bin/sh
-#------------------------------------------#
-# notification patch for upgrade (4.0 -> 5.x) #
-#------------------------------------------#
+#----------------------------------------------------#
+# notification patch for upgrade (7.0 -> 8.0) #
+#----------------------------------------------------#
# Macro
PATH=/bin:/usr/bin:/sbin:/usr/sbin
CheckListTable() {
ADDED_COLUMN=`sqlite3 $DB_NOTIFICATION 'PRAGMA table_info(noti_list)' | grep b_event_handler_click_on_button_7`
+ CHECKBOX_COLUMN=`sqlite3 $DB_NOTIFICATION 'PRAGMA table_info(noti_list)' | grep check_box`
+
echo "## Check list table"
- if [ -z "${ADDED_COLUMN}" ]; then
+ if [ -z "${ADDED_COLUMN}" ] || [ -z "${CHECKBOX_COLUMN}"]; then
echo "column empty"
return 1
else
CheckTemplateTable() {
ADDED_COLUMN=`sqlite3 $DB_NOTIFICATION 'PRAGMA table_info(noti_template)' | grep template_name`
+ CHECKBOX_COLUMN=`sqlite3 $DB_NOTIFICATION 'PRAGMA table_info(noti_template)' | grep check_box`
+
echo "## Check template table"
- if [ -z "${ADDED_COLUMN}" ]; then
+ if [ -z "${ADDED_COLUMN}" ] || [ -z "${CHECKBOX_COLUMN}"]; then
echo "column empty"
return 1
else
text_input_max_length INTEGER default 0,
event_flag INTEGER default 0,
extension_image_size INTEGER default 0,
- uid INTEGER
+ uid INTEGER,
+ check_box INTEGER DEFAULT 0,
+ check_box_value INTEGER DEFAULT 0
);
INSERT INTO noti_list_temp (type, layout, pkg_id, caller_app_id, launch_app_id, image_path, priv_image_path, group_id, internal_group_id, priv_id, title_key, b_text, b_key, tag, b_format_args, num_format_args, text_domain, text_dir, time, insert_time, args, group_args, b_execute_option, b_service_responding, b_service_single_launch, b_service_multi_launch, b_event_handler_click_on_button_1, b_event_handler_click_on_button_2, b_event_handler_click_on_button_3, b_event_handler_click_on_button_4, b_event_handler_click_on_button_5, b_event_handler_click_on_button_6, b_event_handler_click_on_icon, b_event_handler_click_on_thumbnail, b_event_handler_click_on_text_input_button, sound_type, sound_path, priv_sound_path, vibration_type, vibration_path, priv_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, hide_timeout, delete_timeout, text_input_max_length, event_flag, extension_image_size, uid) \
SELECT type, layout, pkg_id, caller_app_id, launch_app_id, image_path, priv_image_path, group_id, internal_group_id, priv_id, title_key, b_text, b_key, tag, b_format_args, num_format_args, text_domain, text_dir, time, insert_time, args, group_args, b_execute_option, b_service_responding, b_service_single_launch, b_service_multi_launch, b_event_handler_click_on_button_1, b_event_handler_click_on_button_2, b_event_handler_click_on_button_3, b_event_handler_click_on_button_4, b_event_handler_click_on_button_5, b_event_handler_click_on_button_6, b_event_handler_click_on_icon, b_event_handler_click_on_thumbnail, b_event_handler_click_on_text_input_button, sound_type, sound_path, priv_sound_path, vibration_type, vibration_path, priv_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, hide_timeout, delete_timeout, text_input_max_length, event_flag, extension_image_size, uid FROM noti_list;
event_flag INTEGER default 0,
extension_image_size INTEGER default 0,
uid INTEGER,
+ check_box INTEGER DEFAULT 0,
+ check_box_value INTEGER DEFAULT 0,
template_name TEXT,
UNIQUE (caller_app_id, template_name)
);