From f667898ecac27906fae9dfa526b799b0c81221f6 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Wed, 24 Oct 2012 16:22:55 +0200 Subject: [PATCH] iface-modem: ignore registration-related state changes if enabling or disabling --- src/mm-iface-modem.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c index 873ad6f7..12cdd602 100644 --- a/src/mm-iface-modem.c +++ b/src/mm-iface-modem.c @@ -1329,11 +1329,22 @@ mm_iface_modem_update_subsystem_state (MMIfaceModem *self, MMModemStateChangeReason reason) { MMModemState consolidated; + MMModemState state = MM_MODEM_STATE_UNKNOWN; + + g_object_get (self, + MM_IFACE_MODEM_STATE, &state, + NULL); /* We may have different subsystems being handled (e.g. 3GPP and CDMA), and * the registration status value is unique, so if we get subsystem-specific * state updates, we'll need to merge all to get a consolidated one. */ consolidated = get_updated_consolidated_state (self, subsystem, new_state); + + /* Don't update registration-related states while disabling/enabling */ + if (state == MM_MODEM_STATE_ENABLING || + state == MM_MODEM_STATE_DISABLING) + return; + mm_iface_modem_update_state (self, consolidated, reason); }