blob: 837f0d3b451d85aaec637d443f9b1a6bd8f51c71 [file] [log] [blame]
Craig Mautnerb1fd65c02013-02-05 13:34:57 -08001/*
2 * Copyright (C) 2013 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 com.android.server.wm;
18
Jorim Jaggid53f0922016-04-06 22:16:23 -070019import static android.app.ActivityManager.RESIZE_MODE_SYSTEM_SCREEN_ROTATION;
Robert Carr03138452016-05-18 14:53:16 -070020import static android.app.ActivityManager.StackId.PINNED_STACK_ID;
Wale Ogunwale3797c222015-10-27 14:21:58 -070021import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID;
22import static android.app.ActivityManager.StackId.HOME_STACK_ID;
Wale Ogunwaleb1faf602016-01-27 09:12:31 -080023import static android.content.pm.ActivityInfo.RESIZE_MODE_CROP_WINDOWS;
Wale Ogunwale51362492016-09-08 17:49:17 -070024import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_BEHIND;
25import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSET;
26import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
Filip Gruszczynski0bd180d2015-12-07 15:43:52 -080027import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_STACK;
Jorim Jaggid53f0922016-04-06 22:16:23 -070028import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
29import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
Wale Ogunwale1ed0d892015-09-28 13:27:44 -070030import static com.android.server.wm.WindowManagerService.H.RESIZE_TASK;
Wale Ogunwale99db1862015-10-23 20:08:22 -070031
Wale Ogunwale3797c222015-10-27 14:21:58 -070032import android.app.ActivityManager.StackId;
Wale Ogunwaleb1faf602016-01-27 09:12:31 -080033import android.content.pm.ActivityInfo;
Wale Ogunwalee4a0c572015-06-30 08:40:31 -070034import android.content.res.Configuration;
35import android.graphics.Rect;
Craig Mautner2c2549c2013-11-12 08:31:15 -080036import android.util.EventLog;
Craig Mautner42bf39e2014-02-21 16:46:22 -080037import android.util.Slog;
Wale Ogunwalee4a0c572015-06-30 08:40:31 -070038import android.view.DisplayInfo;
39import android.view.Surface;
Jorim Jaggi6626f542016-08-22 13:08:44 -070040import android.view.animation.Animation;
Wale Ogunwalee4a0c572015-06-30 08:40:31 -070041
Wale Ogunwale9f25bee2016-08-02 07:23:47 -070042import android.view.SurfaceControl;
Craig Mautnere3119b72015-01-20 15:02:36 -080043import com.android.server.EventLogTags;
Craig Mautner2c2549c2013-11-12 08:31:15 -080044
Wale Ogunwalee4a0c572015-06-30 08:40:31 -070045import java.io.PrintWriter;
Wale Ogunwalee4a0c572015-06-30 08:40:31 -070046
47class Task implements DimLayer.DimLayerUser {
Wale Ogunwaleb9b16a72016-01-27 12:24:44 -080048 static final String TAG = TAG_WITH_CLASS_NAME ? "Task" : TAG_WM;
Wale Ogunwale2cc92f52015-09-09 13:12:10 -070049 // Return value from {@link setBounds} indicating no change was made to the Task bounds.
50 static final int BOUNDS_CHANGE_NONE = 0;
51 // Return value from {@link setBounds} indicating the position of the Task bounds changed.
52 static final int BOUNDS_CHANGE_POSITION = 1;
53 // Return value from {@link setBounds} indicating the size of the Task bounds changed.
54 static final int BOUNDS_CHANGE_SIZE = 1 << 1;
55
Craig Mautnerc00204b2013-03-05 15:02:14 -080056 TaskStack mStack;
Wale Ogunwale3f4433d2016-08-18 20:42:42 -070057 private final AppTokenList mAppTokens = new AppTokenList();
Craig Mautner83162a92015-01-26 14:43:30 -080058 final int mTaskId;
Craig Mautnerac6f8432013-07-17 13:24:59 -070059 final int mUserId;
Craig Mautner9ef471f2014-02-07 13:11:47 -080060 boolean mDeferRemoval = false;
Craig Mautnere3119b72015-01-20 15:02:36 -080061 final WindowManagerService mService;
Craig Mautnerb1fd65c02013-02-05 13:34:57 -080062
Wale Ogunwalee4a0c572015-06-30 08:40:31 -070063 // Content limits relative to the DisplayContent this sits in.
64 private Rect mBounds = new Rect();
Jorim Jaggi0429f352015-12-22 16:29:16 +010065 final Rect mPreparedFrozenBounds = new Rect();
Jorim Jaggi26c8c422016-05-09 19:57:25 -070066 final Configuration mPreparedFrozenMergedConfig = new Configuration();
Wale Ogunwalee4a0c572015-06-30 08:40:31 -070067
Jorim Jaggidc249c42015-12-15 14:57:31 -080068 // Bounds used to calculate the insets.
69 private final Rect mTempInsetBounds = new Rect();
70
Wale Ogunwalee4a0c572015-06-30 08:40:31 -070071 // Device rotation as of the last time {@link #mBounds} was set.
72 int mRotation;
73
74 // Whether mBounds is fullscreen
75 private boolean mFullscreen = true;
76
77 // Contains configurations settings that are different from the global configuration due to
78 // stack specific operations. E.g. {@link #setBounds}.
Jorim Jaggi26c8c422016-05-09 19:57:25 -070079 Configuration mOverrideConfig = Configuration.EMPTY;
Wale Ogunwalee4a0c572015-06-30 08:40:31 -070080
81 // For comparison with DisplayContent bounds.
82 private Rect mTmpRect = new Rect();
83 // For handling display rotations.
84 private Rect mTmpRect2 = new Rect();
85
Wale Ogunwaleb1faf602016-01-27 09:12:31 -080086 // Resize mode of the task. See {@link ActivityInfo#resizeMode}
87 private int mResizeMode;
Chong Zhangb15758a2015-11-17 12:12:03 -080088
Chong Zhang3005e752015-09-18 18:46:28 -070089 // Whether the task is currently being drag-resized
90 private boolean mDragResizing;
Jorim Jaggi0b46f3c2016-03-14 12:21:37 +010091 private int mDragResizeMode;
Chong Zhang3005e752015-09-18 18:46:28 -070092
Wale Ogunwaleb1faf602016-01-27 09:12:31 -080093 private boolean mHomeTask;
94
Jiaquan Hedd1e66f2016-06-15 15:15:12 -070095 // Whether this task is an on-top launcher task, which is determined by the root activity.
96 private boolean mIsOnTopLauncher;
97
Filip Gruszczynskiebcc8752015-08-25 16:51:05 -070098 Task(int taskId, TaskStack stack, int userId, WindowManagerService service, Rect bounds,
Jiaquan Hedd1e66f2016-06-15 15:15:12 -070099 Configuration config, boolean isOnTopLauncher) {
Craig Mautner83162a92015-01-26 14:43:30 -0800100 mTaskId = taskId;
Craig Mautnerc00204b2013-03-05 15:02:14 -0800101 mStack = stack;
Craig Mautnerac6f8432013-07-17 13:24:59 -0700102 mUserId = userId;
Craig Mautnere3119b72015-01-20 15:02:36 -0800103 mService = service;
Jiaquan Hedd1e66f2016-06-15 15:15:12 -0700104 mIsOnTopLauncher = isOnTopLauncher;
Filip Gruszczynskiebcc8752015-08-25 16:51:05 -0700105 setBounds(bounds, config);
Craig Mautnerc00204b2013-03-05 15:02:14 -0800106 }
107
108 DisplayContent getDisplayContent() {
109 return mStack.getDisplayContent();
110 }
111
Wale Ogunwaleb1faf602016-01-27 09:12:31 -0800112 void addAppToken(int addPos, AppWindowToken wtoken, int resizeMode, boolean homeTask) {
Craig Mautner42bf39e2014-02-21 16:46:22 -0800113 final int lastPos = mAppTokens.size();
Craig Mautner83162a92015-01-26 14:43:30 -0800114 if (addPos >= lastPos) {
115 addPos = lastPos;
116 } else {
117 for (int pos = 0; pos < lastPos && pos < addPos; ++pos) {
118 if (mAppTokens.get(pos).removed) {
119 // addPos assumes removed tokens are actually gone.
120 ++addPos;
121 }
Craig Mautner01f79cf2014-08-27 09:56:02 -0700122 }
Craig Mautner42bf39e2014-02-21 16:46:22 -0800123 }
Craig Mautnerc00204b2013-03-05 15:02:14 -0800124 mAppTokens.add(addPos, wtoken);
Craig Mautner83162a92015-01-26 14:43:30 -0800125 wtoken.mTask = this;
Craig Mautner42bf39e2014-02-21 16:46:22 -0800126 mDeferRemoval = false;
Wale Ogunwaleb1faf602016-01-27 09:12:31 -0800127 mResizeMode = resizeMode;
128 mHomeTask = homeTask;
Craig Mautnerc00204b2013-03-05 15:02:14 -0800129 }
130
Wale Ogunwalee42d0e12016-05-02 16:40:59 -0700131 private boolean hasWindowsAlive() {
Chong Zhang7e8eeb72016-01-06 19:14:47 -0800132 for (int i = mAppTokens.size() - 1; i >= 0; i--) {
Wale Ogunwalee42d0e12016-05-02 16:40:59 -0700133 if (mAppTokens.get(i).hasWindowsAlive()) {
Chong Zhang7e8eeb72016-01-06 19:14:47 -0800134 return true;
135 }
136 }
137 return false;
138 }
139
Craig Mautnere3119b72015-01-20 15:02:36 -0800140 void removeLocked() {
Wale Ogunwalee42d0e12016-05-02 16:40:59 -0700141 if (hasWindowsAlive() && mStack.isAnimating()) {
Wale Ogunwaleb9b16a72016-01-27 12:24:44 -0800142 if (DEBUG_STACK) Slog.i(TAG, "removeTask: deferring removing taskId=" + mTaskId);
Craig Mautnere3119b72015-01-20 15:02:36 -0800143 mDeferRemoval = true;
144 return;
145 }
Wale Ogunwaleb9b16a72016-01-27 12:24:44 -0800146 if (DEBUG_STACK) Slog.i(TAG, "removeTask: removing taskId=" + mTaskId);
Craig Mautner83162a92015-01-26 14:43:30 -0800147 EventLog.writeEvent(EventLogTags.WM_TASK_REMOVED, mTaskId, "removeTask");
Craig Mautnere3119b72015-01-20 15:02:36 -0800148 mDeferRemoval = false;
Filip Gruszczynski0689ae92015-10-01 12:30:31 -0700149 DisplayContent content = getDisplayContent();
150 if (content != null) {
Chong Zhang112eb8c2015-11-02 11:17:00 -0800151 content.mDimLayerController.removeDimLayerUser(this);
Filip Gruszczynski0689ae92015-10-01 12:30:31 -0700152 }
Craig Mautnere3119b72015-01-20 15:02:36 -0800153 mStack.removeTask(this);
Craig Mautner83162a92015-01-26 14:43:30 -0800154 mService.mTaskIdToTask.delete(mTaskId);
Craig Mautnere3119b72015-01-20 15:02:36 -0800155 }
156
Wale Ogunwale53a29a92015-02-23 15:42:52 -0800157 void moveTaskToStack(TaskStack stack, boolean toTop) {
158 if (stack == mStack) {
159 return;
160 }
Wale Ogunwaleb9b16a72016-01-27 12:24:44 -0800161 if (DEBUG_STACK) Slog.i(TAG, "moveTaskToStack: removing taskId=" + mTaskId
Wale Ogunwale53a29a92015-02-23 15:42:52 -0800162 + " from stack=" + mStack);
Wale Ogunwale000957c2015-04-03 08:19:12 -0700163 EventLog.writeEvent(EventLogTags.WM_TASK_REMOVED, mTaskId, "moveTask");
Wale Ogunwale53a29a92015-02-23 15:42:52 -0800164 if (mStack != null) {
165 mStack.removeTask(this);
166 }
167 stack.addTask(this, toTop);
168 }
169
Wale Ogunwale935e5022015-11-10 12:36:10 -0800170 void positionTaskInStack(TaskStack stack, int position, Rect bounds, Configuration config) {
Wale Ogunwaleddc1cb22015-07-25 19:23:04 -0700171 if (mStack != null && stack != mStack) {
Wale Ogunwaleb9b16a72016-01-27 12:24:44 -0800172 if (DEBUG_STACK) Slog.i(TAG, "positionTaskInStack: removing taskId=" + mTaskId
Wale Ogunwaleddc1cb22015-07-25 19:23:04 -0700173 + " from stack=" + mStack);
174 EventLog.writeEvent(EventLogTags.WM_TASK_REMOVED, mTaskId, "moveTask");
175 mStack.removeTask(this);
176 }
177 stack.positionTask(this, position, showForAllUsers());
Jorim Jaggi8fa45222016-02-19 19:54:39 -0800178 resizeLocked(bounds, config, false /* force */);
Jorim Jaggi5e6968d2016-02-19 18:02:13 -0800179
180 for (int activityNdx = mAppTokens.size() - 1; activityNdx >= 0; --activityNdx) {
Wale Ogunwale9f25bee2016-08-02 07:23:47 -0700181 mAppTokens.get(activityNdx).notifyMovedInStack();
Jorim Jaggi5e6968d2016-02-19 18:02:13 -0800182 }
Wale Ogunwaleddc1cb22015-07-25 19:23:04 -0700183 }
184
Wale Ogunwale3f4433d2016-08-18 20:42:42 -0700185 boolean checkCompleteDeferredRemoval() {
186 boolean stillDeferringRemoval = false;
187
188 for (int tokenNdx = mAppTokens.size() - 1; tokenNdx >= 0; --tokenNdx) {
189 final AppWindowToken token = mAppTokens.get(tokenNdx);
190 stillDeferringRemoval |= token.checkCompleteDeferredRemoval();
191 }
192
193 return stillDeferringRemoval;
194 }
195
Wale Ogunwale571771c2016-08-26 13:18:50 -0700196 // TODO: Don't forget to switch to WC.detachChild
197 void detachChild(AppWindowToken wtoken) {
198 if (!removeAppToken(wtoken)) {
199 Slog.e(TAG, "detachChild: token=" + this + " not found.");
200 }
201 mStack.mExitingAppTokens.remove(wtoken);
202 }
203
Craig Mautnerc00204b2013-03-05 15:02:14 -0800204 boolean removeAppToken(AppWindowToken wtoken) {
Craig Mautner42bf39e2014-02-21 16:46:22 -0800205 boolean removed = mAppTokens.remove(wtoken);
Craig Mautnerc00204b2013-03-05 15:02:14 -0800206 if (mAppTokens.size() == 0) {
Jorim Jaggi0429f352015-12-22 16:29:16 +0100207 EventLog.writeEvent(EventLogTags.WM_TASK_REMOVED, mTaskId, "removeAppToken: last token");
Craig Mautnere3119b72015-01-20 15:02:36 -0800208 if (mDeferRemoval) {
209 removeLocked();
210 }
Craig Mautnerc00204b2013-03-05 15:02:14 -0800211 }
Craig Mautner83162a92015-01-26 14:43:30 -0800212 wtoken.mTask = null;
213 /* Leave mTaskId for now, it might be useful for debug
214 wtoken.mTaskId = -1;
215 */
Craig Mautner42bf39e2014-02-21 16:46:22 -0800216 return removed;
Craig Mautnerb1fd65c02013-02-05 13:34:57 -0800217 }
Craig Mautner5d9c7be2013-02-15 14:02:56 -0800218
Craig Mautnercbd84af2014-10-22 13:21:22 -0700219 void setSendingToBottom(boolean toBottom) {
220 for (int appTokenNdx = 0; appTokenNdx < mAppTokens.size(); appTokenNdx++) {
221 mAppTokens.get(appTokenNdx).sendingToBottom = toBottom;
222 }
223 }
224
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700225 /** Set the task bounds. Passing in null sets the bounds to fullscreen. */
Jorim Jaggi8fa45222016-02-19 19:54:39 -0800226 private int setBounds(Rect bounds, Configuration config) {
Filip Gruszczynskiebcc8752015-08-25 16:51:05 -0700227 if (config == null) {
228 config = Configuration.EMPTY;
229 }
230 if (bounds == null && !Configuration.EMPTY.equals(config)) {
231 throw new IllegalArgumentException("null bounds but non empty configuration: "
232 + config);
233 }
234 if (bounds != null && Configuration.EMPTY.equals(config)) {
235 throw new IllegalArgumentException("non null bounds, but empty configuration");
236 }
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700237 boolean oldFullscreen = mFullscreen;
238 int rotation = Surface.ROTATION_0;
239 final DisplayContent displayContent = mStack.getDisplayContent();
240 if (displayContent != null) {
241 displayContent.getLogicalDisplayRect(mTmpRect);
242 rotation = displayContent.getDisplayInfo().rotation;
Jorim Jaggi067e8172016-02-03 18:24:12 -0800243 mFullscreen = bounds == null;
244 if (mFullscreen) {
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700245 bounds = mTmpRect;
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700246 }
247 }
248
249 if (bounds == null) {
250 // Can't set to fullscreen if we don't have a display to get bounds from...
Wale Ogunwale2cc92f52015-09-09 13:12:10 -0700251 return BOUNDS_CHANGE_NONE;
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700252 }
Chong Zhang2e2c81a2016-07-15 11:28:17 -0700253 if (mBounds.equals(bounds) && oldFullscreen == mFullscreen && mRotation == rotation) {
Wale Ogunwale2cc92f52015-09-09 13:12:10 -0700254 return BOUNDS_CHANGE_NONE;
255 }
256
257 int boundsChange = BOUNDS_CHANGE_NONE;
Chong Zhang2e2c81a2016-07-15 11:28:17 -0700258 if (mBounds.left != bounds.left || mBounds.top != bounds.top) {
Wale Ogunwale2cc92f52015-09-09 13:12:10 -0700259 boundsChange |= BOUNDS_CHANGE_POSITION;
260 }
Chong Zhang2e2c81a2016-07-15 11:28:17 -0700261 if (mBounds.width() != bounds.width() || mBounds.height() != bounds.height()) {
Wale Ogunwale2cc92f52015-09-09 13:12:10 -0700262 boundsChange |= BOUNDS_CHANGE_SIZE;
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700263 }
264
Chong Zhang2e2c81a2016-07-15 11:28:17 -0700265 mBounds.set(bounds);
Chong Zhangf66db432016-01-13 10:39:51 -0800266
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700267 mRotation = rotation;
Filip Gruszczynski0689ae92015-10-01 12:30:31 -0700268 if (displayContent != null) {
Chong Zhang112eb8c2015-11-02 11:17:00 -0800269 displayContent.mDimLayerController.updateDimLayer(this);
Filip Gruszczynski0689ae92015-10-01 12:30:31 -0700270 }
Filip Gruszczynskiebcc8752015-08-25 16:51:05 -0700271 mOverrideConfig = mFullscreen ? Configuration.EMPTY : config;
Wale Ogunwale2cc92f52015-09-09 13:12:10 -0700272 return boundsChange;
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700273 }
274
Jorim Jaggidc249c42015-12-15 14:57:31 -0800275 /**
276 * Sets the bounds used to calculate the insets. See
277 * {@link android.app.IActivityManager#resizeDockedStack} why this is needed.
278 */
279 void setTempInsetBounds(Rect tempInsetBounds) {
280 if (tempInsetBounds != null) {
281 mTempInsetBounds.set(tempInsetBounds);
282 } else {
283 mTempInsetBounds.setEmpty();
284 }
285 }
286
287 /**
288 * Gets the bounds used to calculate the insets. See
289 * {@link android.app.IActivityManager#resizeDockedStack} why this is needed.
290 */
291 void getTempInsetBounds(Rect out) {
292 out.set(mTempInsetBounds);
293 }
294
Wale Ogunwaleb1faf602016-01-27 09:12:31 -0800295 void setResizeable(int resizeMode) {
296 mResizeMode = resizeMode;
Chong Zhangb15758a2015-11-17 12:12:03 -0800297 }
298
299 boolean isResizeable() {
Wale Ogunwaleb1faf602016-01-27 09:12:31 -0800300 return !mHomeTask
301 && (ActivityInfo.isResizeableMode(mResizeMode) || mService.mForceResizableTasks);
302 }
303
Jiaquan Hedd1e66f2016-06-15 15:15:12 -0700304 boolean isOnTopLauncher() {
305 return mIsOnTopLauncher;
306 }
307
Wale Ogunwaleb1faf602016-01-27 09:12:31 -0800308 boolean cropWindowsToStackBounds() {
309 return !mHomeTask && (isResizeable() || mResizeMode == RESIZE_MODE_CROP_WINDOWS);
310 }
311
Jorim Jaggi42625d1b2016-02-11 20:11:07 -0800312 boolean isHomeTask() {
313 return mHomeTask;
314 }
315
Wale Ogunwaleb1faf602016-01-27 09:12:31 -0800316 private boolean inCropWindowsResizeMode() {
317 return !mHomeTask && !isResizeable() && mResizeMode == RESIZE_MODE_CROP_WINDOWS;
Chong Zhangb15758a2015-11-17 12:12:03 -0800318 }
319
Chong Zhang87b21722015-09-21 15:39:51 -0700320 boolean resizeLocked(Rect bounds, Configuration configuration, boolean forced) {
Chong Zhang3005e752015-09-18 18:46:28 -0700321 int boundsChanged = setBounds(bounds, configuration);
Chong Zhang87b21722015-09-21 15:39:51 -0700322 if (forced) {
Chong Zhang3005e752015-09-18 18:46:28 -0700323 boundsChanged |= BOUNDS_CHANGE_SIZE;
Chong Zhang3005e752015-09-18 18:46:28 -0700324 }
325 if (boundsChanged == BOUNDS_CHANGE_NONE) {
326 return false;
327 }
328 if ((boundsChanged & BOUNDS_CHANGE_SIZE) == BOUNDS_CHANGE_SIZE) {
Wale Ogunwaled1c37912016-08-16 03:19:39 -0700329 onResize();
Chong Zhangbd0d9372015-12-28 15:18:29 -0800330 } else {
Wale Ogunwaled1c37912016-08-16 03:19:39 -0700331 onMovedByResize();
Chong Zhang3005e752015-09-18 18:46:28 -0700332 }
333 return true;
334 }
335
Jorim Jaggi0429f352015-12-22 16:29:16 +0100336 /**
337 * Prepares the task bounds to be frozen with the current size. See
338 * {@link AppWindowToken#freezeBounds}.
339 */
340 void prepareFreezingBounds() {
341 mPreparedFrozenBounds.set(mBounds);
Jorim Jaggi26c8c422016-05-09 19:57:25 -0700342 mPreparedFrozenMergedConfig.setTo(mService.mCurConfiguration);
343 mPreparedFrozenMergedConfig.updateFrom(mOverrideConfig);
Jorim Jaggi0429f352015-12-22 16:29:16 +0100344 }
345
Chong Zhang5117e272016-05-03 12:47:34 -0700346 /**
347 * Align the task to the adjusted bounds.
348 *
349 * @param adjustedBounds Adjusted bounds to which the task should be aligned.
350 * @param tempInsetBounds Insets bounds for the task.
351 * @param alignBottom True if the task's bottom should be aligned to the adjusted
352 * bounds's bottom; false if the task's top should be aligned
353 * the adjusted bounds's top.
354 */
355 void alignToAdjustedBounds(
356 Rect adjustedBounds, Rect tempInsetBounds, boolean alignBottom) {
357 if (!isResizeable() || mOverrideConfig == Configuration.EMPTY) {
358 return;
359 }
360
361 getBounds(mTmpRect2);
362 if (alignBottom) {
363 int offsetY = adjustedBounds.bottom - mTmpRect2.bottom;
364 mTmpRect2.offset(0, offsetY);
365 } else {
366 mTmpRect2.offsetTo(adjustedBounds.left, adjustedBounds.top);
367 }
368 setTempInsetBounds(tempInsetBounds);
369 resizeLocked(mTmpRect2, mOverrideConfig, false /* forced */);
370 }
371
Wale Ogunwalef175e8a2015-09-29 11:07:06 -0700372 /** Return true if the current bound can get outputted to the rest of the system as-is. */
373 private boolean useCurrentBounds() {
374 final DisplayContent displayContent = mStack.getDisplayContent();
375 if (mFullscreen
Wale Ogunwale3797c222015-10-27 14:21:58 -0700376 || !StackId.isTaskResizeableByDockedStack(mStack.mStackId)
Wale Ogunwalef175e8a2015-09-29 11:07:06 -0700377 || displayContent == null
Jorim Jaggif4fa8cb2016-04-01 16:05:10 -0700378 || displayContent.getDockedStackVisibleForUserLocked() != null) {
Wale Ogunwalef175e8a2015-09-29 11:07:06 -0700379 return true;
380 }
381 return false;
382 }
383
Chong Zhang4c9ba52a2015-11-10 18:36:33 -0800384 /** Original bounds of the task if applicable, otherwise fullscreen rect. */
Wale Ogunwaleccb6ce22016-01-14 15:36:35 -0800385 void getBounds(Rect out) {
Wale Ogunwalef175e8a2015-09-29 11:07:06 -0700386 if (useCurrentBounds()) {
387 // No need to adjust the output bounds if fullscreen or the docked stack is visible
388 // since it is already what we want to represent to the rest of the system.
389 out.set(mBounds);
390 return;
391 }
392
Wale Ogunwaleccb6ce22016-01-14 15:36:35 -0800393 // The bounds has been adjusted to accommodate for a docked stack, but the docked stack is
394 // not currently visible. Go ahead a represent it as fullscreen to the rest of the system.
Wale Ogunwalef175e8a2015-09-29 11:07:06 -0700395 mStack.getDisplayContent().getLogicalDisplayRect(out);
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700396 }
397
Chong Zhang4c9ba52a2015-11-10 18:36:33 -0800398 /**
399 * Calculate the maximum visible area of this task. If the task has only one app,
400 * the result will be visible frame of that app. If the task has more than one apps,
401 * we search from top down if the next app got different visible area.
402 *
403 * This effort is to handle the case where some task (eg. GMail composer) might pop up
404 * a dialog that's different in size from the activity below, in which case we should
405 * be dimming the entire task area behind the dialog.
406 *
407 * @param out Rect containing the max visible bounds.
408 * @return true if the task has some visible app windows; false otherwise.
409 */
410 boolean getMaxVisibleBounds(Rect out) {
411 boolean foundTop = false;
412 for (int i = mAppTokens.size() - 1; i >= 0; i--) {
Chong Zhangd8ceb852015-11-11 14:53:41 -0800413 final AppWindowToken token = mAppTokens.get(i);
414 // skip hidden (or about to hide) apps
415 if (token.mIsExiting || token.clientHidden || token.hiddenRequested) {
416 continue;
417 }
418 final WindowState win = token.findMainWindow();
Chong Zhang4c9ba52a2015-11-10 18:36:33 -0800419 if (win == null) {
420 continue;
421 }
422 if (!foundTop) {
423 out.set(win.mVisibleFrame);
424 foundTop = true;
425 continue;
426 }
427 if (win.mVisibleFrame.left < out.left) {
428 out.left = win.mVisibleFrame.left;
429 }
430 if (win.mVisibleFrame.top < out.top) {
431 out.top = win.mVisibleFrame.top;
432 }
433 if (win.mVisibleFrame.right > out.right) {
434 out.right = win.mVisibleFrame.right;
435 }
436 if (win.mVisibleFrame.bottom > out.bottom) {
437 out.bottom = win.mVisibleFrame.bottom;
438 }
439 }
440 return foundTop;
441 }
442
443 /** Bounds of the task to be used for dimming, as well as touch related tests. */
444 @Override
445 public void getDimBounds(Rect out) {
Robert Carra86a6bf2016-04-08 17:34:16 -0700446 final DisplayContent displayContent = mStack.getDisplayContent();
447 // It doesn't matter if we in particular are part of the resize, since we couldn't have
448 // a DimLayer anyway if we weren't visible.
449 final boolean dockedResizing = displayContent != null ?
450 displayContent.mDividerControllerLocked.isResizing() : false;
Chong Zhang4c9ba52a2015-11-10 18:36:33 -0800451 if (useCurrentBounds()) {
452 if (inFreeformWorkspace() && getMaxVisibleBounds(out)) {
453 return;
454 }
455
Jorim Jaggi22a869f2016-03-25 23:33:21 -0700456 if (!mFullscreen) {
457 // When minimizing the docked stack when going home, we don't adjust the task bounds
458 // so we need to intersect the task bounds with the stack bounds here.
Robert Carra86a6bf2016-04-08 17:34:16 -0700459 //
460 // If we are Docked Resizing with snap points, the task bounds could be smaller than the stack
461 // bounds and so we don't even want to use them. Even if the app should not be resized the Dim
462 // should keep up with the divider.
463 if (dockedResizing) {
464 mStack.getBounds(out);
465 } else {
466 mStack.getBounds(mTmpRect);
467 mTmpRect.intersect(mBounds);
468 }
Jorim Jaggi22a869f2016-03-25 23:33:21 -0700469 out.set(mTmpRect);
470 } else {
471 out.set(mBounds);
472 }
Chong Zhang4c9ba52a2015-11-10 18:36:33 -0800473 return;
474 }
475
476 // The bounds has been adjusted to accommodate for a docked stack, but the docked stack
477 // is not currently visible. Go ahead a represent it as fullscreen to the rest of the
478 // system.
Robert Carra86a6bf2016-04-08 17:34:16 -0700479 displayContent.getLogicalDisplayRect(out);
Chong Zhang4c9ba52a2015-11-10 18:36:33 -0800480 }
481
Jorim Jaggi0b46f3c2016-03-14 12:21:37 +0100482 void setDragResizing(boolean dragResizing, int dragResizeMode) {
Jorim Jaggic662d8e2016-02-05 16:54:54 -0800483 if (mDragResizing != dragResizing) {
Jorim Jaggi0b46f3c2016-03-14 12:21:37 +0100484 if (!DragResizeMode.isModeAllowedForStack(mStack.mStackId, dragResizeMode)) {
485 throw new IllegalArgumentException("Drag resize mode not allow for stack stackId="
486 + mStack.mStackId + " dragResizeMode=" + dragResizeMode);
487 }
Jorim Jaggic662d8e2016-02-05 16:54:54 -0800488 mDragResizing = dragResizing;
Jorim Jaggi0b46f3c2016-03-14 12:21:37 +0100489 mDragResizeMode = dragResizeMode;
Jorim Jaggic662d8e2016-02-05 16:54:54 -0800490 resetDragResizingChangeReported();
491 }
492 }
493
Wale Ogunwaled1c37912016-08-16 03:19:39 -0700494 private void resetDragResizingChangeReported() {
Jorim Jaggic662d8e2016-02-05 16:54:54 -0800495 for (int activityNdx = mAppTokens.size() - 1; activityNdx >= 0; --activityNdx) {
Wale Ogunwale9f25bee2016-08-02 07:23:47 -0700496 mAppTokens.get(activityNdx).resetDragResizingChangeReported();
Jorim Jaggic662d8e2016-02-05 16:54:54 -0800497 }
Chong Zhang3005e752015-09-18 18:46:28 -0700498 }
499
500 boolean isDragResizing() {
Wale Ogunwaled1c37912016-08-16 03:19:39 -0700501 return mDragResizing;
Chong Zhang3005e752015-09-18 18:46:28 -0700502 }
503
Jorim Jaggi0b46f3c2016-03-14 12:21:37 +0100504 int getDragResizeMode() {
505 return mDragResizeMode;
506 }
507
Jorim Jaggiff71d202016-04-14 13:12:36 -0700508 /**
509 * Adds all of the tasks windows to {@link WindowManagerService#mWaitingForDrawn} if drag
510 * resizing state of the window has been changed.
511 */
Wale Ogunwale9f25bee2016-08-02 07:23:47 -0700512 void setWaitingForDrawnIfResizingChanged() {
513 for (int i = mAppTokens.size() - 1; i >= 0; --i) {
514 mAppTokens.get(i).setWaitingForDrawnIfResizingChanged();
515 }
516 }
517
Wale Ogunwaled1c37912016-08-16 03:19:39 -0700518 boolean detachFromDisplay() {
519 boolean didSomething = false;
Wale Ogunwale9f25bee2016-08-02 07:23:47 -0700520 for (int i = mAppTokens.size() - 1; i >= 0; --i) {
Wale Ogunwaled1c37912016-08-16 03:19:39 -0700521 didSomething |= mAppTokens.get(i).detachFromDisplay();
Jorim Jaggiff71d202016-04-14 13:12:36 -0700522 }
Wale Ogunwaled1c37912016-08-16 03:19:39 -0700523 return didSomething;
Jorim Jaggiff71d202016-04-14 13:12:36 -0700524 }
525
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700526 void updateDisplayInfo(final DisplayContent displayContent) {
527 if (displayContent == null) {
528 return;
529 }
530 if (mFullscreen) {
Filip Gruszczynskiebcc8752015-08-25 16:51:05 -0700531 setBounds(null, Configuration.EMPTY);
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700532 return;
533 }
534 final int newRotation = displayContent.getDisplayInfo().rotation;
535 if (mRotation == newRotation) {
536 return;
537 }
538
Wale Ogunwalee1fe4d12016-01-14 08:52:30 -0800539 // Device rotation changed.
Chong Zhang2e2c81a2016-07-15 11:28:17 -0700540 // - We don't want the task to move around on the screen when this happens, so update the
541 // task bounds so it stays in the same place.
Wale Ogunwalee1fe4d12016-01-14 08:52:30 -0800542 // - Rotate the bounds and notify activity manager if the task can be resized independently
Chong Zhang2e2c81a2016-07-15 11:28:17 -0700543 // from its stack. The stack will take care of task rotation for the other case.
544 mTmpRect2.set(mBounds);
Wale Ogunwalee1fe4d12016-01-14 08:52:30 -0800545
546 if (!StackId.isTaskResizeAllowed(mStack.mStackId)) {
547 setBounds(mTmpRect2, mOverrideConfig);
548 return;
549 }
550
Wale Ogunwale94744212015-09-21 19:01:47 -0700551 displayContent.rotateBounds(mRotation, newRotation, mTmpRect2);
Wale Ogunwale1ed0d892015-09-28 13:27:44 -0700552 if (setBounds(mTmpRect2, mOverrideConfig) != BOUNDS_CHANGE_NONE) {
Wale Ogunwalee1fe4d12016-01-14 08:52:30 -0800553 // Post message to inform activity manager of the bounds change simulating a one-way
554 // call. We do this to prevent a deadlock between window manager lock and activity
555 // manager lock been held.
556 mService.mH.obtainMessage(RESIZE_TASK, mTaskId,
Chong Zhang2e2c81a2016-07-15 11:28:17 -0700557 RESIZE_MODE_SYSTEM_SCREEN_ROTATION, mBounds).sendToTarget();
Wale Ogunwale1ed0d892015-09-28 13:27:44 -0700558 }
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700559 }
560
Wale Ogunwaled1c37912016-08-16 03:19:39 -0700561 private void onResize() {
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700562 for (int activityNdx = mAppTokens.size() - 1; activityNdx >= 0; --activityNdx) {
Wale Ogunwaled1c37912016-08-16 03:19:39 -0700563 mAppTokens.get(activityNdx).onResize();
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700564 }
565 }
566
Wale Ogunwaled1c37912016-08-16 03:19:39 -0700567 private void onMovedByResize() {
Wale Ogunwale9f25bee2016-08-02 07:23:47 -0700568 for (int i = mAppTokens.size() - 1; i >= 0; --i) {
Wale Ogunwaled1c37912016-08-16 03:19:39 -0700569 mAppTokens.get(i).onMovedByResize();
Chong Zhangbd0d9372015-12-28 15:18:29 -0800570 }
571 }
572
Winsonc28098f2015-10-30 14:50:19 -0700573 /**
574 * Cancels any running app transitions associated with the task.
575 */
576 void cancelTaskWindowTransition() {
577 for (int activityNdx = mAppTokens.size() - 1; activityNdx >= 0; --activityNdx) {
578 mAppTokens.get(activityNdx).mAppAnimator.clearAnimation();
579 }
580 }
581
Winson13d30662015-11-06 15:30:29 -0800582 /**
583 * Cancels any running thumbnail transitions associated with the task.
584 */
585 void cancelTaskThumbnailTransition() {
586 for (int activityNdx = mAppTokens.size() - 1; activityNdx >= 0; --activityNdx) {
587 mAppTokens.get(activityNdx).mAppAnimator.clearThumbnail();
588 }
589 }
590
Wale Ogunwale6dfdfd62015-04-15 12:01:38 -0700591 boolean showForAllUsers() {
Wale Ogunwale3fcb4a82015-04-06 14:00:13 -0700592 final int tokensCount = mAppTokens.size();
Wale Ogunwale6dfdfd62015-04-15 12:01:38 -0700593 return (tokensCount != 0) && mAppTokens.get(tokensCount - 1).showForAllUsers;
Wale Ogunwale3fcb4a82015-04-06 14:00:13 -0700594 }
595
Wale Ogunwale44f21802016-09-02 12:49:48 -0700596 boolean hasContentToDisplay() {
597 for (int i = mAppTokens.size() - 1; i >= 0; i--) {
598 final AppWindowToken appToken = mAppTokens.get(i);
599 if (appToken.hasContentToDisplay()) {
600 return true;
601 }
602 }
603 return false;
604 }
605
Jorim Jaggiff71d202016-04-14 13:12:36 -0700606 boolean isVisible() {
607 for (int i = mAppTokens.size() - 1; i >= 0; i--) {
608 final AppWindowToken appToken = mAppTokens.get(i);
609 if (appToken.isVisible()) {
610 return true;
611 }
612 }
613 return false;
614 }
615
Chong Zhangdb20b5f2015-10-23 14:01:43 -0700616 boolean inHomeStack() {
617 return mStack != null && mStack.mStackId == HOME_STACK_ID;
618 }
619
Chong Zhang09b21ef2015-09-14 10:20:21 -0700620 boolean inFreeformWorkspace() {
621 return mStack != null && mStack.mStackId == FREEFORM_WORKSPACE_STACK_ID;
622 }
623
Robert Carr03138452016-05-18 14:53:16 -0700624 boolean inPinnedWorkspace() {
625 return mStack != null && mStack.mStackId == PINNED_STACK_ID;
626 }
627
Robert Carre6275582016-02-29 15:45:45 -0800628 boolean isFloating() {
629 return StackId.tasksAreFloating(mStack.mStackId);
630 }
631
Chong Zhangd8ceb852015-11-11 14:53:41 -0800632 WindowState getTopVisibleAppMainWindow() {
633 final AppWindowToken token = getTopVisibleAppToken();
634 return token != null ? token.findMainWindow() : null;
Chong Zhang9184ec62015-09-24 12:32:21 -0700635 }
636
Chong Zhangd8ceb852015-11-11 14:53:41 -0800637 AppWindowToken getTopVisibleAppToken() {
638 for (int i = mAppTokens.size() - 1; i >= 0; i--) {
639 final AppWindowToken token = mAppTokens.get(i);
640 // skip hidden (or about to hide) apps
641 if (!token.mIsExiting && !token.clientHidden && !token.hiddenRequested) {
642 return token;
643 }
644 }
645 return null;
Chong Zhangbef461f2015-10-27 11:38:24 -0700646 }
647
Craig Mautner5d9c7be2013-02-15 14:02:56 -0800648 @Override
Wale Ogunwale29bfbb82016-05-12 15:13:52 -0700649 public boolean dimFullscreen() {
650 return isHomeTask() || isFullscreen();
651 }
652
653 boolean isFullscreen() {
Wale Ogunwalef175e8a2015-09-29 11:07:06 -0700654 if (useCurrentBounds()) {
655 return mFullscreen;
656 }
657 // The bounds has been adjusted to accommodate for a docked stack, but the docked stack
658 // is not currently visible. Go ahead a represent it as fullscreen to the rest of the
659 // system.
660 return true;
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700661 }
662
663 @Override
664 public DisplayInfo getDisplayInfo() {
665 return mStack.getDisplayContent().getDisplayInfo();
666 }
667
Jorim Jaggi6626f542016-08-22 13:08:44 -0700668 /**
669 * See {@link WindowManagerService#overridePlayingAppAnimationsLw}
670 */
671 void overridePlayingAppAnimations(Animation a) {
672 for (int i = mAppTokens.size() - 1; i >= 0; i--) {
673 mAppTokens.get(i).overridePlayingAppAnimations(a);
674 }
675 }
676
Wale Ogunwale9f25bee2016-08-02 07:23:47 -0700677 void forceWindowsScaleable(boolean force) {
678 SurfaceControl.openTransaction();
679 try {
680 for (int i = mAppTokens.size() - 1; i >= 0; i--) {
681 mAppTokens.get(i).forceWindowsScaleableInTransaction(force);
682 }
683 } finally {
684 SurfaceControl.closeTransaction();
685 }
686 }
687
688 boolean isAnimating() {
689 for (int i = mAppTokens.size() - 1; i >= 0; i--) {
690 final AppWindowToken aToken = mAppTokens.get(i);
691 if (aToken.isAnimating()) {
692 return true;
693 }
694 }
695 return false;
696 }
697
Wale Ogunwale3f4433d2016-08-18 20:42:42 -0700698 void checkAppWindowsReadyToShow(int displayId) {
699 for (int i = mAppTokens.size() - 1; i >= 0; --i) {
700 final AppWindowToken aToken = mAppTokens.get(i);
701 aToken.checkAppWindowsReadyToShow(displayId);
702 }
703 }
704
705 void updateAllDrawn(int displayId) {
706 for (int i = mAppTokens.size() - 1; i >= 0; --i) {
707 final AppWindowToken aToken = mAppTokens.get(i);
708 aToken.updateAllDrawn(displayId);
709 }
710 }
711
712 void stepAppWindowsAnimation(long currentTime, int displayId) {
713 for (int i = mAppTokens.size() - 1; i >= 0; --i) {
714 final AppWindowToken aToken = mAppTokens.get(i);
715 aToken.stepAppWindowsAnimation(currentTime, displayId);
716 }
717 }
718
Wale Ogunwale9adfe572016-09-08 20:43:58 -0700719 void onAppTransitionDone() {
720 for (int i = mAppTokens.size() - 1; i >= 0; --i) {
721 final AppWindowToken token = mAppTokens.get(i);
722 token.onAppTransitionDone();
723 }
724 }
725
Wale Ogunwale63d4ecc2016-09-08 18:48:26 -0700726 // TODO: Use WindowContainer.compareTo() once everything is using WindowContainer
727 boolean isFirstGreaterThanSecond(AppWindowToken first, AppWindowToken second) {
728 return mAppTokens.indexOf(first) > mAppTokens.indexOf(second);
729 }
730
Wale Ogunwale9adfe572016-09-08 20:43:58 -0700731 int rebuildWindowList(DisplayContent dc, int addIndex) {
732 final int count = mAppTokens.size();
733 for (int i = 0; i < count; i++) {
734 final AppWindowToken token = mAppTokens.get(i);
735 addIndex = token.rebuildWindowList(dc, addIndex);
736 }
737 return addIndex;
738 }
739
Wale Ogunwaleec731152016-09-08 20:18:57 -0700740 void getWindowOnDisplayBeforeToken(DisplayContent dc, WindowToken token,
Wale Ogunwale3f4433d2016-08-18 20:42:42 -0700741 DisplayContent.GetWindowOnDisplaySearchResult result) {
Wale Ogunwaleec731152016-09-08 20:18:57 -0700742 for (int i = mAppTokens.size() - 1; i >= 0; --i) {
743 final AppWindowToken current = mAppTokens.get(i);
744 if (current == token) {
745 // We have reach the token we are interested in. End search.
746 result.reachedToken = true;
747 return;
748 }
749
750 // We haven't reached the token yet; if this token is not going to the bottom and
751 // has windows on this display, then it is a candidate for what we are looking for.
752 final WindowList tokenWindowList = dc.getTokenWindowsOnDisplay(current);
753 if (!current.sendingToBottom && tokenWindowList.size() > 0) {
754 result.foundWindow = tokenWindowList.get(0);
755 }
756 }
757 }
758
759 void getWindowOnDisplayAfterToken(DisplayContent dc, WindowToken token,
Wale Ogunwale3f4433d2016-08-18 20:42:42 -0700760 DisplayContent.GetWindowOnDisplaySearchResult result) {
Wale Ogunwaleec731152016-09-08 20:18:57 -0700761 for (int i = mAppTokens.size() - 1; i >= 0; --i) {
762 final AppWindowToken current = mAppTokens.get(i);
763 if (!result.reachedToken) {
764 if (current == token) {
765 // We have reached the token we are interested in. Get whichever window occurs
766 // after it that is on the same display.
767 result.reachedToken = true;
768 }
769 continue;
770 }
771
772 final WindowList tokenWindowList = dc.getTokenWindowsOnDisplay(current);
773 if (tokenWindowList.size() > 0) {
774 result.foundWindow = tokenWindowList.get(tokenWindowList.size() - 1);
775 return;
776 }
777 }
778 }
779
Wale Ogunwale51362492016-09-08 17:49:17 -0700780 boolean fillsParent() {
781 return mFullscreen || !StackId.isTaskResizeAllowed(mStack.mStackId);
782 }
783
784 // TODO: Remove once switched to use WindowContainer
785 int getOrientation() {
786 int candidate = SCREEN_ORIENTATION_UNSET;
787
788 for (int i = mAppTokens.size() - 1; i >= 0; --i) {
789 final AppWindowToken token = mAppTokens.get(i);
790 final int orientation = token.getOrientation();
791
792 if (orientation == SCREEN_ORIENTATION_BEHIND) {
793 candidate = orientation;
794 continue;
795 }
796
797 if (orientation != SCREEN_ORIENTATION_UNSET) {
798 if (token.fillsParent() || orientation != SCREEN_ORIENTATION_UNSPECIFIED) {
799 return orientation;
800 }
801 }
802 }
803
804 return candidate;
805 }
806
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700807 @Override
Craig Mautner5d9c7be2013-02-15 14:02:56 -0800808 public String toString() {
Craig Mautner83162a92015-01-26 14:43:30 -0800809 return "{taskId=" + mTaskId + " appTokens=" + mAppTokens + " mdr=" + mDeferRemoval + "}";
Craig Mautner5d9c7be2013-02-15 14:02:56 -0800810 }
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700811
Wale Ogunwale9adfe572016-09-08 20:43:58 -0700812 String getName() {
813 return toShortString();
814 }
815
Filip Gruszczynski0689ae92015-10-01 12:30:31 -0700816 @Override
817 public String toShortString() {
818 return "Task=" + mTaskId;
819 }
820
Wale Ogunwale9adfe572016-09-08 20:43:58 -0700821 void dumpChildrenNames(PrintWriter pw, String prefix) {
822 final String childPrefix = prefix + prefix;
823 for (int i = mAppTokens.size() - 1; i >= 0; --i) {
824 final AppWindowToken token = mAppTokens.get(i);
825 pw.println("#" + i + " " + getName());
826 token.dumpChildrenNames(pw, childPrefix);
827 }
828 }
829
Wale Ogunwaleb429e682016-01-06 12:36:34 -0800830 public void dump(String prefix, PrintWriter pw) {
831 final String doublePrefix = prefix + " ";
832
833 pw.println(prefix + "taskId=" + mTaskId);
834 pw.println(doublePrefix + "mFullscreen=" + mFullscreen);
835 pw.println(doublePrefix + "mBounds=" + mBounds.toShortString());
836 pw.println(doublePrefix + "mdr=" + mDeferRemoval);
837 pw.println(doublePrefix + "appTokens=" + mAppTokens);
838 pw.println(doublePrefix + "mTempInsetBounds=" + mTempInsetBounds.toShortString());
839
840 final String triplePrefix = doublePrefix + " ";
841
842 for (int i = mAppTokens.size() - 1; i >= 0; i--) {
843 final AppWindowToken wtoken = mAppTokens.get(i);
844 pw.println(triplePrefix + "Activity #" + i + " " + wtoken);
845 wtoken.dump(pw, triplePrefix);
846 }
847
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700848 }
Craig Mautnerb1fd65c02013-02-05 13:34:57 -0800849}