diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-03-09 19:48:43 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-03-16 14:53:24 +0100 |
commit | d27e40ae9aea1166831920a92d4eba4f3f51605d (patch) | |
tree | 8afa0f609852eb5a501bdd98e56c7f012e34a007 /src/mm-sim.c | |
parent | 6de2e3f72cb058ce31b93274ede144d95c5440bc (diff) |
core: new `Initializing' state in the global modem state machine
We need to define a state to be used while the modem is being initialized, so
that we forbid any operation on the modem on already exported interfaces, while
there are interfaces pending to get exported.
This Initializing state will also cover the state between having the SIM
unlocked (which launches re-initialization) and being completely initialized.
Diffstat (limited to 'src/mm-sim.c')
-rw-r--r-- | src/mm-sim.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mm-sim.c b/src/mm-sim.c index 573fc24a..57ffee21 100644 --- a/src/mm-sim.c +++ b/src/mm-sim.c @@ -489,11 +489,15 @@ typedef struct { MMSim *self; GSimpleAsyncResult *result; GError *save_error; + gulong wait_for_unlock_id; } SendPinPukContext; static void send_pin_puk_context_complete_and_free (SendPinPukContext *ctx) { + if (ctx->wait_for_unlock_id) + g_signal_handler_disconnect (ctx->self->priv->modem, + ctx->wait_for_unlock_id); if (ctx->save_error) g_error_free (ctx->save_error); g_simple_async_result_complete (ctx->result); @@ -568,16 +572,17 @@ unlock_check_ready (MMIfaceModem *modem, g_simple_async_result_take_error (ctx->result, ctx->save_error); ctx->save_error = NULL; g_clear_error (&error); - } - else if (error) + } else if (error) g_simple_async_result_take_error (ctx->result, error); else g_simple_async_result_take_error (ctx->result, error_for_unlock_check (lock)); - } else - g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); + send_pin_puk_context_complete_and_free (ctx); + } + g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE); send_pin_puk_context_complete_and_free (ctx); + return; } static void |