eb1617dfe86afa7c927c3acf49c8e183dfcc9a29
[iec.git] / src / type3_AndroidCloud / anbox-master / android / service / message_processor.cpp
1 /*
2  * Copyright (C) 2016 Simon Fels <morphis@gravedo.de>
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 3, as published
6  * by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranties of
10  * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11  * PURPOSE.  See the GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License along
14  * with this program.  If not, see <http://www.gnu.org/licenses/>.
15  *
16  */
17
18 #define LOG_TAG "Anboxd"
19
20 #include "android/service/message_processor.h"
21 #include "android/service/android_api_skeleton.h"
22
23 #include "anbox/rpc/template_message_processor.h"
24
25 #include "anbox_rpc.pb.h"
26 #include "anbox_bridge.pb.h"
27
28 namespace anbox {
29 MessageProcessor::MessageProcessor(const std::shared_ptr<network::MessageSender> &sender,
30                                    const std::shared_ptr<rpc::PendingCallCache> &pending_calls,
31                                    const std::shared_ptr<AndroidApiSkeleton> &platform_api) :
32     rpc::MessageProcessor(sender, pending_calls),
33     platform_api_(platform_api) {
34 }
35
36 MessageProcessor::~MessageProcessor() {
37 }
38
39 void MessageProcessor::dispatch(rpc::Invocation const& invocation) {
40   if (invocation.method_name() == "launch_application")
41     invoke(this, platform_api_.get(), &AndroidApiSkeleton::launch_application, invocation);
42   else if (invocation.method_name() == "set_focused_task")
43     invoke(this, platform_api_.get(), &AndroidApiSkeleton::set_focused_task, invocation);
44   else if (invocation.method_name() == "remove_task")
45     invoke(this, platform_api_.get(), &AndroidApiSkeleton::remove_task, invocation);
46   else if (invocation.method_name() == "resize_task")
47     invoke(this, platform_api_.get(), &AndroidApiSkeleton::resize_task, invocation);
48 }
49
50 void MessageProcessor::process_event_sequence(const std::string&) {
51 }
52 } // namespace network