|
|
8c8af5 |
From 4492e5066e786acc9e9ba86079ccce352a27df81 Mon Sep 17 00:00:00 2001
|
|
|
8c8af5 |
From: "Zeeshan Ali (Khattak)" <zeeshanak@gnome.org>
|
|
|
8c8af5 |
Date: Thu, 2 Apr 2015 18:40:29 +0100
|
|
|
8c8af5 |
Subject: [PATCH 6/7] modem-manager: Don't enable the modem
|
|
|
8c8af5 |
|
|
|
8c8af5 |
Seems at least GNOME takes care of modem enabling for us and besides
|
|
|
8c8af5 |
this shouldn't be done by geoclue anyway (see bug#85040).
|
|
|
8c8af5 |
|
|
|
8c8af5 |
https://bugs.freedesktop.org/show_bug.cgi?id=85305
|
|
|
8c8af5 |
---
|
|
|
8c8af5 |
src/gclue-modem-manager.c | 45 +++++++++------------------------------------
|
|
|
8c8af5 |
1 file changed, 9 insertions(+), 36 deletions(-)
|
|
|
8c8af5 |
|
|
|
8c8af5 |
diff --git a/src/gclue-modem-manager.c b/src/gclue-modem-manager.c
|
|
|
8c8af5 |
index cce3065..71ab96d 100644
|
|
|
8c8af5 |
--- a/src/gclue-modem-manager.c
|
|
|
8c8af5 |
+++ b/src/gclue-modem-manager.c
|
|
|
8c8af5 |
@@ -410,38 +410,6 @@ out:
|
|
|
8c8af5 |
}
|
|
|
8c8af5 |
|
|
|
8c8af5 |
static void
|
|
|
8c8af5 |
-on_modem_enabled (GObject *modem_object,
|
|
|
8c8af5 |
- GAsyncResult *res,
|
|
|
8c8af5 |
- gpointer user_data)
|
|
|
8c8af5 |
-{
|
|
|
8c8af5 |
- GTask *task = G_TASK (user_data);
|
|
|
8c8af5 |
- GClueModemManagerPrivate *priv;
|
|
|
8c8af5 |
- MMModemLocationSource caps;
|
|
|
8c8af5 |
- GError *error = NULL;
|
|
|
8c8af5 |
-
|
|
|
8c8af5 |
- if (!mm_modem_enable_finish (MM_MODEM (modem_object), res, &error)) {
|
|
|
8c8af5 |
- if (error->code == MM_CORE_ERROR_IN_PROGRESS)
|
|
|
8c8af5 |
- /* Seems a previous async call hasn't returned yet. */
|
|
|
8c8af5 |
- g_task_return_boolean (task, TRUE);
|
|
|
8c8af5 |
- else
|
|
|
8c8af5 |
- g_task_return_error (task, error);
|
|
|
8c8af5 |
- g_object_unref (task);
|
|
|
8c8af5 |
-
|
|
|
8c8af5 |
- return;
|
|
|
8c8af5 |
- }
|
|
|
8c8af5 |
- priv = GCLUE_MODEM_MANAGER (g_task_get_source_object (task))->priv;
|
|
|
8c8af5 |
- g_debug ("manager '%s' enabled.", mm_object_get_path (priv->mm_object));
|
|
|
8c8af5 |
-
|
|
|
8c8af5 |
- caps = mm_modem_location_get_enabled (priv->modem_location) | priv->caps;
|
|
|
8c8af5 |
- mm_modem_location_setup (priv->modem_location,
|
|
|
8c8af5 |
- caps,
|
|
|
8c8af5 |
- TRUE,
|
|
|
8c8af5 |
- g_task_get_cancellable (task),
|
|
|
8c8af5 |
- on_modem_location_setup,
|
|
|
8c8af5 |
- task);
|
|
|
8c8af5 |
-}
|
|
|
8c8af5 |
-
|
|
|
8c8af5 |
-static void
|
|
|
8c8af5 |
enable_caps (GClueModemManager *manager,
|
|
|
8c8af5 |
MMModemLocationSource caps,
|
|
|
8c8af5 |
GCancellable *cancellable,
|
|
|
8c8af5 |
@@ -454,10 +422,15 @@ enable_caps (GClueModemManager *manager,
|
|
|
8c8af5 |
priv->caps |= caps;
|
|
|
8c8af5 |
task = g_task_new (manager, cancellable, callback, user_data);
|
|
|
8c8af5 |
|
|
|
8c8af5 |
- mm_modem_enable (priv->modem,
|
|
|
8c8af5 |
- cancellable,
|
|
|
8c8af5 |
- on_modem_enabled,
|
|
|
8c8af5 |
- task);
|
|
|
8c8af5 |
+ priv = GCLUE_MODEM_MANAGER (g_task_get_source_object (task))->priv;
|
|
|
8c8af5 |
+
|
|
|
8c8af5 |
+ caps = mm_modem_location_get_enabled (priv->modem_location) | priv->caps;
|
|
|
8c8af5 |
+ mm_modem_location_setup (priv->modem_location,
|
|
|
8c8af5 |
+ caps,
|
|
|
8c8af5 |
+ TRUE,
|
|
|
8c8af5 |
+ g_task_get_cancellable (task),
|
|
|
8c8af5 |
+ on_modem_location_setup,
|
|
|
8c8af5 |
+ task);
|
|
|
8c8af5 |
}
|
|
|
8c8af5 |
|
|
|
8c8af5 |
static gboolean
|
|
|
8c8af5 |
--
|
|
|
8c8af5 |
2.1.0
|
|
|
8c8af5 |
|