iface-modem: fix incorrectly halted periodic signal checks

Whenever an explicit signal refresh was requested we would flag the
check as ongoing but never reset the flag, so it would never attempt
to reload it again.

Fixes 0080ed612d
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/702
This commit is contained in:
Aleksander Morgado
2023-04-10 09:13:37 +00:00
committed by Aleksander Morgado
parent c61a7db1b6
commit 4e879cbede

View File

@@ -1630,6 +1630,21 @@ static void periodic_signal_check_disable (MMIfaceModem *self,
static gboolean periodic_signal_check_run (MMIfaceModem *self);
static void periodic_signal_check_step (GTask *task);
static void
periodic_signal_check_complete (GTask *task)
{
MMIfaceModem *self;
Private *priv;
self = g_task_get_source_object (task);
priv = get_private (self);
g_assert (priv->signal_check_running);
priv->signal_check_running = FALSE;
g_task_return_boolean (task, TRUE);
g_object_unref (task);
}
static void
load_access_technologies_ready (MMIfaceModem *self,
GAsyncResult *res,
@@ -1739,8 +1754,7 @@ periodic_signal_check_step (GTask *task)
* do anything else. */
if (!priv->signal_check_enabled) {
mm_obj_dbg (self, "periodic signal quality and access technology checks not rescheduled: disabled");
g_task_return_boolean (task, FALSE);
g_object_unref (task);
periodic_signal_check_complete (task);
return;
}
@@ -1781,8 +1795,7 @@ periodic_signal_check_step (GTask *task)
self);
}
g_task_return_boolean (task, TRUE);
g_object_unref (task);
periodic_signal_check_complete (task);
return;
default:
@@ -1808,6 +1821,9 @@ periodic_signal_check_run (MMIfaceModem *self)
ctx->access_technologies_mask = MM_MODEM_ACCESS_TECHNOLOGY_ANY;
g_task_set_task_data (task, ctx, (GDestroyNotify) g_free);
g_assert (!priv->signal_check_running);
priv->signal_check_running = TRUE;
periodic_signal_check_step (task);
/* Reset the source id as we're removing the timeout source */
@@ -1836,7 +1852,6 @@ mm_iface_modem_refresh_signal (MMIfaceModem *self)
}
mm_obj_dbg (self, "periodic signal check refresh requested");
priv->signal_check_running = TRUE;
/* Remove the scheduled timeout as we're going to refresh
* right away */