aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-02-29 19:36:52 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-16 14:53:19 +0100
commit491d8e03f99baded9f59a97daddc06cd223ef4bd (patch)
tree5cea3ba55cba2055f0f94844d2e2f09bac14db06 /src
parenta797d6d68382b546e8b6e22f4f533cc44a7ac7ee (diff)
iface-modem-3gpp: update facilities mask when SIM PIN lock enabling status changes
Diffstat (limited to 'src')
-rw-r--r--src/mm-iface-modem-3gpp.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/mm-iface-modem-3gpp.c b/src/mm-iface-modem-3gpp.c
index f2757a4c..84b12cbb 100644
--- a/src/mm-iface-modem-3gpp.c
+++ b/src/mm-iface-modem-3gpp.c
@@ -1580,6 +1580,22 @@ initialization_context_complete_and_free (InitializationContext *ctx)
}
static void
+sim_pin_lock_enabled_cb (MMSim *self,
+ gboolean enabled,
+ MmGdbusModem3gpp *skeleton)
+{
+ MMModem3gppFacility facilities;
+
+ facilities = mm_gdbus_modem3gpp_get_enabled_facility_locks (skeleton);
+ if (enabled)
+ facilities |= MM_MODEM_3GPP_FACILITY_SIM;
+ else
+ facilities &= ~MM_MODEM_3GPP_FACILITY_SIM;
+
+ mm_gdbus_modem3gpp_set_enabled_facility_locks (skeleton, facilities);
+}
+
+static void
load_enabled_facility_locks_ready (MMIfaceModem3gpp *self,
GAsyncResult *res,
InitializationContext *ctx)
@@ -1593,6 +1609,21 @@ load_enabled_facility_locks_ready (MMIfaceModem3gpp *self,
if (error) {
mm_warn ("couldn't load facility locks: '%s'", error->message);
g_error_free (error);
+ } else {
+ MMSim *sim = NULL;
+
+ /* We loaded the initial list of facility locks; but we do need to update
+ * the SIM PIN lock status when that changes. We'll connect to the signal
+ * which notifies about such update. There is no need to ref self as the
+ * SIM itself is an object which exists as long as self exists. */
+ g_object_get (self,
+ MM_IFACE_MODEM_SIM, &sim,
+ NULL);
+ g_signal_connect (sim,
+ MM_SIM_PIN_LOCK_ENABLED,
+ G_CALLBACK (sim_pin_lock_enabled_cb),
+ ctx->skeleton);
+ g_object_unref (sim);
}
/* Go on to next step */