Merge lp:~thomas-voss/location-service/do-not-rely-on-obsolete-satellite-based-positioning-state into lp:location-service/15.04

Proposed by Thomas Voß
Status: Merged
Approved by: Timo Jyrinki
Approved revision: 217
Merged at revision: 216
Proposed branch: lp:~thomas-voss/location-service/do-not-rely-on-obsolete-satellite-based-positioning-state
Merge into: lp:location-service/15.04
Diff against target: 71 lines (+3/-24)
2 files modified
src/location_service/com/ubuntu/location/engine.cpp (+2/-14)
tests/engine_test.cpp (+1/-10)
To merge this branch: bzr merge lp:~thomas-voss/location-service/do-not-rely-on-obsolete-satellite-based-positioning-state
Reviewer Review Type Date Requested Status
Scott Sweeny (community) Approve
Timo Jyrinki Approve
Review via email: mp+287790@code.launchpad.net

This proposal supersedes a proposal from 2016-03-02.

Commit message

Remove explicit option to disable satellite-based positioning services.

The service is clever enough to dynamically enable/disable the provider, taking into account
accuracy requirements.

Description of the change

Remove explicit option to disable satellite-based positioning services.

The service is clever enough to dynamically enable/disable the provider, taking into account
accuracy requirements.

To post a comment you must log in.
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

Two tests failing (in the silo build):

Engine.reads_state_from_settings_on_construction
Engine.stores_state_from_settings_on_destruction

review: Needs Fixing
217. By Thomas Voß

Adjust test case and remove expectations on satellite-based positioning state.

Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

Confirming fixed from the silo on my Bq OTA-9.1.

review: Approve
Revision history for this message
Scott Sweeny (ssweeny) wrote :

This code looks good, and the tests all pass locally for me with this latest change.

review: Approve
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

That is, without the silo upgrade, unable to get a real GPS fix as witnessed with client --bus system. With the silo in identical conditions, a trustworthy GPS fix with accurate location.

Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

Ok the problem and how to test the fix:

/var/lib/ubuntu-location-service/config.ini:
- On my (stable OTA-9.1, untouched) phone the second line about satellites use was "Off"

Real GPS wasn't use, only the cell/wifi based approximation 500m-1km off the goal.

I used "client" from ubuntu-location-service-example package to ./client --bus system. When it was broken, I only got approximate location and not eg velocity data.

After upgrading to the fixed silo, despite the config.ini still having the "Off" in there on the second line, I started getting (when near window or outside) the exact coordinates of myself and also additional data in the ./client --bus system output regarding velocity that was not there before.

Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

Ie Engine::SatelliteBasedPositioningState=SatelliteBasedPositioningState::off is the setting that should be set for testing the bug and the fact that silo fixes GPS to work even if that line is there.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/location_service/com/ubuntu/location/engine.cpp'
2--- src/location_service/com/ubuntu/location/engine.cpp 2015-11-19 09:55:37 +0000
3+++ src/location_service/com/ubuntu/location/engine.cpp 2016-03-02 15:26:55 +0000
4@@ -97,10 +97,7 @@
5 Configuration::Keys::engine_state,
6 Configuration::Defaults::engine_state);
7
8- configuration.satellite_based_positioning_state =
9- settings->get_enum_for_key<SatelliteBasedPositioningState>(
10- Configuration::Keys::satellite_based_positioning_state,
11- Configuration::Defaults::satellite_based_positioning_state);
12+ configuration.satellite_based_positioning_state = Configuration::Defaults::satellite_based_positioning_state;
13
14 configuration.wifi_and_cell_id_reporting_state =
15 settings->get_enum_for_key<WifiAndCellIdReportingState>(
16@@ -110,12 +107,7 @@
17 configuration.engine_state.changed().connect([this](const Engine::Status& status)
18 {
19 Engine::settings->set_enum_for_key<Engine::Status>(Configuration::Keys::engine_state, status);
20- });
21-
22- configuration.satellite_based_positioning_state.changed().connect([this](SatelliteBasedPositioningState state)
23- {
24- Engine::settings->set_enum_for_key<SatelliteBasedPositioningState>(Configuration::Keys::satellite_based_positioning_state, state);
25- });
26+ });
27
28 configuration.wifi_and_cell_id_reporting_state.changed().connect([this](WifiAndCellIdReportingState state)
29 {
30@@ -129,10 +121,6 @@
31 Configuration::Keys::engine_state,
32 configuration.engine_state);
33
34- settings->set_enum_for_key<SatelliteBasedPositioningState>(
35- Configuration::Keys::satellite_based_positioning_state,
36- configuration.satellite_based_positioning_state);
37-
38 settings->set_enum_for_key<WifiAndCellIdReportingState>(
39 Configuration::Keys::wifi_and_cell_id_reporting_state,
40 configuration.wifi_and_cell_id_reporting_state);
41
42=== modified file 'tests/engine_test.cpp'
43--- tests/engine_test.cpp 2015-11-19 09:55:37 +0000
44+++ tests/engine_test.cpp 2016-03-02 15:26:55 +0000
45@@ -273,13 +273,9 @@
46 auto selection_policy = std::make_shared<NiceMock<MockProviderSelectionPolicy>>();
47
48 EXPECT_CALL(*settings, has_value_for_key(_))
49- .Times(3)
50+ .Times(2)
51 .WillRepeatedly(Return(true));
52 EXPECT_CALL(*settings, get_string_for_key_or_throw(
53- location::Engine::Configuration::Keys::satellite_based_positioning_state))
54- .Times(1)
55- .WillRepeatedly(Return(ss_satellite_based_positioning_state.str()));
56- EXPECT_CALL(*settings, get_string_for_key_or_throw(
57 location::Engine::Configuration::Keys::wifi_and_cell_id_reporting_state))
58 .Times(1)
59 .WillRepeatedly(Return(ss_wifi_and_cell_id_reporting_state.str()));
60@@ -299,11 +295,6 @@
61 auto selection_policy = std::make_shared<NiceMock<MockProviderSelectionPolicy>>();
62
63 EXPECT_CALL(*settings, set_string_for_key(
64- location::Engine::Configuration::Keys::satellite_based_positioning_state,
65- _))
66- .Times(1)
67- .WillRepeatedly(Return(true));
68- EXPECT_CALL(*settings, set_string_for_key(
69 location::Engine::Configuration::Keys::wifi_and_cell_id_reporting_state,
70 _))
71 .Times(1)

Subscribers

People subscribed via source and target branches