aboutsummaryrefslogtreecommitdiff
path: root/src/mm-iface-modem.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-07-22 00:21:07 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-07-22 13:39:35 +0200
commit79fbe274e92605f7d31de3e4588dd4848bc6e797 (patch)
treee9c009c4131124e4a4111a55b09d7b89e9251784 /src/mm-iface-modem.c
parent2aceb907f4b1bc892874627f94586deff6c6808e (diff)
iface-modem: new async method to be run just after the successful SIM unlock
Diffstat (limited to 'src/mm-iface-modem.c')
-rw-r--r--src/mm-iface-modem.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c
index 3373b5ba..f9266a4c 100644
--- a/src/mm-iface-modem.c
+++ b/src/mm-iface-modem.c
@@ -1972,12 +1972,41 @@ reinitialize_ready (MMBaseModem *self,
}
}
-static gboolean
-restart_initialize_idle (MMIfaceModem *self)
+static void
+modem_after_sim_unlock_ready (MMIfaceModem *self,
+ GAsyncResult *res)
{
+ GError *error = NULL;
+
+ if (!MM_IFACE_MODEM_GET_INTERFACE (self)->modem_after_sim_unlock_finish (self, res, &error)) {
+ mm_warn ("After SIM unlock failed setup: '%s'", error->message);
+ g_error_free (error);
+ }
+
+ /* Go on */
mm_base_modem_initialize (MM_BASE_MODEM (self),
(GAsyncReadyCallback) reinitialize_ready,
NULL);
+}
+
+static gboolean
+restart_initialize_idle (MMIfaceModem *self)
+{
+ /* If we were asked to run something after having sent the PIN unlock,
+ * do it now. This may be just a timeout or some other command that gives us
+ * the real SIM state */
+ if (MM_IFACE_MODEM_GET_INTERFACE (self)->modem_after_sim_unlock != NULL &&
+ MM_IFACE_MODEM_GET_INTERFACE (self)->modem_after_sim_unlock_finish != NULL) {
+ MM_IFACE_MODEM_GET_INTERFACE (self)->modem_after_sim_unlock(
+ self,
+ (GAsyncReadyCallback)modem_after_sim_unlock_ready,
+ NULL);
+ } else {
+ /* If no wait needed, just go on */
+ mm_base_modem_initialize (MM_BASE_MODEM (self),
+ (GAsyncReadyCallback) reinitialize_ready,
+ NULL);
+ }
return FALSE;
}