blob: 8615f00facd9b5d5c508f4cb05f0db6b27332fea [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 /**
Yorke Leebd54c2a2016-10-25 13:49:23 -070084 * Called when a task is added.
85 *
86 * @param taskId id of the task.
87 * @param componentName of the activity that the task is being started with.
88 */
89 void onTaskCreated(int taskId, in ComponentName componentName);
90
91 /**
92 * Called when a task is removed.
93 *
94 * @param taskId id of the task.
95 */
96 void onTaskRemoved(int taskId);
97
98 /**
99 * Called when a task is moved to the front of its stack.
100 *
Mark Renoufc808f062019-02-07 15:20:37 -0500101 * @param taskInfo info about the task which moved
Yorke Leebd54c2a2016-10-25 13:49:23 -0700102 */
Mark Renoufc808f062019-02-07 15:20:37 -0500103 void onTaskMovedToFront(in ActivityManager.RunningTaskInfo taskInfo);
Yorke Leebd54c2a2016-10-25 13:49:23 -0700104
105 /**
106 * Called when a task’s description is changed due to an activity calling
107 * ActivityManagerService.setTaskDescription
108 *
Mark Renoufc808f062019-02-07 15:20:37 -0500109 * @param taskInfo info about the task which changed, with {@link TaskInfo#taskDescription}
Yorke Leebd54c2a2016-10-25 13:49:23 -0700110 */
Mark Renoufc808f062019-02-07 15:20:37 -0500111 void onTaskDescriptionChanged(in ActivityManager.RunningTaskInfo taskInfo);
Yorke Leebd54c2a2016-10-25 13:49:23 -0700112
113 /**
114 * Called when a activity’s orientation is changed due to it calling
115 * ActivityManagerService.setRequestedOrientation
116 *
117 * @param taskId id of the task that the activity is in.
118 * @param requestedOrientation the new requested orientation.
119 */
120 void onActivityRequestedOrientationChanged(int taskId, int requestedOrientation);
121
122 /**
123 * Called when the task is about to be finished but before its surfaces are
124 * removed from the window manager. This allows interested parties to
125 * perform relevant animations before the window disappears.
Mark Renoufc808f062019-02-07 15:20:37 -0500126 *
127 * @param taskInfo info about the task being removed
Yorke Leebd54c2a2016-10-25 13:49:23 -0700128 */
Mark Renoufc808f062019-02-07 15:20:37 -0500129 void onTaskRemovalStarted(in ActivityManager.RunningTaskInfo taskInfo);
Robin Leec41f6ec2017-01-10 17:02:34 +0000130
131 /**
132 * Called when the task has been put in a locked state because one or more of the
133 * activities inside it belong to a managed profile user, and that user has just
134 * been locked.
135 */
136 void onTaskProfileLocked(int taskId, int userId);
Jorim Jaggifb9d78a2017-01-05 18:57:12 +0100137
138 /**
139 * Called when a task snapshot got updated.
140 */
141 void onTaskSnapshotChanged(int taskId, in ActivityManager.TaskSnapshot snapshot);
Winson Chung740c3ac2014-11-12 16:14:38 -0800142}