ret = notification_get_noti_package_template(parameters, &reply_body, uid);
else if (g_strcmp0(method_name, "get_noti_block_state") == 0)
ret = notification_get_block_state(parameters, &reply_body, uid);
+ else if (g_strcmp0(method_name, "load_dnd_allow_exception") == 0)
+ ret = notification_load_dnd_allow_exception(parameters, &reply_body, uid);
+ else if (g_strcmp0(method_name, "update_dnd_allow_exception") == 0)
+ ret = notification_update_dnd_allow_exception(parameters, &reply_body, uid);
if (ret == NOTIFICATION_ERROR_NONE) {
DbgPrint("notification service success : %d", ret);
" <arg type='v' name='state' direction='out'/>"
" </method>"
+ " <method name='update_dnd_allow_exception'>"
+ " <arg type='i' name='type' direction='in'/>"
+ " <arg type='i' name='value' direction='in'/>"
+ " <arg type='i' name='uid' direction='in'/>"
+ " </method>"
+
+ " <method name='load_dnd_allow_exception'>"
+ " <arg type='i' name='uid' direction='in'/>"
+ " <arg type='i' name='count' direction='out'/>"
+ " <arg type='a(v)' name='dnd_allow_exception' direction='out'/>"
+ " </method>"
+
" <method name='post_toast'>"
" </method>"
" </interface>"
notification_system_setting_h setting = NULL;
uid_t param_uid;
+
g_variant_get(parameters, "(i)", ¶m_uid);
ret = _validate_and_set_param_uid_with_uid(uid, ¶m_uid);
if (ret != NOTIFICATION_ERROR_NONE)
DbgPrint("get notification block state done");
return ret;
}
+int notification_load_dnd_allow_exception(GVariant *parameters, GVariant **reply_body, uid_t uid)
+{
+ int ret;
+ int count = 0;
+ int i;
+ uid_t param_uid;
+ GVariant *body = NULL;
+ GVariantBuilder *builder;
+ dnd_allow_exception_h dnd_allow_exception = NULL;
+ dnd_allow_exception_h temp;
+
+ g_variant_get(parameters, "(i)", ¶m_uid);
+
+ ret = _validate_and_set_param_uid_with_uid(uid, ¶m_uid);
+ if (ret != NOTIFICATION_ERROR_NONE)
+ return ret;
+
+ ret = notification_system_setting_load_dnd_allow_exception(&dnd_allow_exception, &count, param_uid);
+ if (ret != NOTIFICATION_ERROR_NONE) {
+ ErrPrint("failed to load dnd_allow_exception : %d", ret);
+ return ret;
+ }
+
+ builder = g_variant_builder_new(G_VARIANT_TYPE("a(v)"));
+
+ if (dnd_allow_exception) {
+ for (i = 0; i < count; i++) {
+ temp = dnd_allow_exception + i;
+ body = notification_ipc_make_gvariant_from_dnd_allow_exception(temp);
+ g_variant_builder_add(builder, "(v)", body);
+ }
+ free(dnd_allow_exception);
+ }
+
+ *reply_body = g_variant_new("(ia(v))", count, builder);
+ g_variant_builder_unref(builder);
+
+ if (*reply_body == NULL) {
+ ErrPrint("cannot make reply_body");
+ return NOTIFICATION_ERROR_OUT_OF_MEMORY;
+ }
+
+ DbgPrint("load dnd_allow_exception");
+ return ret;
+}
+
+int notification_update_dnd_allow_exception(GVariant *parameters, GVariant **reply_body, uid_t uid)
+{
+ int ret;
+ int type;
+ int value;
+ uid_t param_uid;
+
+ g_variant_get(parameters, "(iii)", &type, &value, ¶m_uid);
+
+ ret = _validate_and_set_param_uid_with_uid(uid, ¶m_uid);
+ if (ret != NOTIFICATION_ERROR_NONE)
+ return ret;
+
+ ret = notification_system_setting_update_dnd_allow_exception(type,
+ value,
+ param_uid);
+ if (ret != NOTIFICATION_ERROR_NONE) {
+ ErrPrint("failed to update dnd_allow_exception : %d", ret);
+ return ret;
+ }
+
+ *reply_body = g_variant_new("()");
+ if (*reply_body == NULL) {
+ ErrPrint("cannot make reply_body");
+ return NOTIFICATION_ERROR_OUT_OF_MEMORY;
+ }
+
+ DbgPrint("update dnd_allow_exception");
+ return ret;
+}
static void _notification_data_init(void)
{