From 43244baa119e32ac38e0b49f077ef59d3919f8fb Mon Sep 17 00:00:00 2001 From: Simon Fels Date: Sun, 9 Jul 2017 21:22:21 +0200 Subject: [PATCH] Add argument for launch command to use system dbus --- src/anbox/cmds/launch.cpp | 9 ++++++++- src/anbox/cmds/launch.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/anbox/cmds/launch.cpp b/src/anbox/cmds/launch.cpp index 3e0f8851..ac3b2770 100644 --- a/src/anbox/cmds/launch.cpp +++ b/src/anbox/cmds/launch.cpp @@ -77,6 +77,9 @@ anbox::cmds::Launch::Launch() flag(cli::make_flag(cli::Name{"stack"}, cli::Description{"Which window stack the activity should be started on. Possible: default, fullscreen, freeform"}, stack_)); + flag(cli::make_flag(cli::Name{"use-system-dbus"}, + cli::Description{"Use system instead of session DBus"}, + use_system_dbus_)); action([this](const cli::Command::Context&) { if (!intent_.valid()) { @@ -92,7 +95,11 @@ anbox::cmds::Launch::Launch() auto rt = Runtime::create(); - auto bus = std::make_shared(core::dbus::WellKnownBus::session); + auto bus_type = core::dbus::WellKnownBus::session; + if (use_system_dbus_) + bus_type = core::dbus::WellKnownBus::system; + + auto bus = std::make_shared(bus_type); bus->install_executor(core::dbus::asio::make_executor(bus, rt->service())); const auto snap_path = utils::get_env_value("SNAP"); diff --git a/src/anbox/cmds/launch.h b/src/anbox/cmds/launch.h index 7fc71c94..b555c418 100644 --- a/src/anbox/cmds/launch.h +++ b/src/anbox/cmds/launch.h @@ -38,6 +38,7 @@ class Launch : public cli::CommandWithFlagsAndAction { android::Intent intent_; wm::Stack::Id stack_; + bool use_system_dbus_ = false; }; } // namespace cmds } // namespace anbox -- GitLab