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 #include "android/service/platform_service_interface.h"
21 BpPlatformService::BpPlatformService(const sp<IBinder> &binder) :
22 BpInterface<IPlatformService>(binder) {
25 status_t BpPlatformService::boot_finished() {
27 data.writeInterfaceToken(IPlatformService::getInterfaceDescriptor());
28 return remote()->transact(IPlatformService::BOOT_FINISHED, data, &reply);
31 status_t BpPlatformService::update_window_state(const Parcel&) {
33 data.writeInterfaceToken(IPlatformService::getInterfaceDescriptor());
34 return remote()->transact(IPlatformService::UPDATE_WINDOW_STATE, data, &reply);
37 status_t BpPlatformService::update_application_list(const Parcel&) {
39 data.writeInterfaceToken(IPlatformService::getInterfaceDescriptor());
40 return remote()->transact(IPlatformService::UPDATE_APPLICATION_LIST, data, &reply);
43 status_t BpPlatformService::set_clipboard_data(const Parcel&) {
45 data.writeInterfaceToken(IPlatformService::getInterfaceDescriptor());
46 return remote()->transact(IPlatformService::SET_CLIPBOARD_DATA, data, &reply);
49 status_t BpPlatformService::get_clipboard_data(const Parcel&, Parcel*) {
51 data.writeInterfaceToken(IPlatformService::getInterfaceDescriptor());
52 return remote()->transact(IPlatformService::GET_CLIPBOARD_DATA, data, &reply);
55 IMPLEMENT_META_INTERFACE(PlatformService, "org.anbox.IPlatformService");
57 status_t BnPlatformService::onTransact(uint32_t code, const Parcel &data,
58 Parcel *reply, uint32_t flags) {
61 CHECK_INTERFACE(IPlatformService, data, reply);
62 return boot_finished();
63 case UPDATE_WINDOW_STATE:
64 CHECK_INTERFACE(IPlatformService, data, reply);
65 return update_window_state(data);
66 case UPDATE_APPLICATION_LIST:
67 CHECK_INTERFACE(IPlatformService, data, reply);
68 return update_application_list(data);
69 case SET_CLIPBOARD_DATA:
70 CHECK_INTERFACE(IPlatformService, data, reply);
71 return set_clipboard_data(data);
72 case GET_CLIPBOARD_DATA:
73 CHECK_INTERFACE(IPlatformService, data, reply);
74 return get_clipboard_data(data, reply);
79 return BBinder::onTransact(code, data, reply, flags);
81 } // namespace android