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.
This commit is contained in:
Dylan Van Assche
2021-01-31 15:38:31 +01:00
committed by Aleksander Morgado
parent 12329ac788
commit 7159b8e27a
3 changed files with 32 additions and 7 deletions

View File

@@ -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