1 /* 2 * Copyright (C) 2019 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 17 package android.window; 18 19 import android.view.SurfaceControl; 20 import android.app.ActivityManager; 21 import android.graphics.Rect; 22 import android.window.StartingWindowInfo; 23 import android.window.WindowContainerToken; 24 25 /** 26 * Interface for ActivityTaskManager/WindowManager to delegate control of tasks. 27 * {@hide} 28 */ 29 oneway interface ITaskOrganizer { 30 /** 31 * Called when a Task is starting and the system would like to show a UI to indicate that an 32 * application is starting. The client is responsible to add/remove the starting window if it 33 * has create a starting window for the Task. 34 * 35 * @param info The information about the Task that's available 36 * @param appToken Token of the application being started. 37 */ 38 void addStartingWindow(in StartingWindowInfo info, IBinder appToken); 39 40 /** 41 * Called when the Task want to remove the starting window. 42 * @param leash A persistent leash for the top window in this task. 43 * @param frame Window frame of the top window. 44 * @param playRevealAnimation Play vanish animation. 45 */ 46 void removeStartingWindow(int taskId, in SurfaceControl leash, in Rect frame, 47 in boolean playRevealAnimation); 48 49 /** 50 * Called when the Task want to copy the splash screen. 51 */ 52 void copySplashScreenView(int taskId); 53 54 /** 55 * Called when the Task removed the splash screen. 56 */ 57 void onAppSplashScreenViewRemoved(int taskId); 58 59 /** 60 * A callback when the Task is available for the registered organizer. The client is responsible 61 * for releasing the SurfaceControl in the callback. For non-root tasks, the leash may initially 62 * be hidden so it is up to the organizer to show this task. 63 * 64 * @param taskInfo The information about the Task that's available 65 * @param leash A persistent leash for this Task. 66 */ 67 void onTaskAppeared(in ActivityManager.RunningTaskInfo taskInfo, in SurfaceControl leash); 68 void onTaskVanished(in ActivityManager.RunningTaskInfo taskInfo); 69 70 /** 71 * Will fire when core attributes of a Task's info change. Relevant properties include the 72 * {@link WindowConfiguration.ActivityType} and whether it is resizable. 73 * 74 * This is used, for example, during split-screen. The flow for starting is: Something sends an 75 * Intent with windowingmode. Then WM finds a matching root task and launches the new task into 76 * it. This causes the root task's info to change because now it has a task when it didn't 77 * before. The default Divider implementation interprets this as a request to enter 78 * split-screen mode and will move all other Tasks into the secondary root task. When WM 79 * applies this change, it triggers an info change in the secondary root task because it now 80 * has children. The Divider impl looks at the info and can see that the secondary root task 81 * has adopted an ActivityType of HOME and proceeds to show the minimized dock UX. 82 */ 83 void onTaskInfoChanged(in ActivityManager.RunningTaskInfo taskInfo); 84 85 /** 86 * Called when the task organizer has requested 87 * {@link ITaskOrganizerController.setInterceptBackPressedOnTaskRoot} to get notified when the 88 * user has pressed back on the root activity of a task controlled by the task organizer. 89 */ 90 void onBackPressedOnTaskRoot(in ActivityManager.RunningTaskInfo taskInfo); 91 } 92