TYPE3
[iec.git] / src / type3_AndroidCloud / anbox-master / android / service / platform_service_interface.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_ANDROID_PLATFORM_SERVICE_INTERFACE_H_
19 #define ANBOX_ANDROID_PLATFORM_SERVICE_INTERFACE_H_
20
21 #include <binder/IBinder.h>
22 #include <binder/IInterface.h>
23 #include <binder/Parcel.h>
24
25 #include <utils/String16.h>
26 #include <utils/StrongPointer.h>
27
28 #include <cstdint>
29
30 namespace android {
31 class IPlatformService : public IInterface {
32 public:
33     DECLARE_META_INTERFACE(PlatformService);
34
35     enum {
36         // Keep this synchronized with frameworks/base/services/java/com/android/server/wm/AnboxPlatformServiceProxy.java
37         BOOT_FINISHED = IBinder::FIRST_CALL_TRANSACTION,
38         UPDATE_WINDOW_STATE = IBinder::FIRST_CALL_TRANSACTION + 1,
39         UPDATE_APPLICATION_LIST = IBinder::FIRST_CALL_TRANSACTION + 2,
40         SET_CLIPBOARD_DATA = IBinder::FIRST_CALL_TRANSACTION + 3,
41         GET_CLIPBOARD_DATA = IBinder::FIRST_CALL_TRANSACTION + 4,
42     };
43
44     virtual status_t boot_finished() = 0;
45     virtual status_t update_window_state(const Parcel &data) = 0;
46     virtual status_t update_application_list(const Parcel &data) = 0;
47     virtual status_t set_clipboard_data(const Parcel &data) = 0;
48     virtual status_t get_clipboard_data(const Parcel &data, Parcel *reply) = 0;
49 };
50
51 class BpPlatformService : public BpInterface<IPlatformService> {
52 public:
53     BpPlatformService(const sp<IBinder> &binder);
54
55     status_t boot_finished() override;
56     status_t update_window_state(const Parcel &data) override;
57     status_t update_application_list(const Parcel &data) override;
58     status_t set_clipboard_data(const Parcel &data) override;
59     status_t get_clipboard_data(const Parcel &data, Parcel *reply) override;
60 };
61
62 class BnPlatformService : public BnInterface<IPlatformService> {
63 public:
64     virtual status_t onTransact(uint32_t code, const Parcel &data,
65                                 Parcel *reply, uint32_t flags);
66 };
67 } // namespace android
68 #endif