2 * Copyright (C) 2016 Simon Fels <morphis@gravedo.de>
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.
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.
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/>.
18 #define LOG_TAG "Anboxd"
20 #include "android/service/message_processor.h"
21 #include "android/service/android_api_skeleton.h"
23 #include "anbox/rpc/template_message_processor.h"
25 #include "anbox_rpc.pb.h"
26 #include "anbox_bridge.pb.h"
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) {
36 MessageProcessor::~MessageProcessor() {
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);
50 void MessageProcessor::process_event_sequence(const std::string&) {
52 } // namespace network