Merge lp:~thomas-voss/platform-api/expose_accuracy_and_service_status_to_platform into lp:platform-api
- expose_accuracy_and_service_status_to_platform
- Merge into trunk
Status: | Needs review |
---|---|
Proposed branch: | lp:~thomas-voss/platform-api/expose_accuracy_and_service_status_to_platform |
Merge into: | lp:platform-api |
Diff against target: |
501 lines (+153/-51) 14 files modified
debian/control (+3/-2) debian/rules (+4/-2) doc/Doxyfile.in (+1/-1) include/ubuntu/application/location/controller.h (+1/-3) include/ubuntu/application/location/position_update.h (+30/-0) src/ubuntu/application/location/CMakeLists.txt (+6/-2) src/ubuntu/application/location/controller.cpp (+40/-13) src/ubuntu/application/location/controller_p.h (+13/-0) src/ubuntu/application/location/heading_update.cpp (+1/-1) src/ubuntu/application/location/position_update.cpp (+25/-4) src/ubuntu/application/location/service.cpp (+7/-6) src/ubuntu/application/location/session.cpp (+20/-16) src/ubuntu/application/location/velocity_update.cpp (+1/-1) tests/CMakeLists.txt (+1/-0) |
To merge this branch: | bzr merge lp:~thomas-voss/platform-api/expose_accuracy_and_service_status_to_platform |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gerry Boland (community) | Needs Information | ||
Charles Kerr (community) | Needs Fixing | ||
PS Jenkins bot | continuous-integration | Needs Fixing | |
Review via email: mp+203298@code.launchpad.net |
This proposal supersedes a proposal from 2014-01-22.
Commit message
Account for changes in the location service interface. Wire up controller to talk to the service for enabling/disabling positioning and gps status.
Description of the change
Account for changes in the location service interface.
Wire up controller to talk to the service for enabling/disabling positioning and gps status.
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:184
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:184
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:185
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:186
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:186
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Ted Gould (ted) wrote : | # |
Added a commit message and queued rebuild.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:186
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 187. By Thomas Voß
-
Add versioned dep on libubuntu-
location- service- dev.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:187
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Ted Gould (ted) wrote : | # |
Can we get a "DISABLED_ALL" that is set to zero in UbuntuApplicati
Thomas Voß (thomas-voss) wrote : | # |
On Wed, Jan 29, 2014 at 4:28 PM, Ted Gould <email address hidden> wrote:
> Can we get a "DISABLED_ALL" that is set to zero in UbuntuApplicati
Sure, but I would like to land this MP first. Happy to tackle it in a
follow-up MP.
> --
> https:/
> You are the owner of lp:~thomas-voss/platform-api/expose_accuracy_and_service_status_to_platform.
- 188. By Thomas Voß
-
debian/rules: Fix setting of compiler version to work around regression in recent cmake [Martin Pitt]
- 189. By Thomas Voß
-
Fix whitespace.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:189
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 190. By Thomas Voß
-
Merge with lp:~xnox/platform-api/compilers.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:190
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 191. By Thomas Voß
-
Fix i386 build.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:191
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Charles Kerr (charlesk) wrote : | # |
Jenkins issues aside (failing because it doesn't have the location-service branch?), this code all looks fine to me.
It's a straightforward update to sync with the location-service branch.
Charles Kerr (charlesk) wrote : | # |
Thomas, since this is going to land /after/ the related indicator-location branch, could you tweak the location/
Gerry Boland (gerboland) wrote : | # |
Ancient MR, do we need this any more?
Unmerged revisions
- 191. By Thomas Voß
-
Fix i386 build.
- 190. By Thomas Voß
-
Merge with lp:~xnox/platform-api/compilers.
- 189. By Thomas Voß
-
Fix whitespace.
- 188. By Thomas Voß
-
debian/rules: Fix setting of compiler version to work around regression in recent cmake [Martin Pitt]
- 187. By Thomas Voß
-
Add versioned dep on libubuntu-
location- service- dev. - 186. By Thomas Voß
-
[ Martin Pitt ]
* Add backend for simulated sensor data.
[ Albert Astals ]
* Build fixes and typos.
[ Ricardo Mendoza ]
* Build fixes and typos.
[ Ubuntu daily release ]
* Automatic snapshot from revision 183 - 185. By Thomas Voß
-
Add missing build dependencies on libproperties-
cpp-dev and libdbus-cpp-dev. - 184. By Thomas Voß
-
Account for changes in the location service interface.
Wire up controller to talk to the service for enabling/disabling positioning and gps status.
Preview Diff
1 | === modified file 'debian/control' |
2 | --- debian/control 2014-01-08 15:17:41 +0000 |
3 | +++ debian/control 2014-01-30 16:20:46 +0000 |
4 | @@ -15,10 +15,11 @@ |
5 | libmirserver-dev (>= 0.1.3), |
6 | liburl-dispatcher1-dev, |
7 | libdbus-1-dev, |
8 | - dbus-cpp-dev, |
9 | - libubuntu-location-service-dev, |
10 | + libdbus-cpp-dev, |
11 | + libubuntu-location-service-dev (>=0.0.2+14.04.20140129-0ubuntu1), |
12 | libgtest-dev, |
13 | libprocess-cpp-dev (>= 0.0.1+14.04.20131212), |
14 | + libproperties-cpp-dev, |
15 | Standards-Version: 3.9.4 |
16 | Homepage: https://launchpad.net/platform-api |
17 | Vcs-Bzr: lp:platform-api |
18 | |
19 | === modified file 'debian/rules' (properties changed: -x to +x) |
20 | --- debian/rules 2014-01-09 18:52:10 +0000 |
21 | +++ debian/rules 2014-01-30 16:20:46 +0000 |
22 | @@ -2,8 +2,10 @@ |
23 | |
24 | DPKG_GENSYMBOLS_CHECK_LEVEL = 4 |
25 | |
26 | -export C=gcc-4.7 |
27 | -export CXX=g++-4.7 |
28 | +include /usr/share/dpkg/default.mk |
29 | + |
30 | +export CC=$(DEB_HOST_GNU_TYPE)-gcc-4.7 |
31 | +export CXX=$(DEB_HOST_GNU_TYPE)-g++-4.7 |
32 | |
33 | %: |
34 | dh $@ |
35 | |
36 | === modified file 'doc/Doxyfile.in' |
37 | --- doc/Doxyfile.in 2013-07-05 09:13:31 +0000 |
38 | +++ doc/Doxyfile.in 2014-01-30 16:20:46 +0000 |
39 | @@ -1684,7 +1684,7 @@ |
40 | # explicitly to a value larger than 0 to get control over the balance |
41 | # between CPU load and processing speed. |
42 | |
43 | -DOT_NUM_THREADS = 0 |
44 | +DOT_NUM_THREADS = 1 |
45 | |
46 | # By default doxygen will use the Helvetica font for all dot files that |
47 | # doxygen generates. When you want a differently looking font you can specify |
48 | |
49 | === modified file 'include/ubuntu/application/location/controller.h' |
50 | --- include/ubuntu/application/location/controller.h 2013-08-23 10:55:16 +0000 |
51 | +++ include/ubuntu/application/location/controller.h 2014-01-30 16:20:46 +0000 |
52 | @@ -34,9 +34,7 @@ |
53 | typedef enum |
54 | { |
55 | UA_LOCATION_SERVICE_ENABLED = 1 << 0, /**< The service is enabled. */ |
56 | - UA_LOCATION_SERVICE_DISABLED = 1 << 1, /**< The service is disabled. */ |
57 | - UA_LOCATION_SERVICE_GPS_ENABLED = 1 << 2, /**< GPS providers are enabled. */ |
58 | - UA_LOCATION_SERVICE_GPS_DISABLED = 1 << 3, /**< GPS providers are disabled. */ |
59 | + UA_LOCATION_SERVICE_GPS_ENABLED = 1 << 1 /**< GPS providers are enabled. */ |
60 | } UbuntuApplicationLocationServiceStatus; |
61 | |
62 | typedef UbuntuApplicationLocationServiceStatus UALocationServiceStatus; |
63 | |
64 | === modified file 'include/ubuntu/application/location/position_update.h' |
65 | --- include/ubuntu/application/location/position_update.h 2013-08-22 07:03:49 +0000 |
66 | +++ include/ubuntu/application/location/position_update.h 2014-01-30 16:20:46 +0000 |
67 | @@ -84,6 +84,16 @@ |
68 | UALocationPositionUpdate *update); |
69 | |
70 | /** |
71 | + * \brief Queries the horizontal accuracy of the position update. |
72 | + * \ingroup location_service |
73 | + * \returns The horizontal accuracy of the position update in [m]. |
74 | + * \param[in] update The position update instance to be queried. |
75 | + */ |
76 | + UBUNTU_DLL_PUBLIC double |
77 | + ua_location_position_update_get_horizontal_accuracy_in_meter( |
78 | + UALocationPositionUpdate *update); |
79 | + |
80 | + /** |
81 | * \brief Checks if the position update contains an altitude. |
82 | * \ingroup location_service |
83 | * \returns TRUE if the update contains an altitude, else FALSE. |
84 | @@ -103,6 +113,26 @@ |
85 | ua_location_position_update_get_altitude_in_meter( |
86 | UALocationPositionUpdate *update); |
87 | |
88 | + /** |
89 | + * \brief Checks if the position update contains a vertical accuracy estimate. |
90 | + * \ingroup location_service |
91 | + * \returns TRUE if the update contains a vertical accuracy estimate, else FALSE. |
92 | + * \param[in] update The position update instance to be queried. |
93 | + */ |
94 | + UBUNTU_DLL_PUBLIC bool |
95 | + ua_location_position_update_has_vertical_accuracy( |
96 | + UALocationPositionUpdate *update); |
97 | + |
98 | + /** |
99 | + * \brief Queries the vertical accuracy of the position update. |
100 | + * \ingroup location_service |
101 | + * \returns The vertical accuracy of the position update in [m]. |
102 | + * \param[in] update The position update instance to be queried. |
103 | + */ |
104 | + UBUNTU_DLL_PUBLIC double |
105 | + ua_location_position_update_get_vertical_accuracy_in_meter( |
106 | + UALocationPositionUpdate *update); |
107 | + |
108 | #ifdef __cplusplus |
109 | } |
110 | #endif |
111 | |
112 | === modified file 'src/ubuntu/application/location/CMakeLists.txt' |
113 | --- src/ubuntu/application/location/CMakeLists.txt 2013-08-23 10:39:34 +0000 |
114 | +++ src/ubuntu/application/location/CMakeLists.txt 2014-01-30 16:20:46 +0000 |
115 | @@ -4,12 +4,14 @@ |
116 | |
117 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -fPIC") |
118 | |
119 | -pkg_check_modules(DBUS_CPP REQUIRED dbus-cpp) |
120 | +pkg_check_modules(DBUS_CPP dbus-cpp REQUIRED) |
121 | pkg_check_modules(LOCATION_SERVICE REQUIRED ubuntu-location-service) |
122 | |
123 | +message(STATUS ${DBUS_CPP_LIBRARIES}) |
124 | + |
125 | include_directories( |
126 | ${Boost_INCLUDE_DIRS} |
127 | - ${DBUS_CPP_INCLUDE_DIRS}/dbus |
128 | + ${DBUS_CPP_INCLUDE_DIRS} |
129 | ${LOCATION_SERVICE_INCLUDE_DIRS} |
130 | ) |
131 | |
132 | @@ -30,6 +32,8 @@ |
133 | |
134 | ubuntu-location-service |
135 | dbus-1 |
136 | + |
137 | + ${DBUS_CPP_LDFLAGS} |
138 | ${LOCATION_SERVICE_LIBRARIES} |
139 | ${CMAKE_THREAD_LIBS_INIT} |
140 | ${Boost_LIBRARIES} |
141 | |
142 | === modified file 'src/ubuntu/application/location/controller.cpp' |
143 | --- src/ubuntu/application/location/controller.cpp 2013-08-23 10:55:16 +0000 |
144 | +++ src/ubuntu/application/location/controller.cpp 2014-01-30 16:20:46 +0000 |
145 | @@ -40,9 +40,29 @@ |
146 | UALocationServiceStatusChangedHandler handler, |
147 | void *context) |
148 | { |
149 | - (void) controller; |
150 | - (void) handler; |
151 | - (void) context; |
152 | + controller->service->is_online().changed().connect([controller, handler, context](bool value) |
153 | + { |
154 | + if (value) |
155 | + { |
156 | + controller->current_status |= UA_LOCATION_SERVICE_ENABLED; |
157 | + } else |
158 | + { |
159 | + controller->current_status &= ~UA_LOCATION_SERVICE_ENABLED; |
160 | + } |
161 | + handler(controller->current_status, context); |
162 | + }); |
163 | + |
164 | + controller->service->does_satellite_based_positioning().changed().connect([controller, handler, context](bool value) |
165 | + { |
166 | + if (value) |
167 | + { |
168 | + controller->current_status |= UA_LOCATION_SERVICE_GPS_ENABLED; |
169 | + } else |
170 | + { |
171 | + controller->current_status &= ~UA_LOCATION_SERVICE_GPS_ENABLED; |
172 | + } |
173 | + handler(controller->current_status, context); |
174 | + }); |
175 | } |
176 | |
177 | UStatus |
178 | @@ -50,8 +70,19 @@ |
179 | UALocationServiceController *controller, |
180 | UALocationServiceStatusFlags *out_flags) |
181 | { |
182 | - (void) controller; |
183 | - (void) out_flags; |
184 | + *out_flags = 0; |
185 | + |
186 | + if (controller->service->is_online().get()) |
187 | + *out_flags |= UA_LOCATION_SERVICE_ENABLED; |
188 | + else |
189 | + *out_flags &= ~UA_LOCATION_SERVICE_ENABLED; |
190 | + |
191 | + if (controller->service->does_satellite_based_positioning().get()) |
192 | + *out_flags |= UA_LOCATION_SERVICE_GPS_ENABLED; |
193 | + else |
194 | + *out_flags &= ~UA_LOCATION_SERVICE_GPS_ENABLED; |
195 | + |
196 | + controller->current_status = *out_flags; |
197 | |
198 | return U_STATUS_SUCCESS; |
199 | } |
200 | @@ -60,8 +91,7 @@ |
201 | ua_location_service_controller_enable_service( |
202 | UALocationServiceController *controller) |
203 | { |
204 | - (void) controller; |
205 | - |
206 | + controller->service->is_online() = true; |
207 | return U_STATUS_SUCCESS; |
208 | } |
209 | |
210 | @@ -69,8 +99,7 @@ |
211 | ua_location_service_controller_disable_service( |
212 | UALocationServiceController *controller) |
213 | { |
214 | - (void) controller; |
215 | - |
216 | + controller->service->is_online() = false; |
217 | return U_STATUS_SUCCESS; |
218 | } |
219 | |
220 | @@ -78,8 +107,7 @@ |
221 | ua_location_service_controller_enable_gps( |
222 | UALocationServiceController *controller) |
223 | { |
224 | - (void) controller; |
225 | - |
226 | + controller->service->does_satellite_based_positioning() = true; |
227 | return U_STATUS_SUCCESS; |
228 | } |
229 | |
230 | @@ -87,7 +115,6 @@ |
231 | ua_location_service_controller_disable_gps( |
232 | UALocationServiceController *controller) |
233 | { |
234 | - (void) controller; |
235 | - |
236 | + controller->service->does_satellite_based_positioning() = false; |
237 | return U_STATUS_SUCCESS; |
238 | } |
239 | |
240 | === modified file 'src/ubuntu/application/location/controller_p.h' |
241 | --- src/ubuntu/application/location/controller_p.h 2013-08-21 14:59:45 +0000 |
242 | +++ src/ubuntu/application/location/controller_p.h 2014-01-30 16:20:46 +0000 |
243 | @@ -21,10 +21,23 @@ |
244 | |
245 | #include "ubuntu/application/location/controller.h" |
246 | |
247 | +#include <com/ubuntu/location/service/stub.h> |
248 | + |
249 | #include "ref_counted.h" |
250 | |
251 | +namespace dbus = core::dbus; |
252 | +namespace culs = com::ubuntu::location::service; |
253 | + |
254 | struct UbuntuApplicationLocationServiceController : public detail::RefCounted |
255 | { |
256 | + UbuntuApplicationLocationServiceController(const culs::Interface::Ptr& service) |
257 | + : current_status(0), |
258 | + service(service) |
259 | + { |
260 | + } |
261 | + |
262 | + UALocationServiceStatusFlags current_status; |
263 | + culs::Interface::Ptr service; |
264 | }; |
265 | |
266 | #endif // CONTROLLER_PRIVATE_H_ |
267 | |
268 | === modified file 'src/ubuntu/application/location/heading_update.cpp' |
269 | --- src/ubuntu/application/location/heading_update.cpp 2013-08-19 06:46:47 +0000 |
270 | +++ src/ubuntu/application/location/heading_update.cpp 2014-01-30 16:20:46 +0000 |
271 | @@ -51,5 +51,5 @@ |
272 | ua_location_heading_update_get_heading_in_degree( |
273 | UALocationHeadingUpdate *update) |
274 | { |
275 | - return update->update.value.value.value(); |
276 | + return update->update.value.value(); |
277 | } |
278 | |
279 | === modified file 'src/ubuntu/application/location/position_update.cpp' |
280 | --- src/ubuntu/application/location/position_update.cpp 2013-08-19 06:46:47 +0000 |
281 | +++ src/ubuntu/application/location/position_update.cpp 2014-01-30 16:20:46 +0000 |
282 | @@ -51,26 +51,47 @@ |
283 | ua_location_position_update_get_latitude_in_degree( |
284 | UALocationPositionUpdate *update) |
285 | { |
286 | - return update->update.value.latitude().value.value(); |
287 | + return update->update.value.latitude.value.value(); |
288 | } |
289 | |
290 | double |
291 | ua_location_position_update_get_longitude_in_degree( |
292 | UALocationPositionUpdate *update) |
293 | { |
294 | - return update->update.value.longitude().value.value(); |
295 | + return update->update.value.longitude.value.value(); |
296 | +} |
297 | + |
298 | +double |
299 | +ua_location_position_update_get_horizontal_accuracy_in_meter( |
300 | + UALocationPositionUpdate *update) |
301 | +{ |
302 | + return update->update.value.accuracy.horizontal->value(); |
303 | } |
304 | |
305 | bool |
306 | ua_location_position_update_has_altitude( |
307 | UALocationPositionUpdate *update) |
308 | { |
309 | - return update->update.value.has_altitude(); |
310 | + return static_cast<bool>(update->update.value.altitude); |
311 | } |
312 | |
313 | double |
314 | ua_location_position_update_get_altitude_in_meter( |
315 | UALocationPositionUpdate *update) |
316 | { |
317 | - return update->update.value.altitude().value.value(); |
318 | + return update->update.value.altitude->value.value(); |
319 | +} |
320 | + |
321 | +bool |
322 | +ua_location_position_update_has_vertical_accuracy( |
323 | + UALocationPositionUpdate *update) |
324 | +{ |
325 | + return update->update.value.accuracy.vertical; |
326 | +} |
327 | + |
328 | +double |
329 | +ua_location_position_update_get_vertical_accuracy_in_meter( |
330 | + UALocationPositionUpdate *update) |
331 | +{ |
332 | + return update->update.value.accuracy.vertical->value(); |
333 | } |
334 | |
335 | === modified file 'src/ubuntu/application/location/service.cpp' |
336 | --- src/ubuntu/application/location/service.cpp 2013-08-25 06:27:23 +0000 |
337 | +++ src/ubuntu/application/location/service.cpp 2014-01-30 16:20:46 +0000 |
338 | @@ -22,10 +22,11 @@ |
339 | #include "session_p.h" |
340 | |
341 | #include <com/ubuntu/location/service/stub.h> |
342 | -#include <org/freedesktop/dbus/resolver.h> |
343 | -#include <org/freedesktop/dbus/asio/executor.h> |
344 | - |
345 | -namespace dbus = org::freedesktop::dbus; |
346 | + |
347 | +#include <core/dbus/resolver.h> |
348 | +#include <core/dbus/asio/executor.h> |
349 | + |
350 | +namespace dbus = core::dbus; |
351 | namespace cul = com::ubuntu::location; |
352 | namespace culs = com::ubuntu::location::service; |
353 | |
354 | @@ -47,7 +48,7 @@ |
355 | |
356 | private: |
357 | Instance() : bus(std::make_shared<dbus::Bus>(dbus::WellKnownBus::system)), |
358 | - executor(std::make_shared<dbus::asio::Executor>(bus)), |
359 | + executor(dbus::asio::make_executor(bus)), |
360 | service(dbus::resolve_service_on_bus<culs::Interface, culs::Stub>(bus)) |
361 | { |
362 | bus->install_executor(executor); |
363 | @@ -87,5 +88,5 @@ |
364 | UALocationServiceController* |
365 | ua_location_service_create_controller() |
366 | { |
367 | - return new UbuntuApplicationLocationServiceController{}; |
368 | + return new UbuntuApplicationLocationServiceController{Instance::instance().get_service()}; |
369 | } |
370 | |
371 | === modified file 'src/ubuntu/application/location/session.cpp' |
372 | --- src/ubuntu/application/location/session.cpp 2013-08-19 06:46:47 +0000 |
373 | +++ src/ubuntu/application/location/session.cpp 2014-01-30 16:20:46 +0000 |
374 | @@ -24,6 +24,8 @@ |
375 | #include "position_update_p.h" |
376 | #include "velocity_update_p.h" |
377 | |
378 | +namespace location = com::ubuntu::location; |
379 | + |
380 | void |
381 | ua_location_service_session_ref( |
382 | UALocationServiceSession *session) |
383 | @@ -47,12 +49,12 @@ |
384 | void *context) |
385 | { |
386 | auto s = static_cast<UbuntuApplicationLocationServiceSession*>(session); |
387 | - s->session->install_position_updates_handler( |
388 | - [handler, context](const com::ubuntu::location::Update<com::ubuntu::location::Position>& new_position) |
389 | - { |
390 | - UbuntuApplicationLocationPositionUpdate pu{new_position}; |
391 | - handler(std::addressof(pu), context); |
392 | - }); |
393 | + s->session->updates().position.changed().connect([handler, context]( |
394 | + const location::Update<location::Position>& new_position) |
395 | + { |
396 | + UbuntuApplicationLocationPositionUpdate pu{new_position}; |
397 | + handler(std::addressof(pu), context); |
398 | + }); |
399 | } |
400 | |
401 | void |
402 | @@ -62,8 +64,8 @@ |
403 | void *context) |
404 | { |
405 | auto s = static_cast<UbuntuApplicationLocationServiceSession*>(session); |
406 | - s->session->install_heading_updates_handler( |
407 | - [handler, context](const com::ubuntu::location::Update<com::ubuntu::location::Heading>& new_heading) |
408 | + s->session->updates().heading.changed().connect( |
409 | + [handler, context](const location::Update<location::Heading>& new_heading) |
410 | { |
411 | UbuntuApplicationLocationHeadingUpdate hu{new_heading}; |
412 | handler(std::addressof(hu), context); |
413 | @@ -77,8 +79,8 @@ |
414 | void *context) |
415 | { |
416 | auto s = static_cast<UbuntuApplicationLocationServiceSession*>(session); |
417 | - s->session->install_velocity_updates_handler( |
418 | - [handler, context](const com::ubuntu::location::Update<com::ubuntu::location::Velocity>& new_velocity) |
419 | + s->session->updates().velocity.changed().connect( |
420 | + [handler, context](const location::Update<location::Velocity>& new_velocity) |
421 | { |
422 | UbuntuApplicationLocationVelocityUpdate vu{new_velocity}; |
423 | handler(std::addressof(vu), context); |
424 | @@ -95,7 +97,8 @@ |
425 | |
426 | try |
427 | { |
428 | - s->session->start_position_updates(); |
429 | + s->session->updates().position_status |
430 | + = location::service::session::Interface::Updates::Status::enabled; |
431 | } catch(...) |
432 | { |
433 | return U_STATUS_ERROR; |
434 | @@ -114,7 +117,8 @@ |
435 | |
436 | try |
437 | { |
438 | - s->session->stop_position_updates(); |
439 | + s->session->updates().position_status |
440 | + = location::service::session::Interface::Updates::Status::disabled; |
441 | } catch(...) |
442 | { |
443 | } |
444 | @@ -130,7 +134,7 @@ |
445 | |
446 | try |
447 | { |
448 | - s->session->start_heading_updates(); |
449 | + s->session->updates().heading_status = location::service::session::Interface::Updates::Status::enabled; |
450 | } catch(...) |
451 | { |
452 | return U_STATUS_ERROR; |
453 | @@ -149,7 +153,7 @@ |
454 | |
455 | try |
456 | { |
457 | - s->session->stop_heading_updates(); |
458 | + s->session->updates().heading_status = location::service::session::Interface::Updates::Status::disabled; |
459 | } catch(...) |
460 | { |
461 | } |
462 | @@ -165,7 +169,7 @@ |
463 | |
464 | try |
465 | { |
466 | - s->session->start_velocity_updates(); |
467 | + s->session->updates().velocity_status = location::service::session::Interface::Updates::Status::enabled; |
468 | } catch(...) |
469 | { |
470 | return U_STATUS_ERROR; |
471 | @@ -184,7 +188,7 @@ |
472 | |
473 | try |
474 | { |
475 | - s->session->stop_velocity_updates(); |
476 | + s->session->updates().velocity_status = location::service::session::Interface::Updates::Status::disabled; |
477 | } catch(...) |
478 | { |
479 | } |
480 | |
481 | === modified file 'src/ubuntu/application/location/velocity_update.cpp' |
482 | --- src/ubuntu/application/location/velocity_update.cpp 2013-08-19 06:46:47 +0000 |
483 | +++ src/ubuntu/application/location/velocity_update.cpp 2014-01-30 16:20:46 +0000 |
484 | @@ -51,5 +51,5 @@ |
485 | ua_location_velocity_update_get_velocity_in_meters_per_second( |
486 | UALocationVelocityUpdate *update) |
487 | { |
488 | - return update->update.value.value.value(); |
489 | + return update->update.value.value(); |
490 | } |
491 | |
492 | === modified file 'tests/CMakeLists.txt' |
493 | --- tests/CMakeLists.txt 2013-12-06 13:47:56 +0000 |
494 | +++ tests/CMakeLists.txt 2014-01-30 16:20:46 +0000 |
495 | @@ -17,6 +17,7 @@ |
496 | ubuntu_application_api |
497 | gtest |
498 | gtest_main |
499 | + |
500 | ${PROCESS_CPP_LIBRARIES} |
501 | ) |
502 |
FAILED: Continuous integration, rev:184 jenkins. qa.ubuntu. com/job/ platform- api-ci/ 191/ jenkins. qa.ubuntu. com/job/ platform- api-trusty- amd64-ci/ 25/console jenkins. qa.ubuntu. com/job/ platform- api-trusty- armhf-ci/ 25/console jenkins. qa.ubuntu. com/job/ platform- api-trusty- i386-ci/ 25/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/platform- api-ci/ 191/rebuild
http://