base-modem: fix modem_sync() operation handling

The mm_base_modem_sync() method is an asynchronous method that
receives a callback and user data, and therefore we MUST always
complete the async method calling that callback. Set that up with a
GTask as usual.

Also, the mm_base_modem_sync_finish() method should be implemented
along with mm_base_modem_sync(), not in the source file of the
caller of the async method. The finish() always depends on how the
async method was implemented, in our case using a GTask.
This commit is contained in:
Aleksander Morgado
2021-05-23 12:19:06 +02:00
parent 6397aacfdb
commit 728e6cd398
2 changed files with 26 additions and 17 deletions

View File

@@ -729,13 +729,6 @@ mm_base_manager_num_modems (MMBaseManager *self)
#if defined WITH_SYSTEMD_SUSPEND_RESUME
gboolean mm_base_modem_sync_finish (MMBaseModem *self,
GAsyncResult *res,
GError **error)
{
return g_task_propagate_boolean (G_TASK (res), error);
}
static void
base_modem_sync_ready (MMBaseModem *self,
GAsyncResult *res,