TYPE3
[iec.git] / src / type3_AndroidCloud / anbox-master / android / service / activity_manager_interface.cpp
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 #define LOG_TAG "Anboxd"
19
20 #include "android/service/activity_manager_interface.h"
21
22 namespace android {
23 BpActivityManager::BpActivityManager(const sp<IBinder> &binder) :
24     BpInterface<IActivityManager>(binder) {
25 }
26
27 status_t BpActivityManager::setFocusedTask(int32_t id) {
28     Parcel data, reply;
29     data.writeInterfaceToken(IActivityManager::getInterfaceDescriptor());
30     data.writeInt32(id);
31     return remote()->transact(IActivityManager::SET_FOCUSED_TASK, data, &reply);
32 }
33
34 status_t BpActivityManager::removeTask(int32_t id) {
35   Parcel data, reply;
36   data.writeInterfaceToken(IActivityManager::getInterfaceDescriptor());
37   data.writeInt32(id);
38   return remote()->transact(IActivityManager::REMOVE_TASK, data, &reply);
39 }
40
41 status_t BpActivityManager::resizeTask(int32_t id, const anbox::graphics::Rect &rect, int resize_mode) {
42   Parcel data, reply;
43   data.writeInterfaceToken(IActivityManager::getInterfaceDescriptor());
44   data.writeInt32(id);
45   data.writeInt32(resize_mode);
46   data.writeInt32(rect.left());
47   data.writeInt32(rect.top());
48   data.writeInt32(rect.right());
49   data.writeInt32(rect.bottom());
50   return remote()->transact(IActivityManager::RESIZE_TASK, data, &reply);
51 }
52
53 IMPLEMENT_META_INTERFACE(ActivityManager, "android.app.IActivityManager");
54 } // namespace android