From 09ec800efd291df3a8a488b80a4470bd6b8205df Mon Sep 17 00:00:00 2001 From: Simon Fels Date: Mon, 4 Jul 2016 16:18:15 +0200 Subject: [PATCH] Move all qemu stuff in the correct subdirectory/namespace --- src/CMakeLists.txt | 22 +++---- src/anbox/cmds/run.cpp | 8 +-- src/anbox/input/device.cpp | 4 +- src/anbox/{support => qemu}/at_parser.cpp | 6 +- src/anbox/{support => qemu}/at_parser.h | 8 +-- .../boot_properties_message_processor.cpp | 6 +- .../boot_properties_message_processor.h | 8 +-- .../bootanimation_message_processor.cpp | 6 +- .../bootanimation_message_processor.h | 8 +-- .../camera_message_processor.cpp | 6 +- .../camera_message_processor.h | 6 +- .../fingerprint_message_processor.cpp | 6 +- .../fingerprint_message_processor.h | 8 +-- .../gsm_message_processor.cpp | 8 +-- .../{support => qemu}/gsm_message_processor.h | 6 +- .../hwcontrol_message_processor.cpp | 6 +- .../hwcontrol_message_processor.h | 8 +-- .../null_message_processor.cpp | 6 +- .../null_message_processor.h | 6 +- .../pipe_connection_creator.cpp} | 63 +++++++++---------- .../pipe_connection_creator.h} | 19 +++--- .../qemud_message_processor.cpp | 6 +- .../qemud_message_processor.h | 6 +- .../sensors_message_processor.cpp | 6 +- .../sensors_message_processor.h | 8 +-- .../{support => qemu}/telephony_manager.cpp | 6 +- .../{support => qemu}/telephony_manager.h | 8 +-- tests/anbox/support/at_parser_tests.cpp | 4 +- 28 files changed, 133 insertions(+), 135 deletions(-) rename src/anbox/{support => qemu}/at_parser.cpp (96%) rename src/anbox/{support => qemu}/at_parser.h (91%) rename src/anbox/{support => qemu}/boot_properties_message_processor.cpp (96%) rename src/anbox/{support => qemu}/boot_properties_message_processor.h (85%) rename src/anbox/{support => qemu}/bootanimation_message_processor.cpp (94%) rename src/anbox/{support => qemu}/bootanimation_message_processor.h (86%) rename src/anbox/{support => qemu}/camera_message_processor.cpp (95%) rename src/anbox/{support => qemu}/camera_message_processor.h (91%) rename src/anbox/{support => qemu}/fingerprint_message_processor.cpp (92%) rename src/anbox/{support => qemu}/fingerprint_message_processor.h (85%) rename src/anbox/{support => qemu}/gsm_message_processor.cpp (96%) rename src/anbox/{support => qemu}/gsm_message_processor.h (93%) rename src/anbox/{support => qemu}/hwcontrol_message_processor.cpp (93%) rename src/anbox/{support => qemu}/hwcontrol_message_processor.h (85%) rename src/anbox/{support => qemu}/null_message_processor.cpp (91%) rename src/anbox/{support => qemu}/null_message_processor.h (89%) rename src/anbox/{network/qemu_pipe_connection_creator.cpp => qemu/pipe_connection_creator.cpp} (64%) rename src/anbox/{network/qemu_pipe_connection_creator.h => qemu/pipe_connection_creator.h} (78%) rename src/anbox/{support => qemu}/qemud_message_processor.cpp (96%) rename src/anbox/{support => qemu}/qemud_message_processor.h (92%) rename src/anbox/{support => qemu}/sensors_message_processor.cpp (93%) rename src/anbox/{support => qemu}/sensors_message_processor.h (85%) rename src/anbox/{support => qemu}/telephony_manager.cpp (93%) rename src/anbox/{support => qemu}/telephony_manager.h (88%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index edff3d5a..289dd5da 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -52,7 +52,6 @@ set(SOURCES anbox/network/message_processor.h anbox/network/connector.h anbox/network/connection_creator.h - anbox/network/qemu_pipe_connection_creator.cpp anbox/network/published_socket_connector.cpp anbox/network/connections.h anbox/network/socket_connection.cpp @@ -67,16 +66,17 @@ set(SOURCES anbox/input/manager.cpp anbox/input/device.cpp - anbox/support/null_message_processor.cpp - anbox/support/qemud_message_processor.cpp - anbox/support/boot_properties_message_processor.cpp - anbox/support/hwcontrol_message_processor.cpp - anbox/support/sensors_message_processor.cpp - anbox/support/camera_message_processor.cpp - anbox/support/fingerprint_message_processor.cpp - anbox/support/gsm_message_processor.cpp - anbox/support/at_parser.cpp - anbox/support/bootanimation_message_processor.cpp + anbox/qemu/pipe_connection_creator.cpp + anbox/qemu/null_message_processor.cpp + anbox/qemu/qemud_message_processor.cpp + anbox/qemu/boot_properties_message_processor.cpp + anbox/qemu/hwcontrol_message_processor.cpp + anbox/qemu/sensors_message_processor.cpp + anbox/qemu/camera_message_processor.cpp + anbox/qemu/fingerprint_message_processor.cpp + anbox/qemu/gsm_message_processor.cpp + anbox/qemu/at_parser.cpp + anbox/qemu/bootanimation_message_processor.cpp anbox/bridge/constants.h anbox/bridge/connection_creator.cpp diff --git a/src/anbox/cmds/run.cpp b/src/anbox/cmds/run.cpp index de04e4e4..ccd87f98 100644 --- a/src/anbox/cmds/run.cpp +++ b/src/anbox/cmds/run.cpp @@ -27,7 +27,7 @@ #include "anbox/common/dispatcher.h" #include "anbox/cmds/run.h" #include "anbox/network/published_socket_connector.h" -#include "anbox/network/qemu_pipe_connection_creator.h" +#include "anbox/qemu/pipe_connection_creator.h" #include "anbox/graphics/gl_renderer_server.h" #include "anbox/input/manager.h" #include "anbox/bridge/connection_creator.h" @@ -109,9 +109,9 @@ anbox::cmds::Run::Run(const BusFactory& bus_factory) auto qemu_pipe_connector = std::make_shared( utils::string_format("%s/qemu_pipe", config::data_path()), rt, - std::make_shared(rt, - renderer->socket_path(), - icon_)); + std::make_shared(rt, + renderer->socket_path(), + icon_)); auto android_api_stub = std::make_shared(); diff --git a/src/anbox/input/device.cpp b/src/anbox/input/device.cpp index 42674a05..8367fbf0 100644 --- a/src/anbox/input/device.cpp +++ b/src/anbox/input/device.cpp @@ -19,7 +19,7 @@ #include "anbox/network/delegate_connection_creator.h" #include "anbox/network/delegate_message_processor.h" #include "anbox/network/socket_messenger.h" -#include "anbox/support/null_message_processor.h" +#include "anbox/qemu/null_message_processor.h" #include "anbox/logger.h" #include @@ -163,7 +163,7 @@ void Device::new_client(std::shared_ptr(socket); auto const& connection = std::make_shared( messenger, messenger, next_id(), connections_, - std::make_shared()); + std::make_shared()); connections_->add(connection); diff --git a/src/anbox/support/at_parser.cpp b/src/anbox/qemu/at_parser.cpp similarity index 96% rename from src/anbox/support/at_parser.cpp rename to src/anbox/qemu/at_parser.cpp index 759e2d43..7b052cd8 100644 --- a/src/anbox/support/at_parser.cpp +++ b/src/anbox/qemu/at_parser.cpp @@ -15,12 +15,12 @@ * */ -#include "anbox/support/at_parser.h" +#include "anbox/qemu//at_parser.h" #include "anbox/utils.h" #include "anbox/logger.h" namespace anbox { -namespace support { +namespace qemu { AtParser::AtParser() { } @@ -70,5 +70,5 @@ void AtParser::processs_command(const std::string &command) { handler(real_command); } -} // namespace support +} // namespace qemu } // namespace anbox diff --git a/src/anbox/support/at_parser.h b/src/anbox/qemu/at_parser.h similarity index 91% rename from src/anbox/support/at_parser.h rename to src/anbox/qemu/at_parser.h index 13f95b24..6ca57e15 100644 --- a/src/anbox/support/at_parser.h +++ b/src/anbox/qemu/at_parser.h @@ -15,8 +15,8 @@ * */ -#ifndef ANBOX_SUPPORT_AT_PARSER_H_ -#define ANBOX_SUPPORT_AT_PARSER_H_ +#ifndef ANBOX_QEMU_AT_PARSER_H_ +#define ANBOX_QEMU_AT_PARSER_H_ #include #include @@ -26,7 +26,7 @@ #include "anbox/do_not_copy_or_move.h" namespace anbox { -namespace support { +namespace qemu { class AtParser { public: typedef std::function CommandHandler; @@ -42,7 +42,7 @@ private: std::map handlers_; }; -} // namespace support +} // namespace qemu } // namespace anbox #endif diff --git a/src/anbox/support/boot_properties_message_processor.cpp b/src/anbox/qemu/boot_properties_message_processor.cpp similarity index 96% rename from src/anbox/support/boot_properties_message_processor.cpp rename to src/anbox/qemu/boot_properties_message_processor.cpp index d118fd20..d0e81247 100644 --- a/src/anbox/support/boot_properties_message_processor.cpp +++ b/src/anbox/qemu/boot_properties_message_processor.cpp @@ -15,11 +15,11 @@ * */ -#include "anbox/support/boot_properties_message_processor.h" +#include "anbox/qemu//boot_properties_message_processor.h" #include "anbox/logger.h" namespace anbox { -namespace support { +namespace qemu { BootPropertiesMessageProcessor::BootPropertiesMessageProcessor(const std::shared_ptr &messenger) : QemudMessageProcessor(messenger) { } @@ -74,5 +74,5 @@ void BootPropertiesMessageProcessor::list_properties() { finish_message(); } -} // namespace support +} // namespace qemu } // namespace anbox diff --git a/src/anbox/support/boot_properties_message_processor.h b/src/anbox/qemu/boot_properties_message_processor.h similarity index 85% rename from src/anbox/support/boot_properties_message_processor.h rename to src/anbox/qemu/boot_properties_message_processor.h index c281fd57..3960826f 100644 --- a/src/anbox/support/boot_properties_message_processor.h +++ b/src/anbox/qemu/boot_properties_message_processor.h @@ -15,13 +15,13 @@ * */ -#ifndef ANBOX_SUPPORT_BOOT_PROPERTIES_MESSAGE_PROCESSOR_H_ -#define ANBOX_SUPPORT_BOOT_PROPERTIES_MESSAGE_PROCESSOR_H_ +#ifndef ANBOX_QEMU_BOOT_PROPERTIES_MESSAGE_PROCESSOR_H_ +#define ANBOX_QEMU_BOOT_PROPERTIES_MESSAGE_PROCESSOR_H_ -#include "anbox/support/qemud_message_processor.h" +#include "anbox/qemu//qemud_message_processor.h" namespace anbox { -namespace support { +namespace qemu { class BootPropertiesMessageProcessor : public QemudMessageProcessor { public: BootPropertiesMessageProcessor(const std::shared_ptr &messenger); diff --git a/src/anbox/support/bootanimation_message_processor.cpp b/src/anbox/qemu/bootanimation_message_processor.cpp similarity index 94% rename from src/anbox/support/bootanimation_message_processor.cpp rename to src/anbox/qemu/bootanimation_message_processor.cpp index a36a85f7..398cbce8 100644 --- a/src/anbox/support/bootanimation_message_processor.cpp +++ b/src/anbox/qemu/bootanimation_message_processor.cpp @@ -16,12 +16,12 @@ */ #include "anbox/logger.h" -#include "anbox/support/bootanimation_message_processor.h" +#include "anbox/qemu//bootanimation_message_processor.h" #include namespace anbox { -namespace support { +namespace qemu { BootAnimationMessageProcessor::BootAnimationMessageProcessor(const std::shared_ptr &messenger, const std::string &icon_path) : QemudMessageProcessor(messenger), @@ -48,5 +48,5 @@ void BootAnimationMessageProcessor::retrieve_icon() { } } -} // namespace support +} // namespace qemu } // namespace anbox diff --git a/src/anbox/support/bootanimation_message_processor.h b/src/anbox/qemu/bootanimation_message_processor.h similarity index 86% rename from src/anbox/support/bootanimation_message_processor.h rename to src/anbox/qemu/bootanimation_message_processor.h index 3fb747b1..4158c1a8 100644 --- a/src/anbox/support/bootanimation_message_processor.h +++ b/src/anbox/qemu/bootanimation_message_processor.h @@ -15,13 +15,13 @@ * */ -#ifndef ANBOX_SUPPORT_BOOT_ANIMATION_MESSAGE_PROCESSOR_H_ -#define ANBOX_SUPPORT_BOOT_ANIMATION_MESSAGE_PROCESSOR_H_ +#ifndef ANBOX_QEMU_BOOT_ANIMATION_MESSAGE_PROCESSOR_H_ +#define ANBOX_QEMU_BOOT_ANIMATION_MESSAGE_PROCESSOR_H_ -#include "anbox/support/qemud_message_processor.h" +#include "anbox/qemu//qemud_message_processor.h" namespace anbox { -namespace support { +namespace qemu { class BootAnimationMessageProcessor : public QemudMessageProcessor { public: BootAnimationMessageProcessor(const std::shared_ptr &messenger, diff --git a/src/anbox/support/camera_message_processor.cpp b/src/anbox/qemu/camera_message_processor.cpp similarity index 95% rename from src/anbox/support/camera_message_processor.cpp rename to src/anbox/qemu/camera_message_processor.cpp index 985e2031..c7c9c6b4 100644 --- a/src/anbox/support/camera_message_processor.cpp +++ b/src/anbox/qemu/camera_message_processor.cpp @@ -16,10 +16,10 @@ */ #include "anbox/logger.h" -#include "anbox/support/camera_message_processor.h" +#include "anbox/qemu/camera_message_processor.h" namespace anbox { -namespace support { +namespace qemu { CameraMessageProcessor::CameraMessageProcessor(const std::shared_ptr &messenger) : messenger_(messenger) { } @@ -65,5 +65,5 @@ void CameraMessageProcessor::list() { snprintf(buf, 5, "\n"); messenger_->send(buf, strlen(buf)); } -} // namespace support +} // namespace qemu } // namespace anbox diff --git a/src/anbox/support/camera_message_processor.h b/src/anbox/qemu/camera_message_processor.h similarity index 91% rename from src/anbox/support/camera_message_processor.h rename to src/anbox/qemu/camera_message_processor.h index 593b113a..ec603cec 100644 --- a/src/anbox/support/camera_message_processor.h +++ b/src/anbox/qemu/camera_message_processor.h @@ -15,14 +15,14 @@ * */ -#ifndef ANBOX_SUPPORT_CAMERA_MESSAGE_PROCESSOR_H_ -#define ANBOX_SUPPORT_CAMERA_MESSAGE_PROCESSOR_H_ +#ifndef ANBOX_QEMU_CAMERA_MESSAGE_PROCESSOR_H_ +#define ANBOX_QEMU_CAMERA_MESSAGE_PROCESSOR_H_ #include "anbox/network/message_processor.h" #include "anbox/network/socket_messenger.h" namespace anbox { -namespace support { +namespace qemu { class CameraMessageProcessor : public network::MessageProcessor { public: CameraMessageProcessor(const std::shared_ptr &messenger); diff --git a/src/anbox/support/fingerprint_message_processor.cpp b/src/anbox/qemu/fingerprint_message_processor.cpp similarity index 92% rename from src/anbox/support/fingerprint_message_processor.cpp rename to src/anbox/qemu/fingerprint_message_processor.cpp index a68dc50f..eb256a3b 100644 --- a/src/anbox/support/fingerprint_message_processor.cpp +++ b/src/anbox/qemu/fingerprint_message_processor.cpp @@ -16,10 +16,10 @@ */ #include "anbox/logger.h" -#include "anbox/support/fingerprint_message_processor.h" +#include "anbox/qemu/fingerprint_message_processor.h" namespace anbox { -namespace support { +namespace qemu { FingerprintMessageProcessor::FingerprintMessageProcessor(const std::shared_ptr &messenger) : QemudMessageProcessor(messenger) { } @@ -39,5 +39,5 @@ void FingerprintMessageProcessor::listen() { messenger_->send(buf, strlen(buf)); finish_message(); } -} // namespace support +} // namespace qemu } // namespace anbox diff --git a/src/anbox/support/fingerprint_message_processor.h b/src/anbox/qemu/fingerprint_message_processor.h similarity index 85% rename from src/anbox/support/fingerprint_message_processor.h rename to src/anbox/qemu/fingerprint_message_processor.h index 7fcda83b..885f772a 100644 --- a/src/anbox/support/fingerprint_message_processor.h +++ b/src/anbox/qemu/fingerprint_message_processor.h @@ -15,13 +15,13 @@ * */ -#ifndef ANBOX_SUPPORT_FINGERPRINT_MESSAGE_PROCESSOR_H_ -#define ANBOX_SUPPORT_FINGERPRINT_MESSAGE_PROCESSOR_H_ +#ifndef ANBOX_QEMU_FINGERPRINT_MESSAGE_PROCESSOR_H_ +#define ANBOX_QEMU_FINGERPRINT_MESSAGE_PROCESSOR_H_ -#include "anbox/support/qemud_message_processor.h" +#include "anbox/qemu/qemud_message_processor.h" namespace anbox { -namespace support { +namespace qemu { class FingerprintMessageProcessor : public QemudMessageProcessor { public: FingerprintMessageProcessor(const std::shared_ptr &messenger); diff --git a/src/anbox/support/gsm_message_processor.cpp b/src/anbox/qemu/gsm_message_processor.cpp similarity index 96% rename from src/anbox/support/gsm_message_processor.cpp rename to src/anbox/qemu/gsm_message_processor.cpp index 0b137c73..1973587e 100644 --- a/src/anbox/support/gsm_message_processor.cpp +++ b/src/anbox/qemu/gsm_message_processor.cpp @@ -16,8 +16,8 @@ */ #include "anbox/logger.h" -#include "anbox/support/gsm_message_processor.h" -#include "anbox/support/at_parser.h" +#include "anbox/qemu/gsm_message_processor.h" +#include "anbox/qemu/at_parser.h" #include #include @@ -25,7 +25,7 @@ using namespace std::placeholders; namespace anbox { -namespace support { +namespace qemu { GsmMessageProcessor::GsmMessageProcessor(const std::shared_ptr &messenger) : messenger_(messenger), parser_(std::make_shared()) { @@ -107,5 +107,5 @@ void GsmMessageProcessor::handle_cfun(const std::string &command) { else if (utils::string_starts_with(command, "+CFUN=")) send_reply(""); } -} // namespace support +} // namespace qemu } // namespace anbox diff --git a/src/anbox/support/gsm_message_processor.h b/src/anbox/qemu/gsm_message_processor.h similarity index 93% rename from src/anbox/support/gsm_message_processor.h rename to src/anbox/qemu/gsm_message_processor.h index be818ab9..c644d819 100644 --- a/src/anbox/support/gsm_message_processor.h +++ b/src/anbox/qemu/gsm_message_processor.h @@ -15,14 +15,14 @@ * */ -#ifndef ANBOX_SUPPORT_GSM_MESSAGE_PROCESSOR_H_ -#define ANBOX_SUPPORT_GSM_MESSAGE_PROCESSOR_H_ +#ifndef ANBOX_QEMU_GSM_MESSAGE_PROCESSOR_H_ +#define ANBOX_QEMU_GSM_MESSAGE_PROCESSOR_H_ #include "anbox/network/message_processor.h" #include "anbox/network/socket_messenger.h" namespace anbox { -namespace support { +namespace qemu { class AtParser; class GsmMessageProcessor : public network::MessageProcessor { public: diff --git a/src/anbox/support/hwcontrol_message_processor.cpp b/src/anbox/qemu/hwcontrol_message_processor.cpp similarity index 93% rename from src/anbox/support/hwcontrol_message_processor.cpp rename to src/anbox/qemu/hwcontrol_message_processor.cpp index 4e92af4c..39f7a304 100644 --- a/src/anbox/support/hwcontrol_message_processor.cpp +++ b/src/anbox/qemu/hwcontrol_message_processor.cpp @@ -15,11 +15,11 @@ * */ -#include "anbox/support/hwcontrol_message_processor.h" +#include "anbox/qemu/hwcontrol_message_processor.h" #include "anbox/logger.h" namespace anbox { -namespace support { +namespace qemu { HwControlMessageProcessor::HwControlMessageProcessor(const std::shared_ptr &messenger) : QemudMessageProcessor(messenger) { } @@ -37,5 +37,5 @@ void HwControlMessageProcessor::handle_command(const std::string &command) { else DEBUG("Unknown command '%s'", command); } -} // namespace support +} // namespace qemu } // namespace anbox diff --git a/src/anbox/support/hwcontrol_message_processor.h b/src/anbox/qemu/hwcontrol_message_processor.h similarity index 85% rename from src/anbox/support/hwcontrol_message_processor.h rename to src/anbox/qemu/hwcontrol_message_processor.h index aba92623..5cf5ba4a 100644 --- a/src/anbox/support/hwcontrol_message_processor.h +++ b/src/anbox/qemu/hwcontrol_message_processor.h @@ -15,13 +15,13 @@ * */ -#ifndef ANBOX_SUPPORT_HWCONTROL_MESSAGE_PROCESSOR_H_ -#define ANBOX_SUPPORT_HWCONTROL_MESSAGE_PROCESSOR_H_ +#ifndef ANBOX_QEMU_HWCONTROL_MESSAGE_PROCESSOR_H_ +#define ANBOX_QEMU_HWCONTROL_MESSAGE_PROCESSOR_H_ -#include "anbox/support/qemud_message_processor.h" +#include "anbox/qemu/qemud_message_processor.h" namespace anbox { -namespace support { +namespace qemu { class HwControlMessageProcessor : public QemudMessageProcessor { public: HwControlMessageProcessor(const std::shared_ptr &messenger); diff --git a/src/anbox/support/null_message_processor.cpp b/src/anbox/qemu/null_message_processor.cpp similarity index 91% rename from src/anbox/support/null_message_processor.cpp rename to src/anbox/qemu/null_message_processor.cpp index 581acbc7..798e2b73 100644 --- a/src/anbox/support/null_message_processor.cpp +++ b/src/anbox/qemu/null_message_processor.cpp @@ -15,14 +15,14 @@ * */ -#include "anbox/support/null_message_processor.h" +#include "anbox/qemu/null_message_processor.h" #include "anbox/utils.h" #include "anbox/logger.h" #include namespace anbox { -namespace support { +namespace qemu { NullMessageProcessor::NullMessageProcessor() { } @@ -33,5 +33,5 @@ bool NullMessageProcessor::process_data(const std::vector &data) { DEBUG("Received: %s", utils::hex_dump(data.data(), data.size())); return true; } -} // namespace support +} // namespace qemu } // namespace anbox diff --git a/src/anbox/support/null_message_processor.h b/src/anbox/qemu/null_message_processor.h similarity index 89% rename from src/anbox/support/null_message_processor.h rename to src/anbox/qemu/null_message_processor.h index 8b399a29..5a7acb4f 100644 --- a/src/anbox/support/null_message_processor.h +++ b/src/anbox/qemu/null_message_processor.h @@ -15,13 +15,13 @@ * */ -#ifndef ANBOX_SUPPORT_NULL_MESSAGE_PROCESSOR_H_ -#define ANBOX_SUPPORT_NULL_MESSAGE_PROCESSOR_H_ +#ifndef ANBOX_QEMU_NULL_MESSAGE_PROCESSOR_H_ +#define ANBOX_QEMU_NULL_MESSAGE_PROCESSOR_H_ #include "anbox/network/message_processor.h" namespace anbox { -namespace support { +namespace qemu { class NullMessageProcessor : public network::MessageProcessor { public: NullMessageProcessor(); diff --git a/src/anbox/network/qemu_pipe_connection_creator.cpp b/src/anbox/qemu/pipe_connection_creator.cpp similarity index 64% rename from src/anbox/network/qemu_pipe_connection_creator.cpp rename to src/anbox/qemu/pipe_connection_creator.cpp index 62e6c31a..499929a1 100644 --- a/src/anbox/network/qemu_pipe_connection_creator.cpp +++ b/src/anbox/qemu/pipe_connection_creator.cpp @@ -18,52 +18,52 @@ #include #include "anbox/logger.h" -#include "anbox/network/qemu_pipe_connection_creator.h" #include "anbox/network/socket_messenger.h" #include "anbox/graphics/opengles_message_processor.h" -#include "anbox/support/boot_properties_message_processor.h" -#include "anbox/support/null_message_processor.h" -#include "anbox/support/hwcontrol_message_processor.h" -#include "anbox/support/sensors_message_processor.h" -#include "anbox/support/camera_message_processor.h" -#include "anbox/support/fingerprint_message_processor.h" -#include "anbox/support/gsm_message_processor.h" -#include "anbox/support/bootanimation_message_processor.h" +#include "anbox/qemu/pipe_connection_creator.h" +#include "anbox/qemu/boot_properties_message_processor.h" +#include "anbox/qemu/null_message_processor.h" +#include "anbox/qemu/hwcontrol_message_processor.h" +#include "anbox/qemu/sensors_message_processor.h" +#include "anbox/qemu/camera_message_processor.h" +#include "anbox/qemu/fingerprint_message_processor.h" +#include "anbox/qemu/gsm_message_processor.h" +#include "anbox/qemu/bootanimation_message_processor.h" namespace ba = boost::asio; namespace anbox { -namespace network { -QemuPipeConnectionCreator::QemuPipeConnectionCreator(const std::shared_ptr &rt, - const std::string &renderer_socket_path, - const std::string &boot_animation_icon_path) : +namespace qemu { +PipeConnectionCreator::PipeConnectionCreator(const std::shared_ptr &rt, + const std::string &renderer_socket_path, + const std::string &boot_animation_icon_path) : runtime_(rt), next_connection_id_(0), - connections_(std::make_shared>()), + connections_(std::make_shared>()), renderer_socket_path_(renderer_socket_path), boot_animation_icon_path_(boot_animation_icon_path) { } -QemuPipeConnectionCreator::~QemuPipeConnectionCreator() { +PipeConnectionCreator::~PipeConnectionCreator() { } -void QemuPipeConnectionCreator::create_connection_for( +void PipeConnectionCreator::create_connection_for( std::shared_ptr const& socket) { - auto const messenger = std::make_shared(socket); + auto const messenger = std::make_shared(socket); const auto type = identify_client(messenger); auto const processor = create_processor(type, messenger); if (!processor) BOOST_THROW_EXCEPTION(std::runtime_error("Unhandled client type")); - auto const& connection = std::make_shared( + auto const& connection = std::make_shared( messenger, messenger, next_id(), connections_, processor); connections_->add(connection); connection->read_next_message(); } -QemuPipeConnectionCreator::client_type QemuPipeConnectionCreator::identify_client( - std::shared_ptr const& messenger) { +PipeConnectionCreator::client_type PipeConnectionCreator::identify_client( + std::shared_ptr const& messenger) { // The client will identify itself as first thing by writing a string // in the format 'pipe:[:]\0' to the channel. @@ -104,31 +104,30 @@ QemuPipeConnectionCreator::client_type QemuPipeConnectionCreator::identify_clien return client_type::invalid; } -std::shared_ptr QemuPipeConnectionCreator::create_processor(const client_type &type, const std::shared_ptr &messenger) { +std::shared_ptr PipeConnectionCreator::create_processor(const client_type &type, const std::shared_ptr &messenger) { if (type == client_type::opengles) return std::make_shared(renderer_socket_path_, runtime_, messenger); else if (type == client_type::qemud_boot_properties) - return std::make_shared(messenger); + return std::make_shared(messenger); else if (type == client_type::qemud_hw_control) - return std::make_shared(messenger); + return std::make_shared(messenger); else if (type == client_type::qemud_sensors) - return std::make_shared(messenger); + return std::make_shared(messenger); else if (type == client_type::qemud_camera) - return std::make_shared(messenger); + return std::make_shared(messenger); else if (type == client_type::qemud_fingerprint) - return std::make_shared(messenger); + return std::make_shared(messenger); else if (type == client_type::qemud_gsm) - return std::make_shared(messenger); + return std::make_shared(messenger); else if (type == client_type::bootanimation) - return std::make_shared(messenger, boot_animation_icon_path_); + return std::make_shared(messenger, boot_animation_icon_path_); - return std::make_shared(); + return std::make_shared(); } -int QemuPipeConnectionCreator::next_id() +int PipeConnectionCreator::next_id() { return next_connection_id_.fetch_add(1); } - +} // namespace qemu } // namespace anbox -} // namespace network diff --git a/src/anbox/network/qemu_pipe_connection_creator.h b/src/anbox/qemu/pipe_connection_creator.h similarity index 78% rename from src/anbox/network/qemu_pipe_connection_creator.h rename to src/anbox/qemu/pipe_connection_creator.h index bb13a605..c63b4923 100644 --- a/src/anbox/network/qemu_pipe_connection_creator.h +++ b/src/anbox/qemu/pipe_connection_creator.h @@ -30,15 +30,14 @@ #include "anbox/network/socket_messenger.h" namespace anbox { -namespace network { - -class QemuPipeConnectionCreator : public ConnectionCreator { +namespace qemu { +class PipeConnectionCreator : public network::ConnectionCreator { public: - QemuPipeConnectionCreator( + PipeConnectionCreator( const std::shared_ptr &rt, const std::string &renderer_socket_path, const std::string &boot_animation_icon_path); - ~QemuPipeConnectionCreator() noexcept; + ~PipeConnectionCreator() noexcept; void create_connection_for( std::shared_ptr const& socket) override; @@ -58,18 +57,18 @@ public: private: int next_id(); - client_type identify_client(std::shared_ptr const& messenger); - std::shared_ptr create_processor( - const client_type &type, const std::shared_ptr &messenger); + client_type identify_client(std::shared_ptr const& messenger); + std::shared_ptr create_processor( + const client_type &type, const std::shared_ptr &messenger); std::shared_ptr runtime_; std::atomic next_connection_id_; - std::shared_ptr> const connections_; + std::shared_ptr> const connections_; std::string renderer_socket_path_; std::string boot_animation_icon_path_; }; +} // namespace qemu } // namespace anbox -} // namespace network #endif diff --git a/src/anbox/support/qemud_message_processor.cpp b/src/anbox/qemu/qemud_message_processor.cpp similarity index 96% rename from src/anbox/support/qemud_message_processor.cpp rename to src/anbox/qemu/qemud_message_processor.cpp index 73663eaf..80fa4b64 100644 --- a/src/anbox/support/qemud_message_processor.cpp +++ b/src/anbox/qemu/qemud_message_processor.cpp @@ -15,7 +15,7 @@ * */ -#include "anbox/support/qemud_message_processor.h" +#include "anbox/qemu/qemud_message_processor.h" #include "anbox/utils.h" #include "anbox/logger.h" @@ -26,7 +26,7 @@ static constexpr const long header_size{4}; } namespace anbox { -namespace support { +namespace qemu { QemudMessageProcessor::QemudMessageProcessor(const std::shared_ptr &messenger) : messenger_(messenger) { } @@ -83,5 +83,5 @@ void QemudMessageProcessor::finish_message() { // Send terminating NULL byte messenger_->send(static_cast(""), 1); } -} // namespace support +} // namespace qemu } // namespace anbox diff --git a/src/anbox/support/qemud_message_processor.h b/src/anbox/qemu/qemud_message_processor.h similarity index 92% rename from src/anbox/support/qemud_message_processor.h rename to src/anbox/qemu/qemud_message_processor.h index e57e853d..eee7fdf6 100644 --- a/src/anbox/support/qemud_message_processor.h +++ b/src/anbox/qemu/qemud_message_processor.h @@ -15,14 +15,14 @@ * */ -#ifndef ANBOX_SUPPORT_QEMUD_MESSAGE_PROCESSOR_H_ -#define ANBOX_SUPPORT_QEMUD_MESSAGE_PROCESSOR_H_ +#ifndef ANBOX_QEMU_QEMUD_MESSAGE_PROCESSOR_H_ +#define ANBOX_QEMU_QEMUD_MESSAGE_PROCESSOR_H_ #include "anbox/network/message_processor.h" #include "anbox/network/socket_messenger.h" namespace anbox { -namespace support { +namespace qemu { class QemudMessageProcessor : public network::MessageProcessor { public: QemudMessageProcessor(const std::shared_ptr &messenger); diff --git a/src/anbox/support/sensors_message_processor.cpp b/src/anbox/qemu/sensors_message_processor.cpp similarity index 93% rename from src/anbox/support/sensors_message_processor.cpp rename to src/anbox/qemu/sensors_message_processor.cpp index ff897838..4aca92b9 100644 --- a/src/anbox/support/sensors_message_processor.cpp +++ b/src/anbox/qemu/sensors_message_processor.cpp @@ -16,10 +16,10 @@ */ #include "anbox/logger.h" -#include "anbox/support/sensors_message_processor.h" +#include "anbox/qemu/sensors_message_processor.h" namespace anbox { -namespace support { +namespace qemu { SensorsMessageProcessor::SensorsMessageProcessor(const std::shared_ptr &messenger) : QemudMessageProcessor(messenger) { } @@ -42,5 +42,5 @@ void SensorsMessageProcessor::list_sensors() { messenger_->send(buf, strlen(buf)); finish_message(); } -} // namespace support +} // namespace qemu } // namespace anbox diff --git a/src/anbox/support/sensors_message_processor.h b/src/anbox/qemu/sensors_message_processor.h similarity index 85% rename from src/anbox/support/sensors_message_processor.h rename to src/anbox/qemu/sensors_message_processor.h index fd946466..95b4aeb7 100644 --- a/src/anbox/support/sensors_message_processor.h +++ b/src/anbox/qemu/sensors_message_processor.h @@ -15,13 +15,13 @@ * */ -#ifndef ANBOX_SUPPORT_SENSORS_MESSAGE_PROCESSOR_H_ -#define ANBOX_SUPPORT_SENSORS_MESSAGE_PROCESSOR_H_ +#ifndef ANBOX_QEMU_SENSORS_MESSAGE_PROCESSOR_H_ +#define ANBOX_QEMU_SENSORS_MESSAGE_PROCESSOR_H_ -#include "anbox/support/qemud_message_processor.h" +#include "anbox/qemu/qemud_message_processor.h" namespace anbox { -namespace support { +namespace qemu { class SensorsMessageProcessor : public QemudMessageProcessor { public: SensorsMessageProcessor(const std::shared_ptr &messenger); diff --git a/src/anbox/support/telephony_manager.cpp b/src/anbox/qemu/telephony_manager.cpp similarity index 93% rename from src/anbox/support/telephony_manager.cpp rename to src/anbox/qemu/telephony_manager.cpp index e612ad90..25c44deb 100644 --- a/src/anbox/support/telephony_manager.cpp +++ b/src/anbox/qemu/telephony_manager.cpp @@ -15,12 +15,12 @@ * */ -#include "anbox/support/telephony_manager.h" +#include "anbox/qemu/telephony_manager.h" #include "anbox/dbus/ofono.h" #include "anbox/logger.h" namespace anbox { -namespace support { +namespace qemu { TelephonyManager::TelephonyManager(const core::dbus::Bus::Ptr &bus) : bus_(bus) { ofono_ = core::dbus::Service::use_service(bus_, "org.ofono"); @@ -34,5 +34,5 @@ TelephonyManager::TelephonyManager(const core::dbus::Bus::Ptr &bus) : TelephonyManager::~TelephonyManager() { } -} // namespace support +} // namespace qemu } // namespace anbox diff --git a/src/anbox/support/telephony_manager.h b/src/anbox/qemu/telephony_manager.h similarity index 88% rename from src/anbox/support/telephony_manager.h rename to src/anbox/qemu/telephony_manager.h index 23600cd3..97425611 100644 --- a/src/anbox/support/telephony_manager.h +++ b/src/anbox/qemu/telephony_manager.h @@ -15,15 +15,15 @@ * */ -#ifndef ANBOX_SUPPORT_TELEPHONY_MANAGER_H_ -#define ANBOX_SUPPORT_TELEPHONY_MANAGER_H_ +#ifndef ANBOX_QEMU_TELEPHONY_MANAGER_H_ +#define ANBOX_QEMU_TELEPHONY_MANAGER_H_ #include #include #include namespace anbox { -namespace support { +namespace qemu { class TelephonyManager { public: TelephonyManager(const core::dbus::Bus::Ptr &bus); @@ -34,7 +34,7 @@ private: core::dbus::Service::Ptr ofono_; core::dbus::Object::Ptr modem_; }; -} // namespace support +} // namespace qemu } // namespace anbox #endif diff --git a/tests/anbox/support/at_parser_tests.cpp b/tests/anbox/support/at_parser_tests.cpp index 04326324..c316ea9d 100644 --- a/tests/anbox/support/at_parser_tests.cpp +++ b/tests/anbox/support/at_parser_tests.cpp @@ -15,14 +15,14 @@ * */ -#include "anbox/support/at_parser.h" +#include "anbox/qemu/at_parser.h" #include #include TEST(AtParser, BasicCommands) { - anbox::support::AtParser parser; + anbox::qemu::AtParser parser; std::string command = "ATE0Q0V1\nATE0Q0V1\n"; std::vector data; -- GitLab