summaryrefslogtreecommitdiff
path: root/plugins/connman/registration.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/connman/registration.cpp')
-rw-r--r--plugins/connman/registration.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/plugins/connman/registration.cpp b/plugins/connman/registration.cpp
index a072f25..adccd49 100644
--- a/plugins/connman/registration.cpp
+++ b/plugins/connman/registration.cpp
@@ -25,6 +25,7 @@
*/
#include "connman_api.hpp"
+#include "connman_manager.hpp"
#include "bluetooth.hpp"
#include "clock.hpp"
#include "ethernet.hpp"
@@ -48,23 +49,27 @@ extern "C" IVI_SETTINGS_CONNMAN_API bool
register_settings(ivi::settings::registrar & r,
ivi::settings::event_callback const & e)
{
- std::unique_ptr<ivi::settings::plugin> bt(
- new ivi::settings::bluetooth(e));
+ // Only one instance of connman_manager is needed since the
+ // corresponding connman Manager is really a global object.
+ static ivi::settings::connman_manager manager(e);
- std::unique_ptr<ivi::settings::plugin> clk(
- new ivi::settings::clock(e));
+ std::unique_ptr<ivi::settings::plugin> bt(
+ new ivi::settings::bluetooth(manager, e));
std::unique_ptr<ivi::settings::plugin> eth(
- new ivi::settings::ethernet(e));
+ new ivi::settings::ethernet(manager, e));
std::unique_ptr<ivi::settings::plugin> wifi(
- new ivi::settings::wifi(e));
+ new ivi::settings::wifi(manager, e));
+
+ std::unique_ptr<ivi::settings::plugin> clk(
+ new ivi::settings::clock(e));
return
r.register_setting(std::move(bt))
- && r.register_setting(std::move(clk))
&& r.register_setting(std::move(eth))
- && r.register_setting(std::move(wifi));
+ && r.register_setting(std::move(wifi))
+ && r.register_setting(std::move(clk));
}
// Local Variables: