aboutsummaryrefslogtreecommitdiff
path: root/src/mm-iface-modem.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2022-05-20 14:31:49 +0200
committerAleksander Morgado <aleksander@aleksander.es>2022-05-25 11:14:45 +0200
commit234f185c3a7731f858dac6c82339711806376472 (patch)
tree70b31a9ba01fe77d19b7758f58671abba9ecfac4 /src/mm-iface-modem.c
parent012303013699bf23fde74a3ecb067c5c3a011554 (diff)
iface-modem: fail initialization if eSIM without profiles
A modem using an eSIM without profiles should not be allowed to get enabled, it should be really treated as a modem without a physical SIM.
Diffstat (limited to 'src/mm-iface-modem.c')
-rw-r--r--src/mm-iface-modem.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c
index 02849048..41f220b3 100644
--- a/src/mm-iface-modem.c
+++ b/src/mm-iface-modem.c
@@ -4711,6 +4711,7 @@ typedef enum {
INITIALIZATION_STEP_SIM,
INITIALIZATION_STEP_SETUP_CARRIER_CONFIG,
INITIALIZATION_STEP_OWN_NUMBERS,
+ INITIALIZATION_STEP_VALIDATE_ESIM_STATUS,
INITIALIZATION_STEP_LAST
} InitializationStep;
@@ -6011,6 +6012,24 @@ interface_initialization_step (GTask *task)
ctx->step++;
/* fall-through */
+ case INITIALIZATION_STEP_VALIDATE_ESIM_STATUS: {
+ 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 transition to FAILED
+ * status because the modem is really unusable. */
+ if (sim && mm_base_sim_is_esim_without_profiles (sim)) {
+ g_clear_error (&ctx->fatal_error);
+ ctx->fatal_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_WRONG_SIM_STATE,
+ "eSIM without profiles detected");
+ }
+
+ ctx->step++;
+ } /* fall-through */
+
case INITIALIZATION_STEP_LAST:
/* Setup all method handlers */
g_object_connect (ctx->skeleton,