blob: 841ff6a3f12e8010c0ed47184002d6ceb2065e11 [file] [log] [blame]
Winson Chung740c3ac2014-11-12 16:14:38 -08001/**
2 * Copyright (c) 2014, 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
17package android.app;
18
Yorke Leebd54c2a2016-10-25 13:49:23 -070019import android.app.ActivityManager;
20import android.content.ComponentName;
21
Winson Chung740c3ac2014-11-12 16:14:38 -080022/** @hide */
23oneway interface ITaskStackListener {
Andrii Kulian036e3ad2017-04-19 10:55:10 -070024 /** Activity was resized to be displayed in split-screen. */
25 const int FORCED_RESIZEABLE_REASON_SPLIT_SCREEN = 1;
26 /** Activity was resized to be displayed on a secondary display. */
27 const int FORCED_RESIZEABLE_REASON_SECONDARY_DISPLAY = 2;
28
Wale Ogunwale03ce8632015-12-29 16:15:22 -080029 /** Called whenever there are changes to the state of tasks in a stack. */
Winson Chung740c3ac2014-11-12 16:14:38 -080030 void onTaskStackChanged();
Wale Ogunwale03ce8632015-12-29 16:15:22 -080031
32 /** Called whenever an Activity is moved to the pinned stack from another stack. */
Wale Ogunwale89be5762017-10-04 13:27:49 -070033 void onActivityPinned(String packageName, int userId, int taskId, int stackId);
Winson Chungc81c0ce2017-03-17 12:27:30 -070034
35 /** Called whenever an Activity is moved from the pinned stack to another stack. */
36 void onActivityUnpinned();
Wale Ogunwalecc25a8a2016-01-23 14:31:37 -080037
38 /**
39 * Called whenever IActivityManager.startActivity is called on an activity that is already
40 * running in the pinned stack and the activity is not actually started, but the task is either
41 * brought to the front or a new Intent is delivered to it.
Winson Chunge6385a22017-05-02 18:15:16 -070042 *
43 * @param clearedTask whether or not the launch activity also cleared the task as a part of
44 * starting
Wale Ogunwalecc25a8a2016-01-23 14:31:37 -080045 */
Winson Chunge6385a22017-05-02 18:15:16 -070046 void onPinnedActivityRestartAttempt(boolean clearedTask);
Wale Ogunwale480dca02016-02-06 13:58:29 -080047
48 /**
Winson Chung85d39982017-02-24 15:21:25 -080049 * Called whenever the pinned stack is starting animating a resize.
50 */
51 void onPinnedStackAnimationStarted();
52
53 /**
Wale Ogunwale480dca02016-02-06 13:58:29 -080054 * Called whenever the pinned stack is done animating a resize.
55 */
56 void onPinnedStackAnimationEnded();
Jorim Jaggi2adba072016-03-03 13:43:39 +010057
58 /**
59 * Called when we launched an activity that we forced to be resizable.
Andrii Kulian036e3ad2017-04-19 10:55:10 -070060 *
61 * @param packageName Package name of the top activity in the task.
62 * @param taskId Id of the task.
63 * @param reason {@link #FORCED_RESIZEABLE_REASON_SPLIT_SCREEN} or
64 * {@link #FORCED_RESIZEABLE_REASON_SECONDARY_DISPLAY}.
Jorim Jaggi2adba072016-03-03 13:43:39 +010065 */
Andrii Kulian036e3ad2017-04-19 10:55:10 -070066 void onActivityForcedResizable(String packageName, int taskId, int reason);
Jorim Jaggid53f0922016-04-06 22:16:23 -070067
68 /**
Andrii Kulian036e3ad2017-04-19 10:55:10 -070069 * Called when we launched an activity that dismissed the docked stack.
Jorim Jaggid53f0922016-04-06 22:16:23 -070070 */
71 void onActivityDismissingDockedStack();
Yorke Leebd54c2a2016-10-25 13:49:23 -070072
73 /**
Andrii Kulian036e3ad2017-04-19 10:55:10 -070074 * Called when an activity was requested to be launched on a secondary display but was not
75 * allowed there.
Mark Renoufc808f062019-02-07 15:20:37 -050076 *
77 * @param taskInfo info about the Activity's task
78 * @param requestedDisplayId the id of the requested launch display
Andrii Kulian036e3ad2017-04-19 10:55:10 -070079 */
Mark Renoufc808f062019-02-07 15:20:37 -050080 void onActivityLaunchOnSecondaryDisplayFailed(in ActivityManager.RunningTaskInfo taskInfo,
81 int requestedDisplayId);
Andrii Kulian036e3ad2017-04-19 10:55:10 -070082
83 /**
Jeff Changbf299862019-02-26 20:07:22 +080084 * Called when an activity was requested to be launched on a secondary display but was rerouted
85 * to default display.
86 *
87 * @param taskInfo info about the Activity's task
88 * @param requestedDisplayId the id of the requested launch display
89 */
90 void onActivityLaunchOnSecondaryDisplayRerouted(in ActivityManager.RunningTaskInfo taskInfo,
91 int requestedDisplayId);
92
93 /**
Yorke Leebd54c2a2016-10-25 13:49:23 -070094 * Called when a task is added.
95 *
96 * @param taskId id of the task.
97 * @param componentName of the activity that the task is being started with.
98 */
99 void onTaskCreated(int taskId, in ComponentName componentName);
100
101 /**
102 * Called when a task is removed.
103 *
104 * @param taskId id of the task.
105 */
106 void onTaskRemoved(int taskId);
107
108 /**
109 * Called when a task is moved to the front of its stack.
110 *
Mark Renoufc808f062019-02-07 15:20:37 -0500111 * @param taskInfo info about the task which moved
Yorke Leebd54c2a2016-10-25 13:49:23 -0700112 */
Mark Renoufc808f062019-02-07 15:20:37 -0500113 void onTaskMovedToFront(in ActivityManager.RunningTaskInfo taskInfo);
Yorke Leebd54c2a2016-10-25 13:49:23 -0700114
115 /**
116 * Called when a task’s description is changed due to an activity calling
117 * ActivityManagerService.setTaskDescription
118 *
Mark Renoufc808f062019-02-07 15:20:37 -0500119 * @param taskInfo info about the task which changed, with {@link TaskInfo#taskDescription}
Yorke Leebd54c2a2016-10-25 13:49:23 -0700120 */
Mark Renoufc808f062019-02-07 15:20:37 -0500121 void onTaskDescriptionChanged(in ActivityManager.RunningTaskInfo taskInfo);
Yorke Leebd54c2a2016-10-25 13:49:23 -0700122
123 /**
124 * Called when a activity’s orientation is changed due to it calling
125 * ActivityManagerService.setRequestedOrientation
126 *
127 * @param taskId id of the task that the activity is in.
128 * @param requestedOrientation the new requested orientation.
129 */
130 void onActivityRequestedOrientationChanged(int taskId, int requestedOrientation);
131
132 /**
133 * Called when the task is about to be finished but before its surfaces are
134 * removed from the window manager. This allows interested parties to
135 * perform relevant animations before the window disappears.
Mark Renoufc808f062019-02-07 15:20:37 -0500136 *
137 * @param taskInfo info about the task being removed
Yorke Leebd54c2a2016-10-25 13:49:23 -0700138 */
Mark Renoufc808f062019-02-07 15:20:37 -0500139 void onTaskRemovalStarted(in ActivityManager.RunningTaskInfo taskInfo);
Robin Leec41f6ec2017-01-10 17:02:34 +0000140
141 /**
142 * Called when the task has been put in a locked state because one or more of the
143 * activities inside it belong to a managed profile user, and that user has just
144 * been locked.
145 */
146 void onTaskProfileLocked(int taskId, int userId);
Jorim Jaggifb9d78a2017-01-05 18:57:12 +0100147
148 /**
149 * Called when a task snapshot got updated.
150 */
151 void onTaskSnapshotChanged(int taskId, in ActivityManager.TaskSnapshot snapshot);
Riddle Hsu7b766fd2019-01-28 21:14:59 +0800152
153 /**
154 * Called when the resumed activity is in size compatibility mode and its override configuration
155 * is different from the current one of system.
156 *
157 * @param displayId Id of the display where the activity resides.
158 * @param activityToken Token of the size compatibility mode activity. It will be null when
159 * switching to a activity that is not in size compatibility mode or the
160 * configuration of the activity.
161 * @see com.android.server.wm.AppWindowToken#inSizeCompatMode
162 */
163 void onSizeCompatModeActivityChanged(int displayId, in IBinder activityToken);
Winson Chung740c3ac2014-11-12 16:14:38 -0800164}