blob: 1c03b2fdf906880f4d85d1a4347ef82dbe2f4e98 [file] [log] [blame]
Evan Rosky0037e5f2019-11-05 10:26:24 -08001/**
2 * Copyright (c) 2020, The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Wale Ogunwale57946582020-03-21 14:29:07 -070017package android.window;
Evan Rosky0037e5f2019-11-05 10:26:24 -080018
19import android.app.ActivityManager;
Wale Ogunwale57946582020-03-21 14:29:07 -070020import android.window.ITaskOrganizer;
Wale Ogunwaleadf116e2020-03-27 16:36:01 -070021import android.window.WindowContainerToken;
Wale Ogunwale57946582020-03-21 14:29:07 -070022import android.window.WindowContainerTransaction;
Evan Rosky0037e5f2019-11-05 10:26:24 -080023
24/** @hide */
25interface ITaskOrganizerController {
26
27 /**
28 * Register a TaskOrganizer to manage tasks as they enter the given windowing mode.
29 * If there was already a TaskOrganizer for this windowing mode it will be evicted
30 * and receive taskVanished callbacks in the process.
31 */
32 void registerTaskOrganizer(ITaskOrganizer organizer, int windowingMode);
33
Robert Carre10ee3d2019-11-11 15:03:15 -080034 /**
Winson Chung8a168902020-03-12 22:39:22 -070035 * Unregisters a previously registered task organizer.
36 */
37 void unregisterTaskOrganizer(ITaskOrganizer organizer);
38
Evan Rosky0037e5f2019-11-05 10:26:24 -080039 /** Creates a persistent root task in WM for a particular windowing-mode. */
40 ActivityManager.RunningTaskInfo createRootTask(int displayId, int windowingMode);
41
42 /** Deletes a persistent root task in WM */
Wale Ogunwaleadf116e2020-03-27 16:36:01 -070043 boolean deleteRootTask(in WindowContainerToken task);
Evan Rosky0037e5f2019-11-05 10:26:24 -080044
Evan Roskya8fde152020-01-07 19:09:13 -080045 /** Gets direct child tasks (ordered from top-to-bottom) */
Wale Ogunwaleadf116e2020-03-27 16:36:01 -070046 List<ActivityManager.RunningTaskInfo> getChildTasks(in WindowContainerToken parent,
Evan Rosky29d4a0a2020-02-04 16:40:44 -080047 in int[] activityTypes);
48
49 /** Gets all root tasks on a display (ordered from top-to-bottom) */
50 List<ActivityManager.RunningTaskInfo> getRootTasks(int displayId, in int[] activityTypes);
Evan Roskya8fde152020-01-07 19:09:13 -080051
Evan Rosky0037e5f2019-11-05 10:26:24 -080052 /** Get the root task which contains the current ime target */
Wale Ogunwaleadf116e2020-03-27 16:36:01 -070053 WindowContainerToken getImeTarget(int display);
Evan Rosky0037e5f2019-11-05 10:26:24 -080054
55 /**
56 * Set's the root task to launch new tasks into on a display. {@code null} means no launch root
57 * and thus new tasks just end up directly on the display.
58 */
Wale Ogunwaleadf116e2020-03-27 16:36:01 -070059 void setLaunchRoot(int displayId, in WindowContainerToken root);
Winson Chunga1f869d2020-03-21 23:02:48 -070060
61 /**
62 * Requests that the given task organizer is notified when back is pressed on the root activity
63 * of one of its controlled tasks.
64 */
65 void setInterceptBackPressedOnTaskRoot(ITaskOrganizer organizer, boolean interceptBackPressed);
Evan Rosky0037e5f2019-11-05 10:26:24 -080066}