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 #define LOG_TAG "Anboxd"
20 #include "android/service/activity_manager_interface.h"
23 BpActivityManager::BpActivityManager(const sp<IBinder> &binder) :
24 BpInterface<IActivityManager>(binder) {
27 status_t BpActivityManager::setFocusedTask(int32_t id) {
29 data.writeInterfaceToken(IActivityManager::getInterfaceDescriptor());
31 return remote()->transact(IActivityManager::SET_FOCUSED_TASK, data, &reply);
34 status_t BpActivityManager::removeTask(int32_t id) {
36 data.writeInterfaceToken(IActivityManager::getInterfaceDescriptor());
38 return remote()->transact(IActivityManager::REMOVE_TASK, data, &reply);
41 status_t BpActivityManager::resizeTask(int32_t id, const anbox::graphics::Rect &rect, int resize_mode) {
43 data.writeInterfaceToken(IActivityManager::getInterfaceDescriptor());
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);
53 IMPLEMENT_META_INTERFACE(ActivityManager, "android.app.IActivityManager");
54 } // namespace android