aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorDylan Van Assche <me@dylanvanassche.be>2021-01-31 15:38:31 +0100
committerAleksander Morgado <aleksander@aleksander.es>2021-02-14 12:27:42 +0000
commit7159b8e27ac47af706e0c2e4d4f77460dce7881e (patch)
tree2d1ed7308ee61cde38a1506f57948fc5f08fffd4 /src/main.c
parent12329ac7880b5a43eed8b7b2c4b932c544f43898 (diff)
context: add test-no-suspend-resume cli parameter
Disables suspend/resume support at runtime. This is useful for modems which are never turned off or suspended when the host suspends.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index 9963c7cc..928078a3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -195,9 +195,13 @@ main (int argc, char *argv[])
{
MMSleepMonitor *sleep_monitor;
- sleep_monitor = mm_sleep_monitor_get ();
- g_signal_connect (sleep_monitor, MM_SLEEP_MONITOR_SLEEPING, G_CALLBACK (sleeping_cb), NULL);
- g_signal_connect (sleep_monitor, MM_SLEEP_MONITOR_RESUMING, G_CALLBACK (resuming_cb), NULL);
+ if (mm_context_get_test_no_suspend_resume())
+ mm_dbg ("Suspend/resume support disabled at runtime");
+ else {
+ sleep_monitor = mm_sleep_monitor_get ();
+ g_signal_connect (sleep_monitor, MM_SLEEP_MONITOR_SLEEPING, G_CALLBACK (sleeping_cb), NULL);
+ g_signal_connect (sleep_monitor, MM_SLEEP_MONITOR_RESUMING, G_CALLBACK (resuming_cb), NULL);
+ }
}
#endif