blob: 58f044801f7f0c79c8d3d30360f3181304a5f04f [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
Craig Mautner42bf39e2014-02-21 16:46:22 -080019import static com.android.server.wm.WindowManagerService.TAG;
Wale Ogunwalee4a0c572015-06-30 08:40:31 -070020import static com.android.server.wm.WindowManagerService.DEBUG_RESIZE;
Craig Mautnere3119b72015-01-20 15:02:36 -080021import static com.android.server.wm.WindowManagerService.DEBUG_STACK;
Stefan Kuhne234dbf82015-08-13 09:44:28 -070022import static android.app.ActivityManager.FREEFORM_WORKSPACE_STACK_ID;
Craig Mautner42bf39e2014-02-21 16:46:22 -080023
Wale Ogunwalee4a0c572015-06-30 08:40:31 -070024import android.content.res.Configuration;
25import android.graphics.Rect;
Craig Mautner2c2549c2013-11-12 08:31:15 -080026import android.util.EventLog;
Craig Mautner42bf39e2014-02-21 16:46:22 -080027import android.util.Slog;
Wale Ogunwalee4a0c572015-06-30 08:40:31 -070028import android.util.SparseArray;
29import android.util.TypedValue;
30import android.view.DisplayInfo;
31import android.view.Surface;
32
Craig Mautnere3119b72015-01-20 15:02:36 -080033import com.android.server.EventLogTags;
Craig Mautner2c2549c2013-11-12 08:31:15 -080034
Wale Ogunwalee4a0c572015-06-30 08:40:31 -070035import java.io.PrintWriter;
36import java.util.ArrayList;
37
38class Task implements DimLayer.DimLayerUser {
39 /** Amount of time in milliseconds to animate the dim surface from one value to another,
40 * when no window animation is driving it. */
41 private static final int DEFAULT_DIM_DURATION = 200;
42
Wale Ogunwale2cc92f52015-09-09 13:12:10 -070043 // Return value from {@link setBounds} indicating no change was made to the Task bounds.
44 static final int BOUNDS_CHANGE_NONE = 0;
45 // Return value from {@link setBounds} indicating the position of the Task bounds changed.
46 static final int BOUNDS_CHANGE_POSITION = 1;
47 // Return value from {@link setBounds} indicating the size of the Task bounds changed.
48 static final int BOUNDS_CHANGE_SIZE = 1 << 1;
49
Craig Mautnerc00204b2013-03-05 15:02:14 -080050 TaskStack mStack;
Craig Mautner05d6272ba2013-02-11 09:39:27 -080051 final AppTokenList mAppTokens = new AppTokenList();
Craig Mautner83162a92015-01-26 14:43:30 -080052 final int mTaskId;
Craig Mautnerac6f8432013-07-17 13:24:59 -070053 final int mUserId;
Craig Mautner9ef471f2014-02-07 13:11:47 -080054 boolean mDeferRemoval = false;
Craig Mautnere3119b72015-01-20 15:02:36 -080055 final WindowManagerService mService;
Craig Mautnerb1fd65c02013-02-05 13:34:57 -080056
Wale Ogunwalee4a0c572015-06-30 08:40:31 -070057 // Content limits relative to the DisplayContent this sits in.
58 private Rect mBounds = new Rect();
59
60 // Device rotation as of the last time {@link #mBounds} was set.
61 int mRotation;
62
63 // Whether mBounds is fullscreen
64 private boolean mFullscreen = true;
65
66 // Contains configurations settings that are different from the global configuration due to
67 // stack specific operations. E.g. {@link #setBounds}.
68 Configuration mOverrideConfig;
69
70 // For comparison with DisplayContent bounds.
71 private Rect mTmpRect = new Rect();
72 // For handling display rotations.
73 private Rect mTmpRect2 = new Rect();
74
Chong Zhang3005e752015-09-18 18:46:28 -070075 // Whether the task is currently being drag-resized
76 private boolean mDragResizing;
77
78 // Whether the task is starting or ending to be drag-resized
79 private boolean mDragResizeChanging;
80
Wale Ogunwalee4a0c572015-06-30 08:40:31 -070081 // The particular window with FLAG_DIM_BEHIND set. If null, hide mDimLayer.
82 WindowStateAnimator mDimWinAnimator;
83 // Used to support {@link android.view.WindowManager.LayoutParams#FLAG_DIM_BEHIND}
84 private DimLayer mDimLayer;
85 // Set to false at the start of performLayoutAndPlaceSurfaces. If it is still false by the end
86 // then stop any dimming.
87 private boolean mContinueDimming;
88 // Shared dim layer for fullscreen tasks. {@link #mDimLayer} will point to this instead
89 // of creating a new object per fullscreen task on a display.
90 private static final SparseArray<DimLayer> sSharedFullscreenDimLayers = new SparseArray<>();
91
Filip Gruszczynskiebcc8752015-08-25 16:51:05 -070092 Task(int taskId, TaskStack stack, int userId, WindowManagerService service, Rect bounds,
93 Configuration config) {
Craig Mautner83162a92015-01-26 14:43:30 -080094 mTaskId = taskId;
Craig Mautnerc00204b2013-03-05 15:02:14 -080095 mStack = stack;
Craig Mautnerac6f8432013-07-17 13:24:59 -070096 mUserId = userId;
Craig Mautnere3119b72015-01-20 15:02:36 -080097 mService = service;
Filip Gruszczynskiebcc8752015-08-25 16:51:05 -070098 setBounds(bounds, config);
Craig Mautnerc00204b2013-03-05 15:02:14 -080099 }
100
101 DisplayContent getDisplayContent() {
102 return mStack.getDisplayContent();
103 }
104
105 void addAppToken(int addPos, AppWindowToken wtoken) {
Craig Mautner42bf39e2014-02-21 16:46:22 -0800106 final int lastPos = mAppTokens.size();
Craig Mautner83162a92015-01-26 14:43:30 -0800107 if (addPos >= lastPos) {
108 addPos = lastPos;
109 } else {
110 for (int pos = 0; pos < lastPos && pos < addPos; ++pos) {
111 if (mAppTokens.get(pos).removed) {
112 // addPos assumes removed tokens are actually gone.
113 ++addPos;
114 }
Craig Mautner01f79cf2014-08-27 09:56:02 -0700115 }
Craig Mautner42bf39e2014-02-21 16:46:22 -0800116 }
Craig Mautnerc00204b2013-03-05 15:02:14 -0800117 mAppTokens.add(addPos, wtoken);
Craig Mautner83162a92015-01-26 14:43:30 -0800118 wtoken.mTask = this;
Craig Mautner42bf39e2014-02-21 16:46:22 -0800119 mDeferRemoval = false;
Craig Mautnerc00204b2013-03-05 15:02:14 -0800120 }
121
Craig Mautnere3119b72015-01-20 15:02:36 -0800122 void removeLocked() {
123 if (!mAppTokens.isEmpty() && mStack.isAnimating()) {
Craig Mautner83162a92015-01-26 14:43:30 -0800124 if (DEBUG_STACK) Slog.i(TAG, "removeTask: deferring removing taskId=" + mTaskId);
Craig Mautnere3119b72015-01-20 15:02:36 -0800125 mDeferRemoval = true;
126 return;
127 }
Craig Mautner83162a92015-01-26 14:43:30 -0800128 if (DEBUG_STACK) Slog.i(TAG, "removeTask: removing taskId=" + mTaskId);
129 EventLog.writeEvent(EventLogTags.WM_TASK_REMOVED, mTaskId, "removeTask");
Craig Mautnere3119b72015-01-20 15:02:36 -0800130 mDeferRemoval = false;
131 mStack.removeTask(this);
Craig Mautner83162a92015-01-26 14:43:30 -0800132 mService.mTaskIdToTask.delete(mTaskId);
Craig Mautnere3119b72015-01-20 15:02:36 -0800133 }
134
Wale Ogunwale53a29a92015-02-23 15:42:52 -0800135 void moveTaskToStack(TaskStack stack, boolean toTop) {
136 if (stack == mStack) {
137 return;
138 }
139 if (DEBUG_STACK) Slog.i(TAG, "moveTaskToStack: removing taskId=" + mTaskId
140 + " from stack=" + mStack);
Wale Ogunwale000957c2015-04-03 08:19:12 -0700141 EventLog.writeEvent(EventLogTags.WM_TASK_REMOVED, mTaskId, "moveTask");
Wale Ogunwale53a29a92015-02-23 15:42:52 -0800142 if (mStack != null) {
143 mStack.removeTask(this);
144 }
145 stack.addTask(this, toTop);
146 }
147
Wale Ogunwaleddc1cb22015-07-25 19:23:04 -0700148 void positionTaskInStack(TaskStack stack, int position) {
149 if (mStack != null && stack != mStack) {
150 if (DEBUG_STACK) Slog.i(TAG, "positionTaskInStack: removing taskId=" + mTaskId
151 + " from stack=" + mStack);
152 EventLog.writeEvent(EventLogTags.WM_TASK_REMOVED, mTaskId, "moveTask");
153 mStack.removeTask(this);
154 }
155 stack.positionTask(this, position, showForAllUsers());
156 }
157
Craig Mautnerc00204b2013-03-05 15:02:14 -0800158 boolean removeAppToken(AppWindowToken wtoken) {
Craig Mautner42bf39e2014-02-21 16:46:22 -0800159 boolean removed = mAppTokens.remove(wtoken);
Craig Mautnerc00204b2013-03-05 15:02:14 -0800160 if (mAppTokens.size() == 0) {
Wale Ogunwale000957c2015-04-03 08:19:12 -0700161 EventLog.writeEvent(EventLogTags.WM_TASK_REMOVED, mTaskId,
Craig Mautner2c2549c2013-11-12 08:31:15 -0800162 "removeAppToken: last token");
Craig Mautnere3119b72015-01-20 15:02:36 -0800163 if (mDeferRemoval) {
164 removeLocked();
165 }
Craig Mautnerc00204b2013-03-05 15:02:14 -0800166 }
Craig Mautner83162a92015-01-26 14:43:30 -0800167 wtoken.mTask = null;
168 /* Leave mTaskId for now, it might be useful for debug
169 wtoken.mTaskId = -1;
170 */
Craig Mautner42bf39e2014-02-21 16:46:22 -0800171 return removed;
Craig Mautnerb1fd65c02013-02-05 13:34:57 -0800172 }
Craig Mautner5d9c7be2013-02-15 14:02:56 -0800173
Craig Mautnercbd84af2014-10-22 13:21:22 -0700174 void setSendingToBottom(boolean toBottom) {
175 for (int appTokenNdx = 0; appTokenNdx < mAppTokens.size(); appTokenNdx++) {
176 mAppTokens.get(appTokenNdx).sendingToBottom = toBottom;
177 }
178 }
179
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700180 /** Set the task bounds. Passing in null sets the bounds to fullscreen. */
Wale Ogunwale2cc92f52015-09-09 13:12:10 -0700181 int setBounds(Rect bounds, Configuration config) {
Filip Gruszczynskiebcc8752015-08-25 16:51:05 -0700182 if (config == null) {
183 config = Configuration.EMPTY;
184 }
185 if (bounds == null && !Configuration.EMPTY.equals(config)) {
186 throw new IllegalArgumentException("null bounds but non empty configuration: "
187 + config);
188 }
189 if (bounds != null && Configuration.EMPTY.equals(config)) {
190 throw new IllegalArgumentException("non null bounds, but empty configuration");
191 }
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700192 boolean oldFullscreen = mFullscreen;
193 int rotation = Surface.ROTATION_0;
194 final DisplayContent displayContent = mStack.getDisplayContent();
195 if (displayContent != null) {
196 displayContent.getLogicalDisplayRect(mTmpRect);
197 rotation = displayContent.getDisplayInfo().rotation;
198 if (bounds == null) {
199 bounds = mTmpRect;
200 mFullscreen = true;
201 } else {
Stefan Kuhne234dbf82015-08-13 09:44:28 -0700202 if (mStack.mStackId != FREEFORM_WORKSPACE_STACK_ID || bounds.isEmpty()) {
203 // ensure bounds are entirely within the display rect
204 if (!bounds.intersect(mTmpRect)) {
205 // Can't set bounds outside the containing display...Sorry!
Wale Ogunwale2cc92f52015-09-09 13:12:10 -0700206 return BOUNDS_CHANGE_NONE;
Stefan Kuhne234dbf82015-08-13 09:44:28 -0700207 }
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700208 }
209 mFullscreen = mTmpRect.equals(bounds);
210 }
211 }
212
213 if (bounds == null) {
214 // Can't set to fullscreen if we don't have a display to get bounds from...
Wale Ogunwale2cc92f52015-09-09 13:12:10 -0700215 return BOUNDS_CHANGE_NONE;
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700216 }
217 if (mBounds.equals(bounds) && oldFullscreen == mFullscreen && mRotation == rotation) {
Wale Ogunwale2cc92f52015-09-09 13:12:10 -0700218 return BOUNDS_CHANGE_NONE;
219 }
220
221 int boundsChange = BOUNDS_CHANGE_NONE;
222 if (mBounds.left != bounds.left || mBounds.right != bounds.right) {
223 boundsChange |= BOUNDS_CHANGE_POSITION;
224 }
225 if (mBounds.width() != bounds.width() || mBounds.height() != bounds.height()) {
226 boundsChange |= BOUNDS_CHANGE_SIZE;
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700227 }
228
229 mBounds.set(bounds);
230 mRotation = rotation;
231 updateDimLayer();
Filip Gruszczynskiebcc8752015-08-25 16:51:05 -0700232 mOverrideConfig = mFullscreen ? Configuration.EMPTY : config;
Wale Ogunwale2cc92f52015-09-09 13:12:10 -0700233 return boundsChange;
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700234 }
235
Chong Zhang3005e752015-09-18 18:46:28 -0700236 boolean resizeLocked(Rect bounds, Configuration configuration) {
237 int boundsChanged = setBounds(bounds, configuration);
238 if (mDragResizeChanging) {
239 boundsChanged |= BOUNDS_CHANGE_SIZE;
240 mDragResizeChanging = false;
241 }
242 if (boundsChanged == BOUNDS_CHANGE_NONE) {
243 return false;
244 }
245 if ((boundsChanged & BOUNDS_CHANGE_SIZE) == BOUNDS_CHANGE_SIZE) {
246 resizeWindows();
247 }
248 return true;
249 }
250
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700251 void getBounds(Rect out) {
252 out.set(mBounds);
253 }
254
Chong Zhang3005e752015-09-18 18:46:28 -0700255 void setDragResizing(boolean dragResizing) {
256 mDragResizeChanging = mDragResizing != dragResizing;
257 mDragResizing = dragResizing;
258 }
259
260 boolean isDragResizing() {
261 return mDragResizing;
262 }
263
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700264 void updateDisplayInfo(final DisplayContent displayContent) {
265 if (displayContent == null) {
266 return;
267 }
268 if (mFullscreen) {
Filip Gruszczynskiebcc8752015-08-25 16:51:05 -0700269 setBounds(null, Configuration.EMPTY);
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700270 return;
271 }
272 final int newRotation = displayContent.getDisplayInfo().rotation;
273 if (mRotation == newRotation) {
274 return;
275 }
276
277 // Device rotation changed. We don't want the task to move around on the screen when
278 // this happens, so update the task bounds so it stays in the same place.
279 final int rotationDelta = DisplayContent.deltaRotation(mRotation, newRotation);
280 displayContent.getLogicalDisplayRect(mTmpRect);
281 switch (rotationDelta) {
282 case Surface.ROTATION_0:
283 mTmpRect2.set(mBounds);
284 break;
285 case Surface.ROTATION_90:
286 mTmpRect2.top = mTmpRect.bottom - mBounds.right;
287 mTmpRect2.left = mBounds.top;
288 mTmpRect2.right = mTmpRect2.left + mBounds.height();
289 mTmpRect2.bottom = mTmpRect2.top + mBounds.width();
290 break;
291 case Surface.ROTATION_180:
292 mTmpRect2.top = mTmpRect.bottom - mBounds.bottom;
293 mTmpRect2.left = mTmpRect.right - mBounds.right;
294 mTmpRect2.right = mTmpRect2.left + mBounds.width();
295 mTmpRect2.bottom = mTmpRect2.top + mBounds.height();
296 break;
297 case Surface.ROTATION_270:
298 mTmpRect2.top = mBounds.left;
299 mTmpRect2.left = mTmpRect.right - mBounds.bottom;
300 mTmpRect2.right = mTmpRect2.left + mBounds.height();
301 mTmpRect2.bottom = mTmpRect2.top + mBounds.width();
302 break;
303 }
Filip Gruszczynskiebcc8752015-08-25 16:51:05 -0700304 setBounds(mTmpRect2, mOverrideConfig);
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700305 }
306
307 /** Updates the dim layer bounds, recreating it if needed. */
308 private void updateDimLayer() {
309 DimLayer newDimLayer;
310 final boolean previousFullscreen =
311 mDimLayer != null && sSharedFullscreenDimLayers.indexOfValue(mDimLayer) > -1;
312 final int displayId = mStack.getDisplayContent().getDisplayId();
313 if (mFullscreen) {
314 if (previousFullscreen) {
315 // Nothing to do here...
316 return;
317 }
318 // Use shared fullscreen dim layer
319 newDimLayer = sSharedFullscreenDimLayers.get(displayId);
320 if (newDimLayer == null) {
321 if (mDimLayer != null) {
322 // Re-purpose the previous dim layer.
323 newDimLayer = mDimLayer;
324 } else {
325 // Create new full screen dim layer.
326 newDimLayer = new DimLayer(mService, this, displayId);
327 }
328 newDimLayer.setBounds(mBounds);
329 sSharedFullscreenDimLayers.put(displayId, newDimLayer);
330 } else if (mDimLayer != null) {
331 mDimLayer.destroySurface();
332 }
333 } else {
334 newDimLayer = (mDimLayer == null || previousFullscreen)
335 ? new DimLayer(mService, this, displayId) : mDimLayer;
336 newDimLayer.setBounds(mBounds);
337 }
338 mDimLayer = newDimLayer;
339 }
340
341 boolean animateDimLayers() {
342 final int dimLayer;
343 final float dimAmount;
344 if (mDimWinAnimator == null) {
345 dimLayer = mDimLayer.getLayer();
346 dimAmount = 0;
347 } else {
348 dimLayer = mDimWinAnimator.mAnimLayer - WindowManagerService.LAYER_OFFSET_DIM;
349 dimAmount = mDimWinAnimator.mWin.mAttrs.dimAmount;
350 }
351 final float targetAlpha = mDimLayer.getTargetAlpha();
352 if (targetAlpha != dimAmount) {
353 if (mDimWinAnimator == null) {
354 mDimLayer.hide(DEFAULT_DIM_DURATION);
355 } else {
356 long duration = (mDimWinAnimator.mAnimating && mDimWinAnimator.mAnimation != null)
357 ? mDimWinAnimator.mAnimation.computeDurationHint()
358 : DEFAULT_DIM_DURATION;
359 if (targetAlpha > dimAmount) {
360 duration = getDimBehindFadeDuration(duration);
361 }
362 mDimLayer.show(dimLayer, dimAmount, duration);
363 }
364 } else if (mDimLayer.getLayer() != dimLayer) {
365 mDimLayer.setLayer(dimLayer);
366 }
367 if (mDimLayer.isAnimating()) {
368 if (!mService.okToDisplay()) {
369 // Jump to the end of the animation.
370 mDimLayer.show();
371 } else {
372 return mDimLayer.stepAnimation();
373 }
374 }
375 return false;
376 }
377
378 private long getDimBehindFadeDuration(long duration) {
379 TypedValue tv = new TypedValue();
380 mService.mContext.getResources().getValue(
381 com.android.internal.R.fraction.config_dimBehindFadeDuration, tv, true);
382 if (tv.type == TypedValue.TYPE_FRACTION) {
383 duration = (long)tv.getFraction(duration, duration);
384 } else if (tv.type >= TypedValue.TYPE_FIRST_INT && tv.type <= TypedValue.TYPE_LAST_INT) {
385 duration = tv.data;
386 }
387 return duration;
388 }
389
390 void clearContinueDimming() {
391 mContinueDimming = false;
392 }
393
394 void setContinueDimming() {
395 mContinueDimming = true;
396 }
397
398 boolean getContinueDimming() {
399 return mContinueDimming;
400 }
401
402 boolean isDimming() {
403 return mDimLayer.isDimming();
404 }
405
406 boolean isDimming(WindowStateAnimator winAnimator) {
407 return mDimWinAnimator == winAnimator && isDimming();
408 }
409
410 void startDimmingIfNeeded(WindowStateAnimator newWinAnimator) {
411 // Only set dim params on the highest dimmed layer.
412 // Don't turn on for an unshown surface, or for any layer but the highest dimmed layer.
413 if (newWinAnimator.mSurfaceShown && (mDimWinAnimator == null
414 || !mDimWinAnimator.mSurfaceShown
415 || mDimWinAnimator.mAnimLayer < newWinAnimator.mAnimLayer)) {
416 mDimWinAnimator = newWinAnimator;
417 if (mDimWinAnimator.mWin.mAppToken == null
418 && !mFullscreen && mStack.getDisplayContent() != null) {
419 // Dim should cover the entire screen for system windows.
420 mStack.getDisplayContent().getLogicalDisplayRect(mTmpRect);
421 mDimLayer.setBounds(mTmpRect);
422 }
423 }
424 }
425
426 void stopDimmingIfNeeded() {
427 if (!mContinueDimming && isDimming()) {
428 mDimWinAnimator = null;
429 mDimLayer.setBounds(mBounds);
430 }
431 }
432
433 void close() {
434 if (mDimLayer != null) {
435 mDimLayer.destroySurface();
436 mDimLayer = null;
437 }
438 }
439
440 void resizeWindows() {
441 final ArrayList<WindowState> resizingWindows = mService.mResizingWindows;
442 for (int activityNdx = mAppTokens.size() - 1; activityNdx >= 0; --activityNdx) {
443 final ArrayList<WindowState> windows = mAppTokens.get(activityNdx).allAppWindows;
444 for (int winNdx = windows.size() - 1; winNdx >= 0; --winNdx) {
445 final WindowState win = windows.get(winNdx);
446 if (!resizingWindows.contains(win)) {
447 if (DEBUG_RESIZE) Slog.d(TAG, "setBounds: Resizing " + win);
448 resizingWindows.add(win);
449 }
450 }
451 }
452 }
453
Wale Ogunwale6dfdfd62015-04-15 12:01:38 -0700454 boolean showForAllUsers() {
Wale Ogunwale3fcb4a82015-04-06 14:00:13 -0700455 final int tokensCount = mAppTokens.size();
Wale Ogunwale6dfdfd62015-04-15 12:01:38 -0700456 return (tokensCount != 0) && mAppTokens.get(tokensCount - 1).showForAllUsers;
Wale Ogunwale3fcb4a82015-04-06 14:00:13 -0700457 }
458
Chong Zhang09b21ef2015-09-14 10:20:21 -0700459 boolean inFreeformWorkspace() {
460 return mStack != null && mStack.mStackId == FREEFORM_WORKSPACE_STACK_ID;
461 }
462
Craig Mautner5d9c7be2013-02-15 14:02:56 -0800463 @Override
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700464 public boolean isFullscreen() {
465 return mFullscreen;
466 }
467
468 @Override
469 public DisplayInfo getDisplayInfo() {
470 return mStack.getDisplayContent().getDisplayInfo();
471 }
472
473 @Override
Craig Mautner5d9c7be2013-02-15 14:02:56 -0800474 public String toString() {
Craig Mautner83162a92015-01-26 14:43:30 -0800475 return "{taskId=" + mTaskId + " appTokens=" + mAppTokens + " mdr=" + mDeferRemoval + "}";
Craig Mautner5d9c7be2013-02-15 14:02:56 -0800476 }
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700477
478 public void printTo(String prefix, PrintWriter pw) {
479 pw.print(prefix); pw.print("taskId="); pw.print(mTaskId);
480 pw.print(prefix); pw.print("appTokens="); pw.print(mAppTokens);
481 pw.print(prefix); pw.print("mdr="); pw.println(mDeferRemoval);
482 if (mDimLayer.isDimming()) {
483 pw.print(prefix); pw.println("mDimLayer:");
484 mDimLayer.printTo(prefix + " ", pw);
485 pw.print(prefix); pw.print("mDimWinAnimator="); pw.println(mDimWinAnimator);
486 } else {
487 pw.println();
488 }
489 }
Craig Mautnerb1fd65c02013-02-05 13:34:57 -0800490}