{
struct module_ops *module;
GSList *list_iter;
- GVariantBuilder builder;
+ GVariantBuilder builder, *sub_builder;
g_variant_builder_init(&builder, G_VARIANT_TYPE_TUPLE);
+ sub_builder = g_variant_builder_new(G_VARIANT_TYPE("as"));
gslist_for_each_item(list_iter, modules_list) {
module = (struct module_ops *)list_iter->data;
if (module->initalized != MODULE_INITIALIZED)
continue;
- g_variant_builder_add(&builder, "s", module->name);
+ g_variant_builder_add(sub_builder, "s", module->name);
}
+ g_variant_builder_add_value(&builder, g_variant_new("as", sub_builder));
+ g_variant_builder_unref(sub_builder);
g_dbus_method_invocation_return_value(invocation,
g_variant_builder_end(&builder));
static void resourced_freezer_dbus_method_handler_generic(
GDBusMethodInvocation *invocation, GVariant *params)
{
- /* FREEZER_SUSPEND method can be used when suspend mode is enabled */
- if (resourced_freezer_is_suspended) {
- if (!g_strcmp0(g_dbus_method_invocation_get_method_name(invocation),
- METHOD_SET_FREEZER_SUSPEND) && !resourced_freezer_is_suspended())
- g_dbus_method_invocation_return_value(invocation,
- g_variant_new("(i)", -1));
- }
-
if (resourced_freezer_dbus_method_handler)
resourced_freezer_dbus_method_handler(invocation, params);
+ else
+ g_dbus_method_invocation_return_value(invocation, g_variant_new("(i)", 0));
}
static const char dbus_methods_xml[] =
" </interface>"
"</node>";
-static int num_methods;
+static int num_methods = 2;
static char dbus_methods_xml_body[MAX_XML_LEN];
static struct d_bus_method dbus_methods[128] = {
{ "UpdateDataList", dbus_update_data_list },
g_strlcat(dbus_methods_xml, dbus_methods_xml_suffix, MAX_XML_LEN);
return d_bus_register_methods(RESOURCED_PATH_LOGGING, dbus_methods_xml,
- dbus_methods, ARRAY_SIZE(dbus_methods));
+ dbus_methods, num_methods);
}
" <arg type='u' name='MemSwap' direction='out'/>"
" </method>"
" <method name='ReclaimMemory'>"
+" <arg type='i' name='ZeroOnSuccess' direction='out'/>"
" </method>"
" <method name='PrePoweroff'>"
+" <arg type='i' name='MinusOne' direction='out'/>"
" </method>"
/* Following functions are defined in proc-usage-stats.c */
" <method name='ProcMemoryUsage'>"