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 #ifndef ANBOX_ANDROID_PLATFORM_SERVICE_INTERFACE_H_
19 #define ANBOX_ANDROID_PLATFORM_SERVICE_INTERFACE_H_
21 #include <binder/IBinder.h>
22 #include <binder/IInterface.h>
23 #include <binder/Parcel.h>
25 #include <utils/String16.h>
26 #include <utils/StrongPointer.h>
31 class IPlatformService : public IInterface {
33 DECLARE_META_INTERFACE(PlatformService);
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,
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;
51 class BpPlatformService : public BpInterface<IPlatformService> {
53 BpPlatformService(const sp<IBinder> &binder);
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;
62 class BnPlatformService : public BnInterface<IPlatformService> {
64 virtual status_t onTransact(uint32_t code, const Parcel &data,
65 Parcel *reply, uint32_t flags);
67 } // namespace android