Improvements in SIM swap detection during quick sync after suspend/resume
Some things that came up during the discussion of !842 (merged) and !843 (merged).
- The changes in !843 (merged) introduced new logic to report that a quick sync is going to happen after a suspend/resume, via a new "SYNC_NEEDED" signal in the modem object. Objects needing to know when to sync (those objects caching info internally) would connect to that signal. Right now there is only one object needing this, the MMSimMbim, but this could definitely be handled in a stricter way just by adding a new step in the sync state machine, so that as soon as the sync is started we:
- Call a new sync_needed() method in the modem object (if set), so that modem objects needing to know when the sync happens can subclass it.
- Call a new sync_needed() method in the SIM objects (if set), so that the SIM objects needing to know when the sync happens can subclass it.
- Call a new sync_needed() method in the bearer objects (if set), so that the bearer objects needing to know when the sync happens can subclass it.
-
The
modem_check_for_sim_swap()
implementation inmm-broadband-modem.c
attempts to check whether a SIM swap has happened based on loading IMSI and ICCID and comparing them with what we had before in the DBus interface. This step right now assumes that a failure loading IMSI/ICCID (except for UNSUPPORTED) means that there is no longer a SIM in the slot. We could improve this adding a previous step that attempts to first check whether there is a SIM in the slot before attempting to load IMSI or ICCID. -
Reduce the amount of retries to detect whether there is a SIM card. If we add the new step to check if a SIM is available in
modem_check_for_sim_swap()
, the retries would go in that step. But if we're running a quick sync after suspend/resume we may decide to just attempt to check once, without retries, because the modem wasn't powered off during suspension (which is an assumption done in the quick sync case).