return 0;
}
-static bool _is_do_not_disturb(notification_h noti)
-{
- if (!noti)
- return false;
-
- notification_system_setting_h system_setting;
- bool do_not_disturb = true;
-
- notification_setting_h noti_setting;
- char *pkgname = NULL;
- bool do_not_disturb_exception = false;
-
- int ret = notification_system_setting_load_system_setting(&system_setting);
- retvm_if(ret != NOTIFICATION_ERROR_NONE || !system_setting, true,
- "notification_system_setting_load_system_setting failed: %s", get_error_message(ret));
-
- ret = notification_system_setting_get_do_not_disturb(system_setting, &do_not_disturb);
- if (ret != NOTIFICATION_ERROR_NONE)
- _E("notification_system_setting_get_do_not_disturb failed: %s", get_error_message(ret));
-
- notification_system_setting_free_system_setting(system_setting);
-
-
- ret = notification_get_pkgname(noti, &pkgname);
- retvm_if(ret != NOTIFICATION_ERROR_NONE || !pkgname, true,
- "notification_get_pkgname failed: %s", get_error_message(ret));
-
- ret = notification_setting_get_setting_by_package_name(pkgname, ¬i_setting);
- retvm_if(ret != NOTIFICATION_ERROR_NONE || !noti_setting, true,
- "notification_setting_get_setting_by_package_name failed: %s", get_error_message(ret));
-
- ret = notification_setting_get_do_not_disturb_except(noti_setting, &do_not_disturb_exception);
- if (ret != NOTIFICATION_ERROR_NONE)
- _E("notification_setting_get_do_not_disturb_except failed: %s", get_error_message(ret));
-
- notification_setting_free_notification(noti_setting);
-
- _D("do_not_disturb = %d, do_not_disturb_exception = %d", do_not_disturb, do_not_disturb_exception);
-
- return do_not_disturb && !do_not_disturb_exception;
-
-}
-
static bool _notification_accept(notification_h noti)
{
retv_if(!noti, false);
return;
}
- if (_is_do_not_disturb(op_list->noti)) {
- _E("Do not disturb");
- _request_to_delete_noti(op_list->noti);
- return;
- }
-
ticker_info_s *ticker_info = _ticker_noti_create(op_list->noti);
retm_if(!ticker_info, "_ticker_noti_create failed");