Always start new applications on the freeform stack
This commit is contained in:
parent
972260b76c
commit
e75940711b
4 changed files with 10 additions and 9 deletions
|
|
@ -83,12 +83,16 @@ void AndroidApiSkeleton::launch_application(anbox::protobuf::bridge::LaunchAppli
|
||||||
(void) response;
|
(void) response;
|
||||||
|
|
||||||
std::string intent = request->package_name();
|
std::string intent = request->package_name();
|
||||||
intent += "/";
|
if (request->has_activity()) {
|
||||||
intent += request->activity();
|
intent += "/";
|
||||||
|
intent += request->activity();
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<std::string> argv = {
|
std::vector<std::string> argv = {
|
||||||
"/system/bin/am",
|
"/system/bin/am",
|
||||||
"start",
|
"start",
|
||||||
|
// Launch any applications always in freeform stack
|
||||||
|
"--stack", "2",
|
||||||
intent,
|
intent,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,8 @@ void AndroidApiStub::launch(const std::string &package, const std::string &activ
|
||||||
auto c = std::make_shared<Request<protobuf::rpc::Void>>();
|
auto c = std::make_shared<Request<protobuf::rpc::Void>>();
|
||||||
protobuf::bridge::LaunchApplication message;
|
protobuf::bridge::LaunchApplication message;
|
||||||
message.set_package_name(package);
|
message.set_package_name(package);
|
||||||
message.set_activity(activity);
|
if (activity.length() > 0)
|
||||||
|
message.set_activity(activity);
|
||||||
|
|
||||||
{
|
{
|
||||||
std::lock_guard<decltype(mutex_)> lock(mutex_);
|
std::lock_guard<decltype(mutex_)> lock(mutex_);
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,8 @@ anbox::cmds::Launch::Launch()
|
||||||
flag(cli::make_flag(cli::Name{"package"}, cli::Description{"Package the application is part of"}, package_));
|
flag(cli::make_flag(cli::Name{"package"}, cli::Description{"Package the application is part of"}, package_));
|
||||||
flag(cli::make_flag(cli::Name{"activity"}, cli::Description{"Activity of the application to start"}, activity_));
|
flag(cli::make_flag(cli::Name{"activity"}, cli::Description{"Activity of the application to start"}, activity_));
|
||||||
action([this](const cli::Command::Context&) {
|
action([this](const cli::Command::Context&) {
|
||||||
if (package_.empty() || activity_.empty())
|
if (package_.empty() && activity_.empty())
|
||||||
BOOST_THROW_EXCEPTION(std::runtime_error("No package or activity specified"));
|
BOOST_THROW_EXCEPTION(std::runtime_error("Package or activity name not specified"));
|
||||||
|
|
||||||
auto bus = std::make_shared<core::dbus::Bus>(core::dbus::WellKnownBus::session);
|
auto bus = std::make_shared<core::dbus::Bus>(core::dbus::WellKnownBus::session);
|
||||||
bus->install_executor(core::dbus::asio::make_executor(bus));
|
bus->install_executor(core::dbus::asio::make_executor(bus));
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,6 @@ ApplicationManager::ApplicationManager(const core::dbus::Bus::Ptr &bus,
|
||||||
auto reader = msg->reader();
|
auto reader = msg->reader();
|
||||||
reader >> path;
|
reader >> path;
|
||||||
|
|
||||||
DEBUG("path %s", path);
|
|
||||||
|
|
||||||
core::dbus::Message::Ptr reply;
|
core::dbus::Message::Ptr reply;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
@ -52,8 +50,6 @@ ApplicationManager::ApplicationManager(const core::dbus::Bus::Ptr &bus,
|
||||||
err.what());
|
err.what());
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG("Sending reply");
|
|
||||||
|
|
||||||
bus_->send(reply);
|
bus_->send(reply);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue