blob: 02ab25a1e4aa89cec1e5a73777e8526dc0030bda [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.
davidln1ceedb52019-05-30 14:25:01 -070029 *
Yorke Leebd54c2a2016-10-25 13:49:23 -070030 * @hide
31 */
32public abstract class TaskStackListener extends ITaskStackListener.Stub {
Artur Satayevfc46be72019-11-04 17:50:59 +000033
34 @UnsupportedAppUsage
35 public TaskStackListener() {
36 }
37
Yorke Leebd54c2a2016-10-25 13:49:23 -070038 @Override
Mathew Inwood61e8ae62018-08-14 14:17:44 +010039 @UnsupportedAppUsage
Yorke Leebd54c2a2016-10-25 13:49:23 -070040 public void onTaskStackChanged() throws RemoteException {
41 }
42
43 @Override
Mathew Inwood61e8ae62018-08-14 14:17:44 +010044 @UnsupportedAppUsage
Wale Ogunwale89be5762017-10-04 13:27:49 -070045 public void onActivityPinned(String packageName, int userId, int taskId, int stackId)
Winson Chung85d3c8a2017-09-15 15:41:00 -070046 throws RemoteException {
Winson Chungc81c0ce2017-03-17 12:27:30 -070047 }
48
49 @Override
Mathew Inwood61e8ae62018-08-14 14:17:44 +010050 @UnsupportedAppUsage
Winson Chungc81c0ce2017-03-17 12:27:30 -070051 public void onActivityUnpinned() throws RemoteException {
Yorke Leebd54c2a2016-10-25 13:49:23 -070052 }
53
54 @Override
Mathew Inwood61e8ae62018-08-14 14:17:44 +010055 @UnsupportedAppUsage
Winson Chunge6385a22017-05-02 18:15:16 -070056 public void onPinnedActivityRestartAttempt(boolean clearedTask) throws RemoteException {
Yorke Leebd54c2a2016-10-25 13:49:23 -070057 }
58
59 @Override
Mathew Inwood61e8ae62018-08-14 14:17:44 +010060 @UnsupportedAppUsage
Winson Chung85d39982017-02-24 15:21:25 -080061 public void onPinnedStackAnimationStarted() throws RemoteException {
62 }
63
64 @Override
Mathew Inwood61e8ae62018-08-14 14:17:44 +010065 @UnsupportedAppUsage
Yorke Leebd54c2a2016-10-25 13:49:23 -070066 public void onPinnedStackAnimationEnded() throws RemoteException {
67 }
68
69 @Override
Mathew Inwood61e8ae62018-08-14 14:17:44 +010070 @UnsupportedAppUsage
Andrii Kulian036e3ad2017-04-19 10:55:10 -070071 public void onActivityForcedResizable(String packageName, int taskId, int reason)
72 throws RemoteException {
Yorke Leebd54c2a2016-10-25 13:49:23 -070073 }
74
75 @Override
Mathew Inwood61e8ae62018-08-14 14:17:44 +010076 @UnsupportedAppUsage
Yorke Leebd54c2a2016-10-25 13:49:23 -070077 public void onActivityDismissingDockedStack() throws RemoteException {
78 }
79
80 @Override
Mark Renoufc808f062019-02-07 15:20:37 -050081 public void onActivityLaunchOnSecondaryDisplayFailed(ActivityManager.RunningTaskInfo taskInfo,
82 int requestedDisplayId) throws RemoteException {
83 onActivityLaunchOnSecondaryDisplayFailed();
84 }
85
86 /**
87 * @deprecated see {@link
88 * #onActivityLaunchOnSecondaryDisplayFailed(ActivityManager.RunningTaskInfo, int)}
89 */
90 @Deprecated
Mathew Inwood61e8ae62018-08-14 14:17:44 +010091 @UnsupportedAppUsage
Andrii Kulian036e3ad2017-04-19 10:55:10 -070092 public void onActivityLaunchOnSecondaryDisplayFailed() throws RemoteException {
93 }
94
95 @Override
Jeff Changbf299862019-02-26 20:07:22 +080096 @UnsupportedAppUsage
97 public void onActivityLaunchOnSecondaryDisplayRerouted(ActivityManager.RunningTaskInfo taskInfo,
98 int requestedDisplayId) throws RemoteException {
99 }
100
101 @Override
Yorke Leebd54c2a2016-10-25 13:49:23 -0700102 public void onTaskCreated(int taskId, ComponentName componentName) throws RemoteException {
103 }
104
105 @Override
Mathew Inwood61e8ae62018-08-14 14:17:44 +0100106 @UnsupportedAppUsage
Yorke Leebd54c2a2016-10-25 13:49:23 -0700107 public void onTaskRemoved(int taskId) throws RemoteException {
108 }
109
110 @Override
Mark Renoufc808f062019-02-07 15:20:37 -0500111 public void onTaskMovedToFront(ActivityManager.RunningTaskInfo taskInfo)
112 throws RemoteException {
113 onTaskMovedToFront(taskInfo.taskId);
114 }
115
116 /**
117 * @deprecated see {@link #onTaskMovedToFront(ActivityManager.RunningTaskInfo)}
118 */
119 @Deprecated
Mathew Inwood61e8ae62018-08-14 14:17:44 +0100120 @UnsupportedAppUsage
Yorke Leebd54c2a2016-10-25 13:49:23 -0700121 public void onTaskMovedToFront(int taskId) throws RemoteException {
122 }
123
124 @Override
Mark Renoufc808f062019-02-07 15:20:37 -0500125 public void onTaskRemovalStarted(ActivityManager.RunningTaskInfo taskInfo)
126 throws RemoteException {
127 onTaskRemovalStarted(taskInfo.taskId);
128 }
129
130 /**
131 * @deprecated see {@link #onTaskRemovalStarted(ActivityManager.RunningTaskInfo)}
132 */
133 @Deprecated
Winson Chung2db35572017-10-09 15:08:30 -0700134 public void onTaskRemovalStarted(int taskId) throws RemoteException {
Yorke Leebd54c2a2016-10-25 13:49:23 -0700135 }
136
137 @Override
Mark Renoufc808f062019-02-07 15:20:37 -0500138 public void onTaskDescriptionChanged(ActivityManager.RunningTaskInfo taskInfo)
139 throws RemoteException {
140 onTaskDescriptionChanged(taskInfo.taskId, taskInfo.taskDescription);
141 }
142
143 /**
144 * @deprecated see {@link #onTaskDescriptionChanged(ActivityManager.RunningTaskInfo)}
145 */
146 @Deprecated
Yorke Leebd54c2a2016-10-25 13:49:23 -0700147 public void onTaskDescriptionChanged(int taskId, ActivityManager.TaskDescription td)
148 throws RemoteException {
149 }
150
151 @Override
Mathew Inwood61e8ae62018-08-14 14:17:44 +0100152 @UnsupportedAppUsage
Yorke Leebd54c2a2016-10-25 13:49:23 -0700153 public void onActivityRequestedOrientationChanged(int taskId, int requestedOrientation)
154 throws RemoteException {
155 }
Robin Leec41f6ec2017-01-10 17:02:34 +0000156
157 @Override
Mathew Inwood61e8ae62018-08-14 14:17:44 +0100158 @UnsupportedAppUsage
Winson Chung2db35572017-10-09 15:08:30 -0700159 public void onTaskProfileLocked(int taskId, int userId) throws RemoteException {
Robin Leec41f6ec2017-01-10 17:02:34 +0000160 }
Jorim Jaggifb9d78a2017-01-05 18:57:12 +0100161
162 @Override
Mathew Inwood61e8ae62018-08-14 14:17:44 +0100163 @UnsupportedAppUsage
Winson Chung2db35572017-10-09 15:08:30 -0700164 public void onTaskSnapshotChanged(int taskId, TaskSnapshot snapshot) throws RemoteException {
Winson Chung67b09022019-05-02 11:09:48 -0700165 if (Binder.getCallingPid() != android.os.Process.myPid()
166 && snapshot != null && snapshot.getSnapshot() != null) {
167 // Preemptively clear any reference to the buffer
168 snapshot.getSnapshot().destroy();
169 }
Jorim Jaggifb9d78a2017-01-05 18:57:12 +0100170 }
Riddle Hsu7b766fd2019-01-28 21:14:59 +0800171
172 @Override
173 @UnsupportedAppUsage
174 public void onSizeCompatModeActivityChanged(int displayId, IBinder activityToken)
175 throws RemoteException {
176 }
Mark Renouf446251d2019-04-26 10:22:41 -0400177
178 @Override
179 public void onBackPressedOnTaskRoot(ActivityManager.RunningTaskInfo taskInfo)
180 throws RemoteException {
181 }
Issei Suzukicac2a502019-04-16 16:52:50 +0200182
183 @Override
184 public void onSingleTaskDisplayDrawn(int displayId) throws RemoteException {
185 }
davidln1ceedb52019-05-30 14:25:01 -0700186
187 @Override
188 public void onTaskDisplayChanged(int taskId, int newDisplayId) throws RemoteException {
189 }
Yorke Leebd54c2a2016-10-25 13:49:23 -0700190}