broadband: ensure 3GPP location info gets updated when enabling the source
Whenever 3GPP location source gets enabled, we'll launch new registration status checks (to get updated LAC/CI) and new operator code/name checks (to get updated MCC/MNC). Additional changes were needed in the HSO plugin, so that the specific location gathering enabling implemented by the HSO modem chains up parent's one first.
This commit is contained in:
@@ -5703,6 +5703,46 @@ modem_location_load_capabilities (MMIfaceModemLocation *self,
|
||||
g_object_unref (result);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Enable location gathering (Location interface) */
|
||||
|
||||
static gboolean
|
||||
enable_location_gathering_finish (MMIfaceModemLocation *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
|
||||
}
|
||||
|
||||
static void
|
||||
enable_location_gathering (MMIfaceModemLocation *self,
|
||||
MMModemLocationSource source,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
GSimpleAsyncResult *result;
|
||||
|
||||
result = g_simple_async_result_new (G_OBJECT (self),
|
||||
callback,
|
||||
user_data,
|
||||
enable_location_gathering);
|
||||
|
||||
/* 3GPP modems need to re-run registration checks, so that we get up to date
|
||||
* LAC/CI location information. Note that we don't care for when the
|
||||
* registration checks get finished. */
|
||||
if (mm_iface_modem_is_3gpp (MM_IFACE_MODEM (self))) {
|
||||
/* Re-run registration to get update LAC/CI */
|
||||
mm_iface_modem_3gpp_run_all_registration_checks (MM_IFACE_MODEM_3GPP (self), NULL, NULL);
|
||||
/* Reload operator, to get MCC/MNC */
|
||||
mm_iface_modem_3gpp_reload_current_operator (MM_IFACE_MODEM_3GPP (self));
|
||||
}
|
||||
|
||||
/* Done we are */
|
||||
g_simple_async_result_set_op_res_gboolean (result, TRUE);
|
||||
g_simple_async_result_complete_in_idle (result);
|
||||
g_object_unref (result);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
@@ -7215,6 +7255,8 @@ iface_modem_location_init (MMIfaceModemLocation *iface)
|
||||
{
|
||||
iface->load_capabilities = modem_location_load_capabilities;
|
||||
iface->load_capabilities_finish = modem_location_load_capabilities_finish;
|
||||
iface->enable_location_gathering = enable_location_gathering;
|
||||
iface->enable_location_gathering_finish = enable_location_gathering_finish;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user