diff options
author | Jack Song <jinjian.song@fibocom.com> | 2022-09-19 16:11:48 +0800 |
---|---|---|
committer | Jack Song <jinjian.song@fibocom.com> | 2022-09-19 16:11:48 +0800 |
commit | ab80c31898a9701de2a72648d18e8ac7acb2d028 (patch) | |
tree | 4973533479c172d912ae34ad5ce90bb78aab6998 /src | |
parent | 4ab2c80858e207871d0bdc377988c0c66fb86f07 (diff) |
mm-iface-modem: don't attempt to check lock status when current active slot have eSIM without profiles
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/630
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-iface-modem.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c index 7e892d51..c9d16190 100644 --- a/src/mm-iface-modem.c +++ b/src/mm-iface-modem.c @@ -5905,17 +5905,28 @@ interface_initialization_step (GTask *task) ctx->step++; /* fall-through */ - case INITIALIZATION_STEP_UNLOCK_REQUIRED: - /* Only check unlock required if we were previously not unlocked */ - if (mm_gdbus_modem_get_unlock_required (ctx->skeleton) != MM_MODEM_LOCK_NONE) { - mm_iface_modem_update_lock_info (self, - MM_MODEM_LOCK_UNKNOWN, /* ask */ - (GAsyncReadyCallback)modem_update_lock_info_ready, - task); - return; + case INITIALIZATION_STEP_UNLOCK_REQUIRED: { + g_autoptr(MMBaseSim) sim = NULL; + + g_object_get (self, + MM_IFACE_MODEM_SIM, &sim, + NULL); + /* If the current SIM is an eSIM without profiles, we ignore + * unlock required. */ + if (sim && mm_base_sim_is_esim_without_profiles (sim)) + mm_obj_dbg (self, "not unlock required: eSIM without profiles"); + else { + /* Only check unlock required if we were previously not unlocked */ + if (mm_gdbus_modem_get_unlock_required (ctx->skeleton) != MM_MODEM_LOCK_NONE) { + mm_iface_modem_update_lock_info (self, + MM_MODEM_LOCK_UNKNOWN, /* ask */ + (GAsyncReadyCallback)modem_update_lock_info_ready, + task); + return; + } } ctx->step++; - /* fall-through */ + } /* fall-through */ case INITIALIZATION_STEP_SIM: /* If the modem doesn't need any SIM (not implemented by plugin, or not |