diff options
author | Ben Chan <benchan@chromium.org> | 2017-10-06 15:19:05 -0700 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2017-10-07 10:39:47 +0200 |
commit | 7dc46481c51b189eac9c48c2488ab8bc25290766 (patch) | |
tree | fbcab0127311b5c79e4af5054ffec1a41f4c6a56 | |
parent | f8a375b1fa3c9d5f8b3f0a7f39d0576baa01436c (diff) |
pantech: port modem_after_sim_unlock to use GTask
-rw-r--r-- | plugins/pantech/mm-broadband-modem-pantech.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/plugins/pantech/mm-broadband-modem-pantech.c b/plugins/pantech/mm-broadband-modem-pantech.c index 878806d7..cd18e14c 100644 --- a/plugins/pantech/mm-broadband-modem-pantech.c +++ b/plugins/pantech/mm-broadband-modem-pantech.c @@ -114,14 +114,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; } @@ -130,15 +130,10 @@ modem_after_sim_unlock (MMIfaceModem *self, GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; - - result = g_simple_async_result_new (G_OBJECT (self), - callback, - user_data, - modem_after_sim_unlock); - /* wait so sim pin is done */ - g_timeout_add_seconds (5, (GSourceFunc)after_sim_unlock_wait_cb, result); + g_timeout_add_seconds (5, + (GSourceFunc)after_sim_unlock_wait_cb, + g_task_new (self, NULL, callback, user_data)); } /*****************************************************************************/ |