aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-10-09 16:41:35 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-10-09 16:41:35 +0200
commitdf330dd7294611cf3f1d90879b996a4f4bb08873 (patch)
tree97be896aff96a0e26c7ef3afe1a8b2a408cf290d
parent88d80935d6c5930fe0657da8383487a23c4705ab (diff)
broadband-modem-qmi: don't require a PDS client to disable 3GPP location
-rw-r--r--src/mm-broadband-modem-qmi.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/mm-broadband-modem-qmi.c b/src/mm-broadband-modem-qmi.c
index 83197de1..d781301f 100644
--- a/src/mm-broadband-modem-qmi.c
+++ b/src/mm-broadband-modem-qmi.c
@@ -5794,19 +5794,32 @@ disable_location_gathering (MMIfaceModemLocation *self,
DisableLocationGatheringContext *ctx;
QmiClient *client = NULL;
gboolean stop_gps = FALSE;
+ GSimpleAsyncResult *result;
+
+ result = g_simple_async_result_new (G_OBJECT (self),
+ callback,
+ user_data,
+ disable_location_gathering);
+
+ /* Nothing to be done to disable 3GPP location */
+ if (source == MM_MODEM_LOCATION_SOURCE_3GPP_LAC_CI) {
+ g_simple_async_result_set_op_res_gboolean (result, TRUE);
+ g_simple_async_result_complete_in_idle (result);
+ g_object_unref (result);
+ return;
+ }
if (!ensure_qmi_client (MM_BROADBAND_MODEM_QMI (self),
QMI_SERVICE_PDS, &client,
- callback, user_data))
+ callback, user_data)) {
+ g_object_unref (result);
return;
+ }
ctx = g_slice_new0 (DisableLocationGatheringContext);
ctx->self = g_object_ref (self);
ctx->client = g_object_ref (client);
- ctx->result = g_simple_async_result_new (G_OBJECT (self),
- callback,
- user_data,
- disable_location_gathering);
+ ctx->result = result;
/* Only stop GPS engine if no GPS-related sources enabled */
if (source & (MM_MODEM_LOCATION_SOURCE_GPS_NMEA |
@@ -5834,7 +5847,7 @@ disable_location_gathering (MMIfaceModemLocation *self,
return;
}
- /* For any other location (e.g. 3GPP), or if still some GPS needed, just return */
+ /* If still some GPS needed, just return */
g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE);
disable_location_gathering_context_complete_and_free (ctx);
}