static void proc_dbus_exclude_signal_handler(GVariant *params)
{
- char *str = NULL;
+ const char *str = NULL;
pid_t pid = 0;
struct proc_exclude pe;
int len;
return;
}
+static void proc_dbus_exclude_method_handler(GDBusMethodInvocation *invocation, GVariant *params)
+{
+ const char *str = NULL;
+ pid_t pid = 0;
+
+ g_variant_get(params, "(&si)", &str, &pid);
+ if (!str || pid == 0) {
+ _E("invalid parameters");
+ g_dbus_method_invocation_return_error(invocation,
+ G_DBUS_ERROR,
+ G_DBUS_ERROR_INVALID_ARGS,
+ "invalid arguments");
+ return;
+ }
+ proc_dbus_exclude_signal_handler(params);
+ D_BUS_REPLY_NULL(invocation);
+}
+
static void proc_dbus_exclude_appid_signal_handler(GVariant *params)
{
char *str = NULL;
" <method name='PrePoweroff'>"
" <arg type='i' name='MinusOne' direction='out'/>"
" </method>"
+" <method name='ProcExclude'>"
+" <arg type='s' name='Action' direction='in'/>"
+" <arg type='i' name='PID' direction='in'/>"
+" </method>"
/* Following functions are defined in proc-usage-stats.c */
" <method name='ProcMemoryUsage'>"
" <arg type='ai' name='ProcList' direction='in'/>"
{ "GetMemInfo", dbus_get_meminfo },
{ "ReclaimMemory", dbus_reclaim_memory },
{ "PrePoweroff", dbus_pre_poweroff },
+ { "ProcExclude", proc_dbus_exclude_method_handler},
/* Following functions are defined in proc-usage-stats.c */
{ "ProcMemoryUsage", dbus_proc_memory_usage },
{ "ProcCpuUsage", dbus_proc_cpu_usage },