summaryrefslogtreecommitdiff
path: root/src/up-backend.h
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2012-07-11 15:06:04 +0100
committerRichard Hughes <richard@hughsie.com>2012-07-11 18:11:39 +0100
commit44189f8129edff56668cad6846579adc0e64f8f3 (patch)
treecd59904458b38f983769ddcf64837eeb24422219 /src/up-backend.h
parent7bad068a2d9fbbd509d0a53bcf6c2ffde6a4ef77 (diff)
Use systemd for suspend and hibernate
When running under systemd, call into systemd for suspend and hibernate instead of pm-utils. To capture resume events, install a small script that gets executed by systemd after resume and sends a dbus signal back to upower. To make this work, the upower backends gain a new signal, ::resuming, that they can optionally emit to signal that a resume happened. Backends opt in to this by returning TRUE from up_backend_emits_resuming(). In this case, upower doesn't assume the sleep command to block until resume, but instead waits for the ::resuming signal from the backend. The only backend that uses this mechanism is the linux backend when built with systemd support. Signed-off-by: Richard Hughes <richard@hughsie.com>
Diffstat (limited to 'src/up-backend.h')
-rw-r--r--src/up-backend.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/up-backend.h b/src/up-backend.h
index 154e2c6..08dac8b 100644
--- a/src/up-backend.h
+++ b/src/up-backend.h
@@ -59,6 +59,7 @@ typedef struct
void (* device_removed) (UpBackend *backend,
GObject *native,
UpDevice *device);
+ void (* resuming) (UpBackend *backend);
} UpBackendClass;
GType up_backend_get_type (void);
@@ -75,6 +76,7 @@ const gchar *up_backend_get_suspend_command (UpBackend *backend);
const gchar *up_backend_get_hibernate_command (UpBackend *backend);
const gchar *up_backend_get_powersave_command (UpBackend *backend,
gboolean powersave);
+gboolean up_backend_emits_resuming (UpBackend *backend);
G_END_DECLS