Evan Rosky | 0037e5f | 2019-11-05 10:26:24 -0800 | [diff] [blame] | 1 | /** |
| 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 Ogunwale | 5794658 | 2020-03-21 14:29:07 -0700 | [diff] [blame^] | 17 | package android.window; |
Evan Rosky | 0037e5f | 2019-11-05 10:26:24 -0800 | [diff] [blame] | 18 | |
| 19 | import android.app.ActivityManager; |
Wale Ogunwale | 5794658 | 2020-03-21 14:29:07 -0700 | [diff] [blame^] | 20 | import android.window.ITaskOrganizer; |
| 21 | import android.window.IWindowContainer; |
| 22 | import android.window.WindowContainerTransaction; |
Evan Rosky | 0037e5f | 2019-11-05 10:26:24 -0800 | [diff] [blame] | 23 | |
| 24 | /** @hide */ |
| 25 | interface 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 Carr | e10ee3d | 2019-11-11 15:03:15 -0800 | [diff] [blame] | 34 | /** |
Winson Chung | 8a16890 | 2020-03-12 22:39:22 -0700 | [diff] [blame] | 35 | * Unregisters a previously registered task organizer. |
| 36 | */ |
| 37 | void unregisterTaskOrganizer(ITaskOrganizer organizer); |
| 38 | |
| 39 | /** |
Robert Carr | e10ee3d | 2019-11-11 15:03:15 -0800 | [diff] [blame] | 40 | * Apply multiple WindowContainer operations at once. |
| 41 | * @param organizer If non-null this transaction will use the synchronization |
| 42 | * scheme described in BLASTSyncEngine.java. The SurfaceControl transaction |
| 43 | * containing the effects of this WindowContainer transaction will be passed |
| 44 | * to the organizers Transaction ready callback. If null the transaction |
| 45 | * will apply with non particular synchronization constraints (other than |
| 46 | * it will all apply at once). |
| 47 | * @return If organizer was non-null returns an ID for the sync operation which will |
| 48 | * later be passed to transactionReady. This lets TaskOrganizer implementations |
| 49 | * differentiate overlapping sync operations. |
| 50 | */ |
| 51 | int applyContainerTransaction(in WindowContainerTransaction t, ITaskOrganizer organizer); |
Evan Rosky | 0037e5f | 2019-11-05 10:26:24 -0800 | [diff] [blame] | 52 | |
| 53 | /** Creates a persistent root task in WM for a particular windowing-mode. */ |
| 54 | ActivityManager.RunningTaskInfo createRootTask(int displayId, int windowingMode); |
| 55 | |
| 56 | /** Deletes a persistent root task in WM */ |
| 57 | boolean deleteRootTask(IWindowContainer task); |
| 58 | |
Evan Rosky | a8fde15 | 2020-01-07 19:09:13 -0800 | [diff] [blame] | 59 | /** Gets direct child tasks (ordered from top-to-bottom) */ |
Evan Rosky | 29d4a0a | 2020-02-04 16:40:44 -0800 | [diff] [blame] | 60 | List<ActivityManager.RunningTaskInfo> getChildTasks(in IWindowContainer parent, |
| 61 | in int[] activityTypes); |
| 62 | |
| 63 | /** Gets all root tasks on a display (ordered from top-to-bottom) */ |
| 64 | List<ActivityManager.RunningTaskInfo> getRootTasks(int displayId, in int[] activityTypes); |
Evan Rosky | a8fde15 | 2020-01-07 19:09:13 -0800 | [diff] [blame] | 65 | |
Evan Rosky | 0037e5f | 2019-11-05 10:26:24 -0800 | [diff] [blame] | 66 | /** Get the root task which contains the current ime target */ |
| 67 | IWindowContainer getImeTarget(int display); |
| 68 | |
| 69 | /** |
| 70 | * Set's the root task to launch new tasks into on a display. {@code null} means no launch root |
| 71 | * and thus new tasks just end up directly on the display. |
| 72 | */ |
| 73 | void setLaunchRoot(int displayId, in IWindowContainer root); |
| 74 | } |