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:

committed by
Aleksander Morgado

parent
c61a7db1b6
commit
4e879cbede
@@ -1630,6 +1630,21 @@ static void periodic_signal_check_disable (MMIfaceModem *self,
|
|||||||
static gboolean periodic_signal_check_run (MMIfaceModem *self);
|
static gboolean periodic_signal_check_run (MMIfaceModem *self);
|
||||||
static void periodic_signal_check_step (GTask *task);
|
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
|
static void
|
||||||
load_access_technologies_ready (MMIfaceModem *self,
|
load_access_technologies_ready (MMIfaceModem *self,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
@@ -1739,8 +1754,7 @@ periodic_signal_check_step (GTask *task)
|
|||||||
* do anything else. */
|
* do anything else. */
|
||||||
if (!priv->signal_check_enabled) {
|
if (!priv->signal_check_enabled) {
|
||||||
mm_obj_dbg (self, "periodic signal quality and access technology checks not rescheduled: disabled");
|
mm_obj_dbg (self, "periodic signal quality and access technology checks not rescheduled: disabled");
|
||||||
g_task_return_boolean (task, FALSE);
|
periodic_signal_check_complete (task);
|
||||||
g_object_unref (task);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1781,8 +1795,7 @@ periodic_signal_check_step (GTask *task)
|
|||||||
self);
|
self);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_task_return_boolean (task, TRUE);
|
periodic_signal_check_complete (task);
|
||||||
g_object_unref (task);
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -1808,6 +1821,9 @@ periodic_signal_check_run (MMIfaceModem *self)
|
|||||||
ctx->access_technologies_mask = MM_MODEM_ACCESS_TECHNOLOGY_ANY;
|
ctx->access_technologies_mask = MM_MODEM_ACCESS_TECHNOLOGY_ANY;
|
||||||
g_task_set_task_data (task, ctx, (GDestroyNotify) g_free);
|
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);
|
periodic_signal_check_step (task);
|
||||||
|
|
||||||
/* Reset the source id as we're removing the timeout source */
|
/* 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");
|
mm_obj_dbg (self, "periodic signal check refresh requested");
|
||||||
priv->signal_check_running = TRUE;
|
|
||||||
|
|
||||||
/* Remove the scheduled timeout as we're going to refresh
|
/* Remove the scheduled timeout as we're going to refresh
|
||||||
* right away */
|
* right away */
|
||||||
|
Reference in New Issue
Block a user