diff options
author | Ben Chan <benchan@chromium.org> | 2018-04-24 17:18:56 -0700 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2018-04-25 10:34:35 +0200 |
commit | f9a0b945bcc0b374a122e6cdd4ac6ce92066c7c8 (patch) | |
tree | 633610e31ecc6122a1bbd25458d40a2b503c6ad3 /src | |
parent | 5e5160c46ad426233123287c0505253e4ea3ff35 (diff) |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-iface-modem.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c index b1224428..11bdf1f6 100644 --- a/src/mm-iface-modem.c +++ b/src/mm-iface-modem.c @@ -1222,6 +1222,7 @@ signal_quality_check_ready (MMIfaceModem *self, static void peridic_signal_check_step (MMIfaceModem *self) { + gboolean periodic_signal_check_disabled = FALSE; SignalCheckContext *ctx; 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) || (--ctx->initial_retries == 0)); 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, MM_IFACE_MODEM_PERIODIC_SIGNAL_CHECK_DISABLED, &periodic_signal_check_disabled, 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; } } @@ -1302,7 +1298,8 @@ peridic_signal_check_step (MMIfaceModem *self) /* If both tasks are unsupported, implicitly disable. Do NOT clear the * values, because if we're told they are unsupported it may be that * 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"); periodic_signal_check_disable (self, FALSE); return; |