diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-03-16 15:38:09 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-03-16 15:38:09 +0100 |
commit | 6bb90d92e47fb432b4916f0cb6521f541ffa0647 (patch) | |
tree | 9f28107a5f21566fbb1848c6fc137b25e957cc71 /src/mm-iface-modem-simple.c | |
parent | 295272196dbdf256a7378066889fc89b855b1777 (diff) |
iface-modem-simple: try to skip initial steps in the Simple Connect sequence
Diffstat (limited to 'src/mm-iface-modem-simple.c')
-rw-r--r-- | src/mm-iface-modem-simple.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mm-iface-modem-simple.c b/src/mm-iface-modem-simple.c index bfc0e260..c735ce09 100644 --- a/src/mm-iface-modem-simple.c +++ b/src/mm-iface-modem-simple.c @@ -577,6 +577,7 @@ connect_auth_ready (MMBaseModem *self, ConnectionContext *ctx) { GError *error = NULL; + MMModemState current = MM_MODEM_STATE_UNKNOWN; if (!mm_base_modem_authorize_finish (self, res, &error)) { g_dbus_method_invocation_take_error (ctx->invocation, error); @@ -591,8 +592,18 @@ connect_auth_ready (MMBaseModem *self, return; } - /* Start */ - ctx->step = CONNECTION_STEP_FIRST; + /* We may be able to skip some steps, so check that before doing anything */ + g_object_get (self, + MM_IFACE_MODEM_STATE, ¤t, + NULL); + + if (current >= MM_MODEM_STATE_ENABLED) + ctx->step = CONNECTION_STEP_ENABLE + 1; + else if (current >= MM_MODEM_STATE_DISABLED) + ctx->step = CONNECTION_STEP_UNLOCK_CHECK + 1; + else + ctx->step = CONNECTION_STEP_FIRST; + connection_step (ctx); } |