提交 83bf973d 编写于 作者: S Simon Fels

dbus: stub: don't register an object but retrieve the already registered one

上级 bcdbdbac
...@@ -25,10 +25,8 @@ namespace skeleton { ...@@ -25,10 +25,8 @@ namespace skeleton {
std::shared_ptr<Service> Service::create_for_bus( std::shared_ptr<Service> Service::create_for_bus(
const core::dbus::Bus::Ptr &bus, const core::dbus::Bus::Ptr &bus,
const std::shared_ptr<anbox::application::Manager> &application_manager) { const std::shared_ptr<anbox::application::Manager> &application_manager) {
auto service = core::dbus::Service::add_service( auto service = core::dbus::Service::add_service(bus, anbox::dbus::interface::Service::name());
bus, anbox::dbus::interface::Service::name()); auto object = service->add_object_for_path(anbox::dbus::interface::Service::path());
auto object =
service->add_object_for_path(anbox::dbus::interface::Service::path());
return std::make_shared<Service>(bus, service, object, application_manager); return std::make_shared<Service>(bus, service, object, application_manager);
} }
......
...@@ -25,7 +25,7 @@ namespace dbus { ...@@ -25,7 +25,7 @@ namespace dbus {
namespace stub { namespace stub {
std::shared_ptr<ApplicationManager> ApplicationManager::create_for_bus(const core::dbus::Bus::Ptr &bus) { std::shared_ptr<ApplicationManager> ApplicationManager::create_for_bus(const core::dbus::Bus::Ptr &bus) {
auto service = core::dbus::Service::use_service_or_throw_if_not_available(bus, anbox::dbus::interface::Service::name()); auto service = core::dbus::Service::use_service_or_throw_if_not_available(bus, anbox::dbus::interface::Service::name());
auto object = service->add_object_for_path(anbox::dbus::interface::Service::path()); auto object = service->object_for_path(anbox::dbus::interface::Service::path());
return std::make_shared<ApplicationManager>(bus, service, object); return std::make_shared<ApplicationManager>(bus, service, object);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册