diff options
author | Ben Chan <benchan@chromium.org> | 2017-07-18 00:50:07 -0700 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2017-09-08 17:45:28 +0200 |
commit | 36d975bd4e6624e2ade0ff177632a889761849b1 (patch) | |
tree | b31da841d8c9cad43ccd0ac632a39e12dd5b8511 | |
parent | 0aae6d3e35769a8af15bfe7cb3d89fb486d32f1d (diff) |
huawei: port modem_after_sim_unlock to use GTask
-rw-r--r-- | plugins/huawei/mm-broadband-modem-huawei.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/plugins/huawei/mm-broadband-modem-huawei.c b/plugins/huawei/mm-broadband-modem-huawei.c index 8d26f773..bb1ca613 100644 --- a/plugins/huawei/mm-broadband-modem-huawei.c +++ b/plugins/huawei/mm-broadband-modem-huawei.c @@ -711,14 +711,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; } @@ -727,16 +727,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, or the firmware may * fail miserably and reboot itself */ - g_timeout_add_seconds (3, (GSourceFunc)after_sim_unlock_wait_cb, result); + g_timeout_add_seconds (3, (GSourceFunc)after_sim_unlock_wait_cb, task); } /*****************************************************************************/ |