suspend: handle case when MM doesn't manage suspend/resume

This commit is contained in:
Arnaud Ferraris
2021-01-23 11:14:41 +01:00
parent 31133affa0
commit 692f9134f8

View File

@@ -99,10 +99,20 @@ static void signal_cb(GDBusProxy *proxy,
g_message("system is resuming"); g_message("system is resuming");
take_inhibitor(manager); take_inhibitor(manager);
modem_resume_pre(manager); modem_resume_pre(manager);
if (manager->mm_modem) {
/*
* On some systems ModemManager doesn't handle suspend/resume, so
* we still have a valid/managed modem when resuming. In this case,
* do the whole resume sequence immediately.
*/
manager->modem_state = EG25_STATE_CONFIGURED;
modem_resume_post(manager);
} else {
manager->modem_state = EG25_STATE_RESUMING; manager->modem_state = EG25_STATE_RESUMING;
manager->suspend_timer = g_timeout_add_seconds(9, G_SOURCE_FUNC(check_modem_resume), manager); manager->suspend_timer = g_timeout_add_seconds(9, G_SOURCE_FUNC(check_modem_resume), manager);
} }
} }
}
static void name_owner_cb(GObject *object, static void name_owner_cb(GObject *object,
GParamSpec *pspec, GParamSpec *pspec,