Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
anbox
提交
09ec800e
A
anbox
项目概览
openeuler
/
anbox
通知
24
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
anbox
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
09ec800e
编写于
7月 04, 2016
作者:
S
Simon Fels
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move all qemu stuff in the correct subdirectory/namespace
上级
3ccf1d04
变更
28
隐藏空白更改
内联
并排
Showing
28 changed file
with
133 addition
and
135 deletion
+133
-135
src/CMakeLists.txt
src/CMakeLists.txt
+11
-11
src/anbox/cmds/run.cpp
src/anbox/cmds/run.cpp
+4
-4
src/anbox/input/device.cpp
src/anbox/input/device.cpp
+2
-2
src/anbox/qemu/at_parser.cpp
src/anbox/qemu/at_parser.cpp
+3
-3
src/anbox/qemu/at_parser.h
src/anbox/qemu/at_parser.h
+4
-4
src/anbox/qemu/boot_properties_message_processor.cpp
src/anbox/qemu/boot_properties_message_processor.cpp
+3
-3
src/anbox/qemu/boot_properties_message_processor.h
src/anbox/qemu/boot_properties_message_processor.h
+4
-4
src/anbox/qemu/bootanimation_message_processor.cpp
src/anbox/qemu/bootanimation_message_processor.cpp
+3
-3
src/anbox/qemu/bootanimation_message_processor.h
src/anbox/qemu/bootanimation_message_processor.h
+4
-4
src/anbox/qemu/camera_message_processor.cpp
src/anbox/qemu/camera_message_processor.cpp
+3
-3
src/anbox/qemu/camera_message_processor.h
src/anbox/qemu/camera_message_processor.h
+3
-3
src/anbox/qemu/fingerprint_message_processor.cpp
src/anbox/qemu/fingerprint_message_processor.cpp
+3
-3
src/anbox/qemu/fingerprint_message_processor.h
src/anbox/qemu/fingerprint_message_processor.h
+4
-4
src/anbox/qemu/gsm_message_processor.cpp
src/anbox/qemu/gsm_message_processor.cpp
+4
-4
src/anbox/qemu/gsm_message_processor.h
src/anbox/qemu/gsm_message_processor.h
+3
-3
src/anbox/qemu/hwcontrol_message_processor.cpp
src/anbox/qemu/hwcontrol_message_processor.cpp
+3
-3
src/anbox/qemu/hwcontrol_message_processor.h
src/anbox/qemu/hwcontrol_message_processor.h
+4
-4
src/anbox/qemu/null_message_processor.cpp
src/anbox/qemu/null_message_processor.cpp
+3
-3
src/anbox/qemu/null_message_processor.h
src/anbox/qemu/null_message_processor.h
+3
-3
src/anbox/qemu/pipe_connection_creator.cpp
src/anbox/qemu/pipe_connection_creator.cpp
+31
-32
src/anbox/qemu/pipe_connection_creator.h
src/anbox/qemu/pipe_connection_creator.h
+9
-10
src/anbox/qemu/qemud_message_processor.cpp
src/anbox/qemu/qemud_message_processor.cpp
+3
-3
src/anbox/qemu/qemud_message_processor.h
src/anbox/qemu/qemud_message_processor.h
+3
-3
src/anbox/qemu/sensors_message_processor.cpp
src/anbox/qemu/sensors_message_processor.cpp
+3
-3
src/anbox/qemu/sensors_message_processor.h
src/anbox/qemu/sensors_message_processor.h
+4
-4
src/anbox/qemu/telephony_manager.cpp
src/anbox/qemu/telephony_manager.cpp
+3
-3
src/anbox/qemu/telephony_manager.h
src/anbox/qemu/telephony_manager.h
+4
-4
tests/anbox/support/at_parser_tests.cpp
tests/anbox/support/at_parser_tests.cpp
+2
-2
未找到文件。
src/CMakeLists.txt
浏览文件 @
09ec800e
...
...
@@ -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
...
...
src/anbox/cmds/run.cpp
浏览文件 @
09ec800e
...
...
@@ -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
<
network
::
PublishedSocketConnector
>
(
utils
::
string_format
(
"%s/qemu_pipe"
,
config
::
data_path
()),
rt
,
std
::
make_shared
<
network
::
Qemu
PipeConnectionCreator
>
(
rt
,
renderer
->
socket_path
(),
icon_
));
std
::
make_shared
<
qemu
::
PipeConnectionCreator
>
(
rt
,
renderer
->
socket_path
(),
icon_
));
auto
android_api_stub
=
std
::
make_shared
<
bridge
::
AndroidApiStub
>
();
...
...
src/anbox/input/device.cpp
浏览文件 @
09ec800e
...
...
@@ -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 <time.h>
...
...
@@ -163,7 +163,7 @@ void Device::new_client(std::shared_ptr<boost::asio::local::stream_protocol::soc
auto
const
messenger
=
std
::
make_shared
<
network
::
SocketMessenger
>
(
socket
);
auto
const
&
connection
=
std
::
make_shared
<
network
::
SocketConnection
>
(
messenger
,
messenger
,
next_id
(),
connections_
,
std
::
make_shared
<
support
::
NullMessageProcessor
>
());
std
::
make_shared
<
qemu
::
NullMessageProcessor
>
());
connections_
->
add
(
connection
);
...
...
src/anbox/
support
/at_parser.cpp
→
src/anbox/
qemu
/at_parser.cpp
浏览文件 @
09ec800e
...
...
@@ -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
src/anbox/
support
/at_parser.h
→
src/anbox/
qemu
/at_parser.h
浏览文件 @
09ec800e
...
...
@@ -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 <vector>
#include <map>
...
...
@@ -26,7 +26,7 @@
#include "anbox/do_not_copy_or_move.h"
namespace
anbox
{
namespace
support
{
namespace
qemu
{
class
AtParser
{
public:
typedef
std
::
function
<
void
(
const
std
::
string
&
)
>
CommandHandler
;
...
...
@@ -42,7 +42,7 @@ private:
std
::
map
<
std
::
string
,
CommandHandler
>
handlers_
;
};
}
// namespace
support
}
// namespace
qemu
}
// namespace anbox
#endif
src/anbox/
support
/boot_properties_message_processor.cpp
→
src/anbox/
qemu
/boot_properties_message_processor.cpp
浏览文件 @
09ec800e
...
...
@@ -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
<
network
::
SocketMessenger
>
&
messenger
)
:
QemudMessageProcessor
(
messenger
)
{
}
...
...
@@ -74,5 +74,5 @@ void BootPropertiesMessageProcessor::list_properties() {
finish_message
();
}
}
// namespace
support
}
// namespace
qemu
}
// namespace anbox
src/anbox/
support
/boot_properties_message_processor.h
→
src/anbox/
qemu
/boot_properties_message_processor.h
浏览文件 @
09ec800e
...
...
@@ -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
<
network
::
SocketMessenger
>
&
messenger
);
...
...
src/anbox/
support
/bootanimation_message_processor.cpp
→
src/anbox/
qemu
/bootanimation_message_processor.cpp
浏览文件 @
09ec800e
...
...
@@ -16,12 +16,12 @@
*/
#include "anbox/logger.h"
#include "anbox/
support
/bootanimation_message_processor.h"
#include "anbox/
qemu/
/bootanimation_message_processor.h"
#include <fstream>
namespace
anbox
{
namespace
support
{
namespace
qemu
{
BootAnimationMessageProcessor
::
BootAnimationMessageProcessor
(
const
std
::
shared_ptr
<
network
::
SocketMessenger
>
&
messenger
,
const
std
::
string
&
icon_path
)
:
QemudMessageProcessor
(
messenger
),
...
...
@@ -48,5 +48,5 @@ void BootAnimationMessageProcessor::retrieve_icon() {
}
}
}
// namespace
support
}
// namespace
qemu
}
// namespace anbox
src/anbox/
support
/bootanimation_message_processor.h
→
src/anbox/
qemu
/bootanimation_message_processor.h
浏览文件 @
09ec800e
...
...
@@ -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
<
network
::
SocketMessenger
>
&
messenger
,
...
...
src/anbox/
support
/camera_message_processor.cpp
→
src/anbox/
qemu
/camera_message_processor.cpp
浏览文件 @
09ec800e
...
...
@@ -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
<
network
::
SocketMessenger
>
&
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
src/anbox/
support
/camera_message_processor.h
→
src/anbox/
qemu
/camera_message_processor.h
浏览文件 @
09ec800e
...
...
@@ -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
<
network
::
SocketMessenger
>
&
messenger
);
...
...
src/anbox/
support
/fingerprint_message_processor.cpp
→
src/anbox/
qemu
/fingerprint_message_processor.cpp
浏览文件 @
09ec800e
...
...
@@ -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
<
network
::
SocketMessenger
>
&
messenger
)
:
QemudMessageProcessor
(
messenger
)
{
}
...
...
@@ -39,5 +39,5 @@ void FingerprintMessageProcessor::listen() {
messenger_
->
send
(
buf
,
strlen
(
buf
));
finish_message
();
}
}
// namespace
support
}
// namespace
qemu
}
// namespace anbox
src/anbox/
support
/fingerprint_message_processor.h
→
src/anbox/
qemu
/fingerprint_message_processor.h
浏览文件 @
09ec800e
...
...
@@ -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
<
network
::
SocketMessenger
>
&
messenger
);
...
...
src/anbox/
support
/gsm_message_processor.cpp
→
src/anbox/
qemu
/gsm_message_processor.cpp
浏览文件 @
09ec800e
...
...
@@ -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 <algorithm>
#include <functional>
...
...
@@ -25,7 +25,7 @@
using
namespace
std
::
placeholders
;
namespace
anbox
{
namespace
support
{
namespace
qemu
{
GsmMessageProcessor
::
GsmMessageProcessor
(
const
std
::
shared_ptr
<
network
::
SocketMessenger
>
&
messenger
)
:
messenger_
(
messenger
),
parser_
(
std
::
make_shared
<
AtParser
>
())
{
...
...
@@ -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
src/anbox/
support
/gsm_message_processor.h
→
src/anbox/
qemu
/gsm_message_processor.h
浏览文件 @
09ec800e
...
...
@@ -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:
...
...
src/anbox/
support
/hwcontrol_message_processor.cpp
→
src/anbox/
qemu
/hwcontrol_message_processor.cpp
浏览文件 @
09ec800e
...
...
@@ -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
<
network
::
SocketMessenger
>
&
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
src/anbox/
support
/hwcontrol_message_processor.h
→
src/anbox/
qemu
/hwcontrol_message_processor.h
浏览文件 @
09ec800e
...
...
@@ -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
<
network
::
SocketMessenger
>
&
messenger
);
...
...
src/anbox/
support
/null_message_processor.cpp
→
src/anbox/
qemu
/null_message_processor.cpp
浏览文件 @
09ec800e
...
...
@@ -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 <string.h>
namespace
anbox
{
namespace
support
{
namespace
qemu
{
NullMessageProcessor
::
NullMessageProcessor
()
{
}
...
...
@@ -33,5 +33,5 @@ bool NullMessageProcessor::process_data(const std::vector<std::uint8_t> &data) {
DEBUG
(
"Received: %s"
,
utils
::
hex_dump
(
data
.
data
(),
data
.
size
()));
return
true
;
}
}
// namespace
support
}
// namespace
qemu
}
// namespace anbox
src/anbox/
support
/null_message_processor.h
→
src/anbox/
qemu
/null_message_processor.h
浏览文件 @
09ec800e
...
...
@@ -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
();
...
...
src/anbox/
network/qemu_
pipe_connection_creator.cpp
→
src/anbox/
qemu/
pipe_connection_creator.cpp
浏览文件 @
09ec800e
...
...
@@ -18,52 +18,52 @@
#include <string>
#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
::
Qemu
PipeConnectionCreator
(
const
std
::
shared_ptr
<
Runtime
>
&
rt
,
const
std
::
string
&
renderer_socket_path
,
const
std
::
string
&
boot_animation_icon_path
)
:
namespace
qemu
{
PipeConnectionCreator
::
PipeConnectionCreator
(
const
std
::
shared_ptr
<
Runtime
>
&
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
<
SocketConnection
>>
()),
connections_
(
std
::
make_shared
<
network
::
Connections
<
network
::
SocketConnection
>>
()),
renderer_socket_path_
(
renderer_socket_path
),
boot_animation_icon_path_
(
boot_animation_icon_path
)
{
}
QemuPipeConnectionCreator
::~
Qemu
PipeConnectionCreator
()
{
PipeConnectionCreator
::~
PipeConnectionCreator
()
{
}
void
Qemu
PipeConnectionCreator
::
create_connection_for
(
void
PipeConnectionCreator
::
create_connection_for
(
std
::
shared_ptr
<
boost
::
asio
::
local
::
stream_protocol
::
socket
>
const
&
socket
)
{
auto
const
messenger
=
std
::
make_shared
<
SocketMessenger
>
(
socket
);
auto
const
messenger
=
std
::
make_shared
<
network
::
SocketMessenger
>
(
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
<
SocketConnection
>
(
auto
const
&
connection
=
std
::
make_shared
<
network
::
SocketConnection
>
(
messenger
,
messenger
,
next_id
(),
connections_
,
processor
);
connections_
->
add
(
connection
);
connection
->
read_next_message
();
}
QemuPipeConnectionCreator
::
client_type
Qemu
PipeConnectionCreator
::
identify_client
(
std
::
shared_ptr
<
SocketMessenger
>
const
&
messenger
)
{
PipeConnectionCreator
::
client_type
PipeConnectionCreator
::
identify_client
(
std
::
shared_ptr
<
network
::
SocketMessenger
>
const
&
messenger
)
{
// The client will identify itself as first thing by writing a string
// in the format 'pipe:<name>[:<arguments>]\0' to the channel.
...
...
@@ -104,31 +104,30 @@ QemuPipeConnectionCreator::client_type QemuPipeConnectionCreator::identify_clien
return
client_type
::
invalid
;
}
std
::
shared_ptr
<
MessageProcessor
>
QemuPipeConnectionCreator
::
create_processor
(
const
client_type
&
type
,
const
std
::
shared_ptr
<
SocketMessenger
>
&
messenger
)
{
std
::
shared_ptr
<
network
::
MessageProcessor
>
PipeConnectionCreator
::
create_processor
(
const
client_type
&
type
,
const
std
::
shared_ptr
<
network
::
SocketMessenger
>
&
messenger
)
{
if
(
type
==
client_type
::
opengles
)
return
std
::
make_shared
<
graphics
::
OpenGlesMessageProcessor
>
(
renderer_socket_path_
,
runtime_
,
messenger
);
else
if
(
type
==
client_type
::
qemud_boot_properties
)
return
std
::
make_shared
<
support
::
BootPropertiesMessageProcessor
>
(
messenger
);
return
std
::
make_shared
<
qemu
::
BootPropertiesMessageProcessor
>
(
messenger
);
else
if
(
type
==
client_type
::
qemud_hw_control
)
return
std
::
make_shared
<
support
::
HwControlMessageProcessor
>
(
messenger
);
return
std
::
make_shared
<
qemu
::
HwControlMessageProcessor
>
(
messenger
);
else
if
(
type
==
client_type
::
qemud_sensors
)
return
std
::
make_shared
<
support
::
SensorsMessageProcessor
>
(
messenger
);
return
std
::
make_shared
<
qemu
::
SensorsMessageProcessor
>
(
messenger
);
else
if
(
type
==
client_type
::
qemud_camera
)
return
std
::
make_shared
<
support
::
CameraMessageProcessor
>
(
messenger
);
return
std
::
make_shared
<
qemu
::
CameraMessageProcessor
>
(
messenger
);
else
if
(
type
==
client_type
::
qemud_fingerprint
)
return
std
::
make_shared
<
support
::
FingerprintMessageProcessor
>
(
messenger
);
return
std
::
make_shared
<
qemu
::
FingerprintMessageProcessor
>
(
messenger
);
else
if
(
type
==
client_type
::
qemud_gsm
)
return
std
::
make_shared
<
support
::
GsmMessageProcessor
>
(
messenger
);
return
std
::
make_shared
<
qemu
::
GsmMessageProcessor
>
(
messenger
);
else
if
(
type
==
client_type
::
bootanimation
)
return
std
::
make_shared
<
support
::
BootAnimationMessageProcessor
>
(
messenger
,
boot_animation_icon_path_
);
return
std
::
make_shared
<
qemu
::
BootAnimationMessageProcessor
>
(
messenger
,
boot_animation_icon_path_
);
return
std
::
make_shared
<
support
::
NullMessageProcessor
>
();
return
std
::
make_shared
<
qemu
::
NullMessageProcessor
>
();
}
int
Qemu
PipeConnectionCreator
::
next_id
()
int
PipeConnectionCreator
::
next_id
()
{
return
next_connection_id_
.
fetch_add
(
1
);
}
}
// namespace qemu
}
// namespace anbox
}
// namespace network
src/anbox/
network/qemu_
pipe_connection_creator.h
→
src/anbox/
qemu/
pipe_connection_creator.h
浏览文件 @
09ec800e
...
...
@@ -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:
Qemu
PipeConnectionCreator
(
PipeConnectionCreator
(
const
std
::
shared_ptr
<
Runtime
>
&
rt
,
const
std
::
string
&
renderer_socket_path
,
const
std
::
string
&
boot_animation_icon_path
);
~
Qemu
PipeConnectionCreator
()
noexcept
;
~
PipeConnectionCreator
()
noexcept
;
void
create_connection_for
(
std
::
shared_ptr
<
boost
::
asio
::
local
::
stream_protocol
::
socket
>
const
&
socket
)
override
;
...
...
@@ -58,18 +57,18 @@ public:
private:
int
next_id
();
client_type
identify_client
(
std
::
shared_ptr
<
SocketMessenger
>
const
&
messenger
);
std
::
shared_ptr
<
MessageProcessor
>
create_processor
(
const
client_type
&
type
,
const
std
::
shared_ptr
<
SocketMessenger
>
&
messenger
);
client_type
identify_client
(
std
::
shared_ptr
<
network
::
SocketMessenger
>
const
&
messenger
);
std
::
shared_ptr
<
network
::
MessageProcessor
>
create_processor
(
const
client_type
&
type
,
const
std
::
shared_ptr
<
network
::
SocketMessenger
>
&
messenger
);
std
::
shared_ptr
<
Runtime
>
runtime_
;
std
::
atomic
<
int
>
next_connection_id_
;
std
::
shared_ptr
<
Connections
<
SocketConnection
>>
const
connections_
;
std
::
shared_ptr
<
network
::
Connections
<
network
::
SocketConnection
>>
const
connections_
;
std
::
string
renderer_socket_path_
;
std
::
string
boot_animation_icon_path_
;
};
}
// namespace qemu
}
// namespace anbox
}
// namespace network
#endif
src/anbox/
support
/qemud_message_processor.cpp
→
src/anbox/
qemu
/qemud_message_processor.cpp
浏览文件 @
09ec800e
...
...
@@ -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
<
network
::
SocketMessenger
>
&
messenger
)
:
messenger_
(
messenger
)
{
}
...
...
@@ -83,5 +83,5 @@ void QemudMessageProcessor::finish_message() {
// Send terminating NULL byte
messenger_
->
send
(
static_cast
<
const
char
*>
(
""
),
1
);
}
}
// namespace
support
}
// namespace
qemu
}
// namespace anbox
src/anbox/
support
/qemud_message_processor.h
→
src/anbox/
qemu
/qemud_message_processor.h
浏览文件 @
09ec800e
...
...
@@ -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
<
network
::
SocketMessenger
>
&
messenger
);
...
...
src/anbox/
support
/sensors_message_processor.cpp
→
src/anbox/
qemu
/sensors_message_processor.cpp
浏览文件 @
09ec800e
...
...
@@ -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
<
network
::
SocketMessenger
>
&
messenger
)
:
QemudMessageProcessor
(
messenger
)
{
}
...
...
@@ -42,5 +42,5 @@ void SensorsMessageProcessor::list_sensors() {
messenger_
->
send
(
buf
,
strlen
(
buf
));
finish_message
();
}
}
// namespace
support
}
// namespace
qemu
}
// namespace anbox
src/anbox/
support
/sensors_message_processor.h
→
src/anbox/
qemu
/sensors_message_processor.h
浏览文件 @
09ec800e
...
...
@@ -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
<
network
::
SocketMessenger
>
&
messenger
);
...
...
src/anbox/
support
/telephony_manager.cpp
→
src/anbox/
qemu
/telephony_manager.cpp
浏览文件 @
09ec800e
...
...
@@ -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
src/anbox/
support
/telephony_manager.h
→
src/anbox/
qemu
/telephony_manager.h
浏览文件 @
09ec800e
...
...
@@ -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 <core/dbus/bus.h>
#include <core/dbus/service.h>
#include <core/dbus/object.h>
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
tests/anbox/support/at_parser_tests.cpp
浏览文件 @
09ec800e
...
...
@@ -15,14 +15,14 @@
*
*/
#include "anbox/
support
/at_parser.h"
#include "anbox/
qemu
/at_parser.h"
#include <gtest/gtest.h>
#include <algorithm>
TEST
(
AtParser
,
BasicCommands
)
{
anbox
::
support
::
AtParser
parser
;
anbox
::
qemu
::
AtParser
parser
;
std
::
string
command
=
"ATE0Q0V1
\n
ATE0Q0V1
\n
"
;
std
::
vector
<
uint8_t
>
data
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录