static bool _is_dnd_app_exist();
static void __delete_dnd_app_info(pid_t pid);
static dnd_app_info_s *__find_dnd_app_info_by_pid(pid_t pid);
+static void _unregister_dnd_app(int pid);
/*!
* SERVICE HANDLER
ret = notification_del_noti_by_display_applist(parameters, &reply_body, uid);
} else if (g_strcmp0(method_name, "register_dnd_app") == 0) {
ret = notification_register_dnd_app(parameters, &reply_body, sender, pid, uid);
+ } else if (g_strcmp0(method_name, "unregister_dnd_app") == 0) {
+ ret = notification_unregister_dnd_app(parameters, &reply_body, sender, pid, uid);
}
if (ret == NOTIFICATION_ERROR_NONE) {
" <arg type='i' name='pid' direction='in'/>"
" <arg type='i' name='uid' direction='in'/>"
" </method>"
+
+ " <method name='unregister_dnd_app'>"
+ " <arg type='i' name='pid' direction='in'/>"
+ " <arg type='i' name='uid' direction='in'/>"
+ " </method>"
" </interface>"
" </node>";
__disturb_noti_list = g_list_append(__disturb_noti_list, noti_info);
}
-void _aul_app_dead_event_cb_v2(int pid, int status, void* user_data)
+static void _unregister_dnd_app(int pid)
{
int ret;
dnd_app_info_s *info;
int latest_priv_id = NOTIFICATION_PRIV_ID_NONE;
int latest_status = NOTIFICATION_OP_NONE;
- WARN("add dead, pid : %d, status : %d", pid, status);
+ WARN("unregister dnd app : %d", pid);
info = __find_dnd_app_info_by_pid(pid);
if (info == NULL || info->busname == NULL) {
}
}
+static void _aul_app_dead_event_cb_v2(int pid, int status, void* user_data)
+{
+ WARN("app dead, pid : %d, status : %d", pid, status);
+
+ _unregister_dnd_app(pid);
+}
+
int _notification_launch_viewer(notification_h noti, int priv_id,
notification_op_type_e status, uid_t uid)
{
return NOTIFICATION_ERROR_NONE;
}
+int notification_unregister_dnd_app(GVariant *parameters, GVariant **reply_body,
+ const char *sender, pid_t pid, uid_t uid)
+{
+ uid_t param_uid;
+ pid_t param_pid;
+
+ /* is parameter necessary ?? */
+ /* is it necessary to check valid uid, pid ?? */
+ g_variant_get(parameters, "(ii)", ¶m_uid, ¶m_pid);
+
+ WARN("unregister dnd app, uid : %d, param uid : %d, pid : %d, param pid : %d",
+ uid, param_uid, pid, param_pid);
+
+ if (sender == NULL)
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+
+ _unregister_dnd_app((int)pid);
+
+ *reply_body = g_variant_new("()");
+ if (*reply_body == NULL)
+ ERR("Failed to make reply_body");
+
+ return NOTIFICATION_ERROR_NONE;
+}
+
/* End of a file */