blob: b4b7df970493fabe294eedb59e8326561822277f [file] [log] [blame]
Yorke Leebd54c2a2016-10-25 13:49:23 -07001/*
2 * Copyright (C) 2016 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
Mathew Inwood61e8ae62018-08-14 14:17:44 +010019import android.annotation.UnsupportedAppUsage;
Jorim Jaggifb9d78a2017-01-05 18:57:12 +010020import android.app.ActivityManager.TaskSnapshot;
Yorke Leebd54c2a2016-10-25 13:49:23 -070021import android.content.ComponentName;
Winson Chung67b09022019-05-02 11:09:48 -070022import android.os.Binder;
Riddle Hsu7b766fd2019-01-28 21:14:59 +080023import android.os.IBinder;
Yorke Leebd54c2a2016-10-25 13:49:23 -070024import android.os.RemoteException;
25
26/**
27 * Classes interested in observing only a subset of changes using ITaskStackListener can extend
28 * this class to avoid having to implement all the methods.
davidlneaeae182019-05-30 14:25:01 -070029 *
Yorke Leebd54c2a2016-10-25 13:49:23 -070030 * @hide
31 */
32public abstract class TaskStackListener extends ITaskStackListener.Stub {
33 @Override
Mathew Inwood61e8ae62018-08-14 14:17:44 +010034 @UnsupportedAppUsage
Yorke Leebd54c2a2016-10-25 13:49:23 -070035 public void onTaskStackChanged() throws RemoteException {
36 }
37
38 @Override
Mathew Inwood61e8ae62018-08-14 14:17:44 +010039 @UnsupportedAppUsage
Wale Ogunwale89be5762017-10-04 13:27:49 -070040 public void onActivityPinned(String packageName, int userId, int taskId, int stackId)
Winson Chung85d3c8a2017-09-15 15:41:00 -070041 throws RemoteException {
Winson Chungc81c0ce2017-03-17 12:27:30 -070042 }
43
44 @Override
Mathew Inwood61e8ae62018-08-14 14:17:44 +010045 @UnsupportedAppUsage
Winson Chungc81c0ce2017-03-17 12:27:30 -070046 public void onActivityUnpinned() throws RemoteException {
Yorke Leebd54c2a2016-10-25 13:49:23 -070047 }
48
49 @Override
Mathew Inwood61e8ae62018-08-14 14:17:44 +010050 @UnsupportedAppUsage
Winson Chunge6385a22017-05-02 18:15:16 -070051 public void onPinnedActivityRestartAttempt(boolean clearedTask) throws RemoteException {
Yorke Leebd54c2a2016-10-25 13:49:23 -070052 }
53
54 @Override
Mathew Inwood61e8ae62018-08-14 14:17:44 +010055 @UnsupportedAppUsage
Winson Chung85d39982017-02-24 15:21:25 -080056 public void onPinnedStackAnimationStarted() throws RemoteException {
57 }
58
59 @Override
Mathew Inwood61e8ae62018-08-14 14:17:44 +010060 @UnsupportedAppUsage
Yorke Leebd54c2a2016-10-25 13:49:23 -070061 public void onPinnedStackAnimationEnded() throws RemoteException {
62 }
63
64 @Override
Mathew Inwood61e8ae62018-08-14 14:17:44 +010065 @UnsupportedAppUsage
Andrii Kulian036e3ad2017-04-19 10:55:10 -070066 public void onActivityForcedResizable(String packageName, int taskId, int reason)
67 throws RemoteException {
Yorke Leebd54c2a2016-10-25 13:49:23 -070068 }
69
70 @Override
Mathew Inwood61e8ae62018-08-14 14:17:44 +010071 @UnsupportedAppUsage
Yorke Leebd54c2a2016-10-25 13:49:23 -070072 public void onActivityDismissingDockedStack() throws RemoteException {
73 }
74
75 @Override
Mark Renoufc808f062019-02-07 15:20:37 -050076 public void onActivityLaunchOnSecondaryDisplayFailed(ActivityManager.RunningTaskInfo taskInfo,
77 int requestedDisplayId) throws RemoteException {
78 onActivityLaunchOnSecondaryDisplayFailed();
79 }
80
81 /**
82 * @deprecated see {@link
83 * #onActivityLaunchOnSecondaryDisplayFailed(ActivityManager.RunningTaskInfo, int)}
84 */
85 @Deprecated
Mathew Inwood61e8ae62018-08-14 14:17:44 +010086 @UnsupportedAppUsage
Andrii Kulian036e3ad2017-04-19 10:55:10 -070087 public void onActivityLaunchOnSecondaryDisplayFailed() throws RemoteException {
88 }
89
90 @Override
Jeff Changbf299862019-02-26 20:07:22 +080091 @UnsupportedAppUsage
92 public void onActivityLaunchOnSecondaryDisplayRerouted(ActivityManager.RunningTaskInfo taskInfo,
93 int requestedDisplayId) throws RemoteException {
94 }
95
96 @Override
Yorke Leebd54c2a2016-10-25 13:49:23 -070097 public void onTaskCreated(int taskId, ComponentName componentName) throws RemoteException {
98 }
99
100 @Override
Mathew Inwood61e8ae62018-08-14 14:17:44 +0100101 @UnsupportedAppUsage
Yorke Leebd54c2a2016-10-25 13:49:23 -0700102 public void onTaskRemoved(int taskId) throws RemoteException {
103 }
104
105 @Override
Mark Renoufc808f062019-02-07 15:20:37 -0500106 public void onTaskMovedToFront(ActivityManager.RunningTaskInfo taskInfo)
107 throws RemoteException {
108 onTaskMovedToFront(taskInfo.taskId);
109 }
110
111 /**
112 * @deprecated see {@link #onTaskMovedToFront(ActivityManager.RunningTaskInfo)}
113 */
114 @Deprecated
Mathew Inwood61e8ae62018-08-14 14:17:44 +0100115 @UnsupportedAppUsage
Yorke Leebd54c2a2016-10-25 13:49:23 -0700116 public void onTaskMovedToFront(int taskId) throws RemoteException {
117 }
118
119 @Override
Mark Renoufc808f062019-02-07 15:20:37 -0500120 public void onTaskRemovalStarted(ActivityManager.RunningTaskInfo taskInfo)
121 throws RemoteException {
122 onTaskRemovalStarted(taskInfo.taskId);
123 }
124
125 /**
126 * @deprecated see {@link #onTaskRemovalStarted(ActivityManager.RunningTaskInfo)}
127 */
128 @Deprecated
Winson Chung2db35572017-10-09 15:08:30 -0700129 public void onTaskRemovalStarted(int taskId) throws RemoteException {
Yorke Leebd54c2a2016-10-25 13:49:23 -0700130 }
131
132 @Override
Mark Renoufc808f062019-02-07 15:20:37 -0500133 public void onTaskDescriptionChanged(ActivityManager.RunningTaskInfo taskInfo)
134 throws RemoteException {
135 onTaskDescriptionChanged(taskInfo.taskId, taskInfo.taskDescription);
136 }
137
138 /**
139 * @deprecated see {@link #onTaskDescriptionChanged(ActivityManager.RunningTaskInfo)}
140 */
141 @Deprecated
Yorke Leebd54c2a2016-10-25 13:49:23 -0700142 public void onTaskDescriptionChanged(int taskId, ActivityManager.TaskDescription td)
143 throws RemoteException {
144 }
145
146 @Override
Mathew Inwood61e8ae62018-08-14 14:17:44 +0100147 @UnsupportedAppUsage
Yorke Leebd54c2a2016-10-25 13:49:23 -0700148 public void onActivityRequestedOrientationChanged(int taskId, int requestedOrientation)
149 throws RemoteException {
150 }
Robin Leec41f6ec2017-01-10 17:02:34 +0000151
152 @Override
Mathew Inwood61e8ae62018-08-14 14:17:44 +0100153 @UnsupportedAppUsage
Winson Chung2db35572017-10-09 15:08:30 -0700154 public void onTaskProfileLocked(int taskId, int userId) throws RemoteException {
Robin Leec41f6ec2017-01-10 17:02:34 +0000155 }
Jorim Jaggifb9d78a2017-01-05 18:57:12 +0100156
157 @Override
Mathew Inwood61e8ae62018-08-14 14:17:44 +0100158 @UnsupportedAppUsage
Winson Chung2db35572017-10-09 15:08:30 -0700159 public void onTaskSnapshotChanged(int taskId, TaskSnapshot snapshot) throws RemoteException {
Winson Chung67b09022019-05-02 11:09:48 -0700160 if (Binder.getCallingPid() != android.os.Process.myPid()
161 && snapshot != null && snapshot.getSnapshot() != null) {
162 // Preemptively clear any reference to the buffer
163 snapshot.getSnapshot().destroy();
164 }
Jorim Jaggifb9d78a2017-01-05 18:57:12 +0100165 }
Riddle Hsu7b766fd2019-01-28 21:14:59 +0800166
167 @Override
168 @UnsupportedAppUsage
169 public void onSizeCompatModeActivityChanged(int displayId, IBinder activityToken)
170 throws RemoteException {
171 }
Mark Renouf446251d2019-04-26 10:22:41 -0400172
173 @Override
174 public void onBackPressedOnTaskRoot(ActivityManager.RunningTaskInfo taskInfo)
175 throws RemoteException {
176 }
Issei Suzukicac2a502019-04-16 16:52:50 +0200177
178 @Override
179 public void onSingleTaskDisplayDrawn(int displayId) throws RemoteException {
180 }
Issei Suzuki734bc942019-06-05 13:59:52 +0200181
182 @Override
183 public void onSingleTaskDisplayEmpty(int displayId) throws RemoteException {
184 }
davidlneaeae182019-05-30 14:25:01 -0700185
186 @Override
187 public void onTaskDisplayChanged(int taskId, int newDisplayId) throws RemoteException {
188 }
Yorke Leebd54c2a2016-10-25 13:49:23 -0700189}