iface-modem: allow initial signal check after the modem is re-enabled
Commit 708b00ae3
"modem: allow periodic signal check to be disabled"
added a "iface-modem-periodic-signal-check-disabled" property in
MMIfaceModem/MMBroadbandModem to indicate if the periodic signal check
should be disabled. If the property is set to TRUE, the
signal_quality_polling_supported field of SignalCheckContext is set to
FALSE, which is sticky across modem disable/enable operations. However,
that is undesirable as we would like to issue an initial signal check to
refresh the signal quality value after the modem is re-enabled from a
state when the RF may have been previously turned off.
This commit is contained in:

committed by
Aleksander Morgado

parent
5e5160c46a
commit
f9a0b945bc
@@ -1222,6 +1222,7 @@ signal_quality_check_ready (MMIfaceModem *self,
|
|||||||
static void
|
static void
|
||||||
peridic_signal_check_step (MMIfaceModem *self)
|
peridic_signal_check_step (MMIfaceModem *self)
|
||||||
{
|
{
|
||||||
|
gboolean periodic_signal_check_disabled = FALSE;
|
||||||
SignalCheckContext *ctx;
|
SignalCheckContext *ctx;
|
||||||
|
|
||||||
ctx = get_signal_check_context (self);
|
ctx = get_signal_check_context (self);
|
||||||
@@ -1284,17 +1285,12 @@ peridic_signal_check_step (MMIfaceModem *self)
|
|||||||
initial_check_done = ((signal_quality_ready && access_technology_ready) ||
|
initial_check_done = ((signal_quality_ready && access_technology_ready) ||
|
||||||
(--ctx->initial_retries == 0));
|
(--ctx->initial_retries == 0));
|
||||||
if (initial_check_done) {
|
if (initial_check_done) {
|
||||||
gboolean periodic_signal_check_disabled = FALSE;
|
/* After the initial check is done, check if periodic signal
|
||||||
|
* check is disabled. */
|
||||||
g_object_get (self,
|
g_object_get (self,
|
||||||
MM_IFACE_MODEM_PERIODIC_SIGNAL_CHECK_DISABLED,
|
MM_IFACE_MODEM_PERIODIC_SIGNAL_CHECK_DISABLED,
|
||||||
&periodic_signal_check_disabled,
|
&periodic_signal_check_disabled,
|
||||||
NULL);
|
NULL);
|
||||||
/* If periodic signal check is disabled, treat it as
|
|
||||||
* unsupported after the initial check is done. */
|
|
||||||
if (periodic_signal_check_disabled)
|
|
||||||
ctx->signal_quality_polling_supported = FALSE;
|
|
||||||
|
|
||||||
ctx->interval = SIGNAL_CHECK_TIMEOUT_SEC;
|
ctx->interval = SIGNAL_CHECK_TIMEOUT_SEC;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1302,7 +1298,8 @@ peridic_signal_check_step (MMIfaceModem *self)
|
|||||||
/* If both tasks are unsupported, implicitly disable. Do NOT clear the
|
/* If both tasks are unsupported, implicitly disable. Do NOT clear the
|
||||||
* values, because if we're told they are unsupported it may be that
|
* values, because if we're told they are unsupported it may be that
|
||||||
* they're really updated via unsolicited messages. */
|
* they're really updated via unsolicited messages. */
|
||||||
if (!ctx->access_technology_polling_supported && !ctx->signal_quality_polling_supported) {
|
if (!ctx->access_technology_polling_supported &&
|
||||||
|
(!ctx->signal_quality_polling_supported || periodic_signal_check_disabled)) {
|
||||||
mm_dbg ("Periodic signal and access technologies checks not supported");
|
mm_dbg ("Periodic signal and access technologies checks not supported");
|
||||||
periodic_signal_check_disable (self, FALSE);
|
periodic_signal_check_disable (self, FALSE);
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user