From 5014cf39767a24109de945d99c6b9f4bb1b07274 Mon Sep 17 00:00:00 2001 From: Carlo Lobrano Date: Tue, 29 Aug 2017 09:15:52 +0200 Subject: [PATCH] broadband-modem: do not release SIM swap port contexts on disable Currently when the modem is disabled, it releases SIM hot swap ports context, and is not able to receive any notification about the SIM status. This patch keeps these ports opened when Modem is disabled and released them only when SIM swap is detected or when modem is released. --- src/mm-broadband-modem.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c index 552bdc5f..3d96372a 100644 --- a/src/mm-broadband-modem.c +++ b/src/mm-broadband-modem.c @@ -8640,10 +8640,6 @@ disabling_stopped (MMBroadbandModem *self, self->priv->enabled_ports_ctx = NULL; } - if (self->priv->sim_hot_swap_ports_ctx) { - ports_context_unref (self->priv->sim_hot_swap_ports_ctx); - self->priv->sim_hot_swap_ports_ctx = NULL; - } return TRUE; } @@ -10661,6 +10657,9 @@ finalize (GObject *object) if (self->priv->enabled_ports_ctx) ports_context_unref (self->priv->enabled_ports_ctx); + if (self->priv->sim_hot_swap_ports_ctx) + ports_context_unref (self->priv->sim_hot_swap_ports_ctx); + if (self->priv->modem_3gpp_registration_regex) mm_3gpp_creg_regex_destroy (self->priv->modem_3gpp_registration_regex);