TYPE3
[iec.git] / src / type3_AndroidCloud / anbox-master / android / service / activity_manager_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_ACTIVITY_MANAGER_INTERFACE_H_
19 #define ANBOX_ANDROID_ACTIVITY_MANAGER_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 #include "anbox/graphics/rect.h"
31
32 namespace android {
33 class IActivityManager : public IInterface {
34 public:
35     DECLARE_META_INTERFACE(ActivityManager);
36
37     enum {
38         // This needs to stay synchronized with frameworks/base/core/java/android/app/IActivityManager.java
39         SET_FOCUSED_TASK = IBinder::FIRST_CALL_TRANSACTION + 130,
40         REMOVE_TASK = IBinder::FIRST_CALL_TRANSACTION + 131,
41         RESIZE_TASK = IBinder::FIRST_CALL_TRANSACTION + 285,
42     };
43
44     virtual status_t setFocusedTask(int32_t id) = 0;
45     virtual status_t removeTask(int32_t id) = 0;
46     virtual status_t resizeTask(int32_t id, const anbox::graphics::Rect &rect, int resize_mode) = 0;
47 };
48
49 class BpActivityManager : public BpInterface<IActivityManager> {
50 public:
51     BpActivityManager(const sp<IBinder> &binder);
52
53     status_t setFocusedTask(int32_t id) override;
54     status_t removeTask(int32_t id) override;
55     status_t resizeTask(int32_t id, const anbox::graphics::Rect &rect, int resize_mode);
56 };
57 } // namespace android
58 #endif