commit
801b725fd5
11 changed files with 17 additions and 36 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
service anboxd /system/bin/anboxd
|
service anboxd /system/bin/anboxd
|
||||||
class boot
|
class core
|
||||||
|
|
||||||
# We will ever only have a single network interface we need to care
|
# We will ever only have a single network interface we need to care
|
||||||
# about so we can add static setup for this one here.
|
# about so we can add static setup for this one here.
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,15 +54,12 @@ LocalSocketConnection::~LocalSocketConnection() {
|
||||||
|
|
||||||
ssize_t LocalSocketConnection::read_all(std::uint8_t *buffer, const size_t &size) {
|
ssize_t LocalSocketConnection::read_all(std::uint8_t *buffer, const size_t &size) {
|
||||||
ssize_t bytes_read = ::recv(fd_, reinterpret_cast<void*>(buffer), size, 0);
|
ssize_t bytes_read = ::recv(fd_, reinterpret_cast<void*>(buffer), size, 0);
|
||||||
ALOGI("Read %d bytes", bytes_read);
|
|
||||||
return bytes_read;
|
return bytes_read;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocalSocketConnection::send(char const* data, size_t length) {
|
void LocalSocketConnection::send(char const* data, size_t length) {
|
||||||
size_t bytes_written{0};
|
size_t bytes_written{0};
|
||||||
|
|
||||||
ALOGI("Writing %d bytes", length);
|
|
||||||
|
|
||||||
while(bytes_written < length) {
|
while(bytes_written < length) {
|
||||||
ssize_t const result = ::send(fd_,
|
ssize_t const result = ::send(fd_,
|
||||||
data + bytes_written,
|
data + bytes_written,
|
||||||
|
|
|
||||||
|
|
@ -50,10 +50,6 @@ anbox::PlatformApiStub::WindowStateUpdate::Window PlatformService::unpack_window
|
||||||
auto task_id = data.readInt32();
|
auto task_id = data.readInt32();
|
||||||
auto stack_id = data.readInt32();
|
auto stack_id = data.readInt32();
|
||||||
|
|
||||||
ALOGI(" Window: package=%s frame={%d,%d,%d,%d} task=%d stack=%d",
|
|
||||||
package_name.string(), frame_left, frame_top, frame_right, frame_bottom,
|
|
||||||
task_id, stack_id);
|
|
||||||
|
|
||||||
return anbox::PlatformApiStub::WindowStateUpdate::Window{
|
return anbox::PlatformApiStub::WindowStateUpdate::Window{
|
||||||
-1, // Display id will be added by the caller
|
-1, // Display id will be added by the caller
|
||||||
has_surface,
|
has_surface,
|
||||||
|
|
@ -67,13 +63,10 @@ anbox::PlatformApiStub::WindowStateUpdate::Window PlatformService::unpack_window
|
||||||
status_t PlatformService::update_window_state(const Parcel &data) {
|
status_t PlatformService::update_window_state(const Parcel &data) {
|
||||||
anbox::PlatformApiStub::WindowStateUpdate state;
|
anbox::PlatformApiStub::WindowStateUpdate state;
|
||||||
|
|
||||||
ALOGI("Udated windows:");
|
|
||||||
const auto num_displays = data.readInt32();
|
const auto num_displays = data.readInt32();
|
||||||
for (auto n = 0; n < num_displays; n++) {
|
for (auto n = 0; n < num_displays; n++) {
|
||||||
const auto display_id = data.readInt32();
|
const auto display_id = data.readInt32();
|
||||||
const auto num_windows = data.readInt32();
|
const auto num_windows = data.readInt32();
|
||||||
ALOGI(" Display: id=%d", display_id);
|
|
||||||
|
|
||||||
for (auto m = 0; m < num_windows; m++) {
|
for (auto m = 0; m < num_windows; m++) {
|
||||||
auto window = unpack_window_state(data);
|
auto window = unpack_window_state(data);
|
||||||
window.display_id = display_id;
|
window.display_id = display_id;
|
||||||
|
|
@ -81,7 +74,6 @@ status_t PlatformService::update_window_state(const Parcel &data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ALOGI("Removed windows:");
|
|
||||||
const auto num_removed_windows = data.readInt32();
|
const auto num_removed_windows = data.readInt32();
|
||||||
for (auto n = 0; n < num_removed_windows; n++) {
|
for (auto n = 0; n < num_removed_windows; n++) {
|
||||||
auto window = unpack_window_state(data);
|
auto window = unpack_window_state(data);
|
||||||
|
|
|
||||||
5
scripts/load-kmods.sh
Executable file
5
scripts/load-kmods.sh
Executable file
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/sh -ex
|
||||||
|
sudo rmmod binder_linux || true
|
||||||
|
sudo rmmod ashmem_linux || true
|
||||||
|
(cd kernel/binder ; make clean && make -j4 ; sudo insmod binder_linux.ko; sudo chmod 666 /dev/binder)
|
||||||
|
(cd kernel/ashmem ; make clean && make -j4 ; sudo insmod ashmem_linux.ko; sudo chmod 666 /dev/ashmem)
|
||||||
|
|
@ -14,8 +14,6 @@ apps:
|
||||||
container-manager:
|
container-manager:
|
||||||
command: bin/container-manager.sh
|
command: bin/container-manager.sh
|
||||||
daemon: simple
|
daemon: simple
|
||||||
shell:
|
|
||||||
command: bin/container-shell.sh
|
|
||||||
bridge:
|
bridge:
|
||||||
command: bin/anbox-bridge.sh start
|
command: bin/anbox-bridge.sh start
|
||||||
stop-command: bin/anbox-bridge.sh stop
|
stop-command: bin/anbox-bridge.sh stop
|
||||||
|
|
@ -38,17 +36,6 @@ parts:
|
||||||
- bin/anbox-bridge.sh
|
- bin/anbox-bridge.sh
|
||||||
- bin/anbox-wrapper.sh
|
- bin/anbox-wrapper.sh
|
||||||
- bin/container-manager.sh
|
- bin/container-manager.sh
|
||||||
- bin/container-shell.sh
|
|
||||||
kernel-module-binder:
|
|
||||||
plugin: make
|
|
||||||
source: kernel/binder
|
|
||||||
snap:
|
|
||||||
- binder_linux.ko
|
|
||||||
kernel-module-ashmem:
|
|
||||||
plugin: make
|
|
||||||
source: kernel/ashmem
|
|
||||||
snap:
|
|
||||||
- ashmem_linux.ko
|
|
||||||
lxc:
|
lxc:
|
||||||
source: git://github.com/morphis/lxc
|
source: git://github.com/morphis/lxc
|
||||||
source-branch: snappy-support
|
source-branch: snappy-support
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ void SocketConnection::on_read_size(const boost::system::error_code& error, std:
|
||||||
if (connections_)
|
if (connections_)
|
||||||
connections_->remove(id());
|
connections_->remove(id());
|
||||||
|
|
||||||
BOOST_THROW_EXCEPTION(std::runtime_error(error.message()));
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::uint8_t> data(bytes_read);
|
std::vector<std::uint8_t> data(bytes_read);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@
|
||||||
#include "anbox/rpc/make_protobuf_object.h"
|
#include "anbox/rpc/make_protobuf_object.h"
|
||||||
#include "anbox/rpc/constants.h"
|
#include "anbox/rpc/constants.h"
|
||||||
#include "anbox/common/variable_length_array.h"
|
#include "anbox/common/variable_length_array.h"
|
||||||
#include "anbox/utils.h"
|
|
||||||
|
|
||||||
#include "anbox_rpc.pb.h"
|
#include "anbox_rpc.pb.h"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue