diff options
author | Ben Chan <benchan@chromium.org> | 2017-09-12 04:39:42 -0700 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2017-09-13 16:36:49 +0200 |
commit | b56ea695896b5290e27b1a2d0b13fb07c005df56 (patch) | |
tree | f7f817fa1e730822a99f5c59aad1dd93db3b98e0 | |
parent | ced9264a1c0c48cc5eb6ec6223bf1ef49f644a13 (diff) |
novatel-lte: port modem_after_sim_unlock to use GTask
-rw-r--r-- | plugins/novatel/mm-broadband-modem-novatel-lte.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/plugins/novatel/mm-broadband-modem-novatel-lte.c b/plugins/novatel/mm-broadband-modem-novatel-lte.c index 2bba5139..9a790e36 100644 --- a/plugins/novatel/mm-broadband-modem-novatel-lte.c +++ b/plugins/novatel/mm-broadband-modem-novatel-lte.c @@ -138,14 +138,14 @@ modem_after_sim_unlock_finish (MMIfaceModem *self, GAsyncResult *res, GError **error) { - return TRUE; + return g_task_propagate_boolean (G_TASK (res), error); } static gboolean -after_sim_unlock_wait_cb (GSimpleAsyncResult *result) +after_sim_unlock_wait_cb (GTask *task) { - g_simple_async_result_complete (result); - g_object_unref (result); + g_task_return_boolean (task, TRUE); + g_object_unref (task); return G_SOURCE_REMOVE; } @@ -154,16 +154,13 @@ modem_after_sim_unlock (MMIfaceModem *self, GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GTask *task; - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_after_sim_unlock); + task = g_task_new (self, NULL, callback, user_data); /* A 3-second wait is necessary for SIM to become ready. * Otherwise, a subsequent AT+CRSM command will likely fail. */ - g_timeout_add_seconds (3, (GSourceFunc)after_sim_unlock_wait_cb, result); + g_timeout_add_seconds (3, (GSourceFunc)after_sim_unlock_wait_cb, task); } /*****************************************************************************/ |