From 42bde89bae1f315177f654a1186101b3d3901c07 Mon Sep 17 00:00:00 2001 From: Ben Chan Date: Wed, 20 Sep 2017 22:23:17 -0700 Subject: [PATCH] mtk: port modem_after_sim_unlock to use GTask --- plugins/mtk/mm-broadband-modem-mtk.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/plugins/mtk/mm-broadband-modem-mtk.c b/plugins/mtk/mm-broadband-modem-mtk.c index 0d47a200..2927594b 100644 --- a/plugins/mtk/mm-broadband-modem-mtk.c +++ b/plugins/mtk/mm-broadband-modem-mtk.c @@ -147,14 +147,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; } @@ -163,15 +163,12 @@ 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); /* For device, 3 second is OK for SIM get ready */ - g_timeout_add_seconds (3, (GSourceFunc)after_sim_unlock_wait_cb, result); + g_timeout_add_seconds (3, (GSourceFunc)after_sim_unlock_wait_cb, task); } /*****************************************************************************/