diff options
author | Maciej S. Szmigiero <mail@maciej.szmigiero.name> | 2022-06-18 22:13:49 +0200 |
---|---|---|
committer | Maciej S. Szmigiero <mail@maciej.szmigiero.name> | 2022-07-10 02:01:47 +0200 |
commit | 2e6fd0e6293df7ee71a0a0c881f86bb8df23fe68 (patch) | |
tree | 4a8875b88cc81bb5e1416927cf78e78109760c97 | |
parent | ae8bd98df2121996fd1074d5ad523a70bfdf19e2 (diff) |
locator: consider also Network NMEA as a MLS submit source
Currently, only Modem-GPS is supported as a provider of a location to
submit to MLS.
Let's also allow Network NMEA as such source if Modem-GPS is disabled in
the config - it's very unlikely that both are going to be actually present
on the same system and submission is disabled by default anyway.
-rw-r--r-- | data/geoclue.conf.in | 6 | ||||
-rw-r--r-- | src/gclue-locator.c | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/data/geoclue.conf.in b/data/geoclue.conf.in index 650470d..eac32b8 100644 --- a/data/geoclue.conf.in +++ b/data/geoclue.conf.in @@ -64,6 +64,12 @@ enable=true # If set to true, geoclue will automatically submit network data to Mozilla # each time it gets a GPS lock. # +# Currently, only Modem-GPS or Network NMEA sources are supported as providers +# of a location to submit (one at a time). +# If Modem-GPS source is enabled above it will be the exclusive provider +# (regardless whether the system is actually equipped with such modem), +# otherwise Network NMEA source will be considered. +# submit-data=false # URL to submission API of Mozilla Location Service. If not set, defaults to diff --git a/src/gclue-locator.c b/src/gclue-locator.c index 150d829..5820f99 100644 --- a/src/gclue-locator.c +++ b/src/gclue-locator.c @@ -387,7 +387,9 @@ gclue_locator_constructed (GObject *object) GClueModemGPS *gps = gclue_modem_gps_get_singleton (); locator->priv->sources = g_list_append (locator->priv->sources, gps); - submit_source = GCLUE_LOCATION_SOURCE (gps); + if (!submit_source) { + submit_source = GCLUE_LOCATION_SOURCE (gps); + } } #endif #if GCLUE_USE_NMEA_SOURCE @@ -395,6 +397,10 @@ gclue_locator_constructed (GObject *object) GClueNMEASource *nmea = gclue_nmea_source_get_singleton (); locator->priv->sources = g_list_append (locator->priv->sources, nmea); + if (!submit_source) { + submit_source = GCLUE_LOCATION_SOURCE (nmea); + } + } #endif |