fd378402194822949e822f3dfa12b12d9d4ed94a
[iec.git] / src / type3_AndroidCloud / anbox-master / android / service / android_api_skeleton.h
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 #ifndef ANBOX_PLATFORM_API_SKELETON_H_
19 #define ANBOX_PLATFORM_API_SKELETON_H_
20
21 #include "android/service/activity_manager_interface.h"
22
23 namespace google {
24 namespace protobuf {
25 class Closure;
26 } // namespace protobuf
27 } // namespace google
28
29 namespace core {
30 namespace posix {
31 class ChildProcess;
32 } // posix
33 } // core
34
35 namespace anbox {
36 namespace protobuf {
37 namespace bridge {
38 class InstallApplication;
39 class LaunchApplication;
40 class SetDnsServers;
41 class SetFocusedTask;
42 class RemoveTask;
43 class ResizeTask;
44 } // namespace bridge
45 namespace rpc {
46 class Void;
47 } // namespace rpc
48 } // namespace protobuf
49 class AndroidApiSkeleton {
50 public:
51     AndroidApiSkeleton();
52     ~AndroidApiSkeleton();
53
54     void launch_application(anbox::protobuf::bridge::LaunchApplication const *request,
55                             anbox::protobuf::rpc::Void *response,
56                             google::protobuf::Closure *done);
57
58     void set_focused_task(anbox::protobuf::bridge::SetFocusedTask const *request,
59                           anbox::protobuf::rpc::Void *response,
60                           google::protobuf::Closure *done);
61
62     void remove_task(anbox::protobuf::bridge::RemoveTask const *request,
63                      anbox::protobuf::rpc::Void *response,
64                      google::protobuf::Closure *done);
65
66     void resize_task(anbox::protobuf::bridge::ResizeTask const *request,
67                      anbox::protobuf::rpc::Void *response,
68                      google::protobuf::Closure *done);
69
70 private:
71     void wait_for_process(core::posix::ChildProcess &process,
72                           anbox::protobuf::rpc::Void *response);
73
74     void connect_services();
75
76     android::sp<android::BpActivityManager> activity_manager_;
77 };
78 } // namespace anbox
79
80 #endif