~thomas-voss/location-service/fix-1347887

« back to all changes in this revision

Viewing changes to include/location_service/com/ubuntu/location/proxy_provider.h

This MP consolidates multiple related changes together, with the goal of:

(1.) Make the service instance accessible via a cli. Useful for testing scenarios.
(2.) To cut down time-to-first-fix (ttff) by:
  (2.1) Leveraging SUPL and other supplementary data downloaded over ordinary data connections.
  (2.2) Enabling network-based positioning providers to acquire fast position estimates.

In more detail:

* Added tests for daemon and cli.
* Unified daemon and cli header and implementation files.
* Add a command-line interface to the service.
* Split up provider selection policy to rely on an interface ProviderEnumerator to ease in testing.
* Trimmed down on types.
* Removed connectivity API draft to prepare for simpler approach.
* Refactored includes.
* Added a configuration option to handle cell and wifi ID reporting.
* Add a mock for a connectivity API exposed to providers and reporters.
* Add units for connectivity api.
* Refactor cell class into namespace radio. Fixes: 1226204, 1248973, 1281817

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#ifndef LOCATION_SERVICE_COM_UBUNTU_LOCATION_PROXY_PROVIDER_H_
19
19
#define LOCATION_SERVICE_COM_UBUNTU_LOCATION_PROXY_PROVIDER_H_
20
20
 
21
 
#include "com/ubuntu/location/provider.h"
22
 
#include "com/ubuntu/location/provider_selection_policy.h"
 
21
#include <com/ubuntu/location/provider.h>
 
22
#include <com/ubuntu/location/provider_selection_policy.h>
23
23
 
24
24
#include <bitset>
25
25
#include <memory>
38
38
    ProxyProvider(const ProviderSelection& selection);
39
39
    ~ProxyProvider() noexcept;
40
40
 
41
 
    ChannelConnection subscribe_to_position_updates(std::function<void(const Update<Position>&)> f);
42
 
    ChannelConnection subscribe_to_heading_updates(std::function<void(const Update<Heading>&)> f);
43
 
    ChannelConnection subscribe_to_velocity_updates(std::function<void(const Update<Velocity>&)> f);
44
 
 
45
41
    virtual void start_position_updates();
46
42
    virtual void stop_position_updates();
47
43
 
52
48
    virtual void stop_heading_updates();
53
49
    
54
50
private:
55
 
    Provider::Ptr position_updates_provider;
56
 
    Provider::Ptr heading_updates_provider;
57
 
    Provider::Ptr velocity_updates_provider;
 
51
    ProviderSelection providers;
 
52
 
 
53
    struct
 
54
    {
 
55
        core::ScopedConnection position_updates;
 
56
        core::ScopedConnection heading_updates;
 
57
        core::ScopedConnection velocity_updates;
 
58
    } connections;
58
59
};
59
60
}
60
61
}