From 44289da5316d8a90d6016d181d828d754a4e2096 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Wed, 4 Jan 2012 18:36:55 +0100 Subject: [PATCH] iface-modem-cdma: run all registration checks during CDMA interface enable --- src/mm-iface-modem-cdma.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/mm-iface-modem-cdma.c b/src/mm-iface-modem-cdma.c index b079b33f..0bad7faa 100644 --- a/src/mm-iface-modem-cdma.c +++ b/src/mm-iface-modem-cdma.c @@ -889,6 +889,7 @@ static void interface_enabling_step (EnablingContext *ctx); typedef enum { ENABLING_STEP_FIRST, + ENABLING_STEP_RUN_ALL_REGISTRATION_CHECKS, ENABLING_STEP_LAST } EnablingStep; @@ -942,6 +943,26 @@ mm_iface_modem_cdma_enable_finish (MMIfaceModemCdma *self, return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error); } +static void +run_all_registration_checks_ready (MMIfaceModemCdma *self, + GAsyncResult *res, + EnablingContext *ctx) +{ + GError *error = NULL; + + if (!mm_iface_modem_cdma_run_all_registration_checks_finish (self, + res, + &error)) { + g_simple_async_result_take_error (ctx->result, error); + enabling_context_complete_and_free (ctx); + return; + } + + /* Go on to next step */ + ctx->step++; + interface_enabling_step (ctx); +} + static void interface_enabling_step (EnablingContext *ctx) { @@ -950,6 +971,12 @@ interface_enabling_step (EnablingContext *ctx) /* Fall down to next step */ ctx->step++; + case ENABLING_STEP_RUN_ALL_REGISTRATION_CHECKS: + mm_iface_modem_cdma_run_all_registration_checks (ctx->self, + (GAsyncReadyCallback)run_all_registration_checks_ready, + ctx); + return; + case ENABLING_STEP_LAST: /* We are done without errors! */ g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE);