blob: 77b7f2ef1b2469ecc04372aa50936a25b33fbacf [file] [log] [blame]
Dianne Hackborn6e1eb762011-02-17 16:07:28 -08001/*
2 * Copyright (C) 2011 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
19import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
Chong Zhangbef461f2015-10-27 11:38:24 -070020import static com.android.server.wm.WindowManagerService.DEBUG_ANIM;
21import static com.android.server.wm.WindowManagerService.DEBUG_APP_TRANSITIONS;
22import static com.android.server.wm.WindowManagerService.TAG;
Dianne Hackborn6e1eb762011-02-17 16:07:28 -080023
Jeff Brown4532e612012-04-05 14:27:12 -070024import com.android.server.input.InputApplicationHandle;
Dianne Hackborn6e1eb762011-02-17 16:07:28 -080025import com.android.server.wm.WindowManagerService.H;
26
Filip Gruszczynskia590c992015-11-25 16:45:26 -080027import android.annotation.NonNull;
Dianne Hackborn6e1eb762011-02-17 16:07:28 -080028import android.content.pm.ActivityInfo;
29import android.os.Message;
30import android.os.RemoteException;
31import android.util.Slog;
32import android.view.IApplicationToken;
33import android.view.View;
34import android.view.WindowManager;
Dianne Hackborn6e1eb762011-02-17 16:07:28 -080035
36import java.io.PrintWriter;
Craig Mautnerb1fd65c02013-02-05 13:34:57 -080037import java.util.ArrayList;
38
39class AppTokenList extends ArrayList<AppWindowToken> {
40}
Dianne Hackborn6e1eb762011-02-17 16:07:28 -080041
42/**
43 * Version of WindowToken that is specifically for a particular application (or
44 * really activity) that is displaying windows.
45 */
Craig Mautnere32c3072012-03-12 15:25:35 -070046class AppWindowToken extends WindowToken {
Dianne Hackborn6e1eb762011-02-17 16:07:28 -080047 // Non-null only for application tokens.
48 final IApplicationToken appToken;
49
50 // All of the windows and child windows that are included in this
51 // application token. Note this list is NOT sorted!
Craig Mautner96868332012-12-04 14:29:11 -080052 final WindowList allAppWindows = new WindowList();
Filip Gruszczynskia590c992015-11-25 16:45:26 -080053 @NonNull final AppWindowAnimator mAppAnimator;
Craig Mautnerd09cc4b2012-04-04 10:23:31 -070054
Dianne Hackborne30e02f2014-05-27 18:24:45 -070055 final boolean voiceInteraction;
56
Chong Zhangdb20b5f2015-10-23 14:01:43 -070057 // Whether the window has a saved surface from last pause, which can be
58 // used to start an entering animation earlier.
59 boolean mHasSavedSurface;
60
61 // Whether we're performing an entering animation with a saved surface.
62 boolean mAnimatingWithSavedSurface;
63
Craig Mautner83162a92015-01-26 14:43:30 -080064 Task mTask;
Dianne Hackborn6e1eb762011-02-17 16:07:28 -080065 boolean appFullscreen;
66 int requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
Craig Mautner4c5eb222013-11-18 12:59:05 -080067 boolean layoutConfigChanges;
Wale Ogunwale6dfdfd62015-04-15 12:01:38 -070068 boolean showForAllUsers;
Craig Mautnera2c77052012-03-26 12:14:43 -070069
Dianne Hackborn6e1eb762011-02-17 16:07:28 -080070 // The input dispatching timeout for this application token in nanoseconds.
71 long inputDispatchingTimeoutNanos;
72
73 // These are used for determining when all windows associated with
74 // an activity have been drawn, so they can be made visible together
75 // at the same time.
Craig Mautner764983d2012-03-22 11:37:36 -070076 // initialize so that it doesn't match mTransactionSequence which is an int.
77 long lastTransactionSequence = Long.MIN_VALUE;
Dianne Hackborn6e1eb762011-02-17 16:07:28 -080078 int numInterestingWindows;
79 int numDrawnWindows;
80 boolean inPendingTransaction;
81 boolean allDrawn;
Craig Mautner7636dfb2012-11-16 15:24:11 -080082 // Set to true when this app creates a surface while in the middle of an animation. In that
83 // case do not clear allDrawn until the animation completes.
84 boolean deferClearAllDrawn;
Dianne Hackborn6e1eb762011-02-17 16:07:28 -080085
Dianne Hackborn6e1eb762011-02-17 16:07:28 -080086 // Is this window's surface needed? This is almost like hidden, except
87 // it will sometimes be true a little earlier: when the token has
88 // been shown, but is still waiting for its app transition to execute
89 // before making its windows shown.
90 boolean hiddenRequested;
91
92 // Have we told the window clients to hide themselves?
93 boolean clientHidden;
94
95 // Last visibility state we reported to the app token.
96 boolean reportedVisible;
97
Dianne Hackborn2c84cfc2011-10-31 15:39:59 -070098 // Last drawn state we reported to the app token.
99 boolean reportedDrawn;
100
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800101 // Set to true when the token has been removed from the window mgr.
102 boolean removed;
103
Chong Zhang112eb8c2015-11-02 11:17:00 -0800104 boolean appDied;
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800105 // Information about an application starting window if displayed.
106 StartingData startingData;
107 WindowState startingWindow;
108 View startingView;
109 boolean startingDisplayed;
110 boolean startingMoved;
111 boolean firstWindowDrawn;
112
113 // Input application handle used by the input dispatcher.
Jeff Brown9302c872011-07-13 22:51:29 -0700114 final InputApplicationHandle mInputApplicationHandle;
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800115
Craig Mautner799bc1d2015-01-14 10:33:48 -0800116 boolean mIsExiting;
Craig Mautner9ef471f2014-02-07 13:11:47 -0800117
Craig Mautnerbb742462014-07-07 15:28:55 -0700118 boolean mLaunchTaskBehind;
Craig Mautner8746a472014-07-24 15:12:54 -0700119 boolean mEnteringAnimation;
Craig Mautnerbb742462014-07-07 15:28:55 -0700120
Wale Ogunwale61b009e2015-09-16 15:43:05 -0700121 // True if the windows associated with this token should be cropped to their stack bounds.
122 boolean mCropWindowsToStack;
123
Filip Gruszczynski76cc44f2015-09-03 16:03:10 -0700124 // This application will have its window replaced due to relaunch. This allows window manager
125 // to differentiate between simple removal of a window and replacement. In the latter case it
126 // will preserve the old window until the new one is drawn.
Filip Gruszczynskib6e66622015-10-25 16:05:27 -0700127 boolean mWillReplaceWindow;
Filip Gruszczynski55a309f2015-09-04 17:15:01 -0700128 // If true, the replaced window was already requested to be removed.
129 boolean mReplacingRemoveRequested;
Jorim Jaggi030979c2015-11-20 15:14:43 -0800130 // Whether the replacement of the window should trigger app transition animation.
131 boolean mAnimateReplacingWindow;
Filip Gruszczynskib6e66622015-10-25 16:05:27 -0700132 // If not null, the window that will be used to replace the old one. This is being set when
133 // the window is added and unset when this window reports its first draw.
134 WindowState mReplacingWindow;
Filip Gruszczynski78a08ee2015-11-08 18:04:32 -0800135 // Whether the new window has replaced the old one, so the old one can be removed without
136 // blinking.
137 boolean mHasReplacedWindow;
Filip Gruszczynski76cc44f2015-09-03 16:03:10 -0700138
Dianne Hackborne30e02f2014-05-27 18:24:45 -0700139 AppWindowToken(WindowManagerService _service, IApplicationToken _token,
140 boolean _voiceInteraction) {
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800141 super(_service, _token.asBinder(),
142 WindowManager.LayoutParams.TYPE_APPLICATION, true);
143 appWindowToken = this;
144 appToken = _token;
Dianne Hackborne30e02f2014-05-27 18:24:45 -0700145 voiceInteraction = _voiceInteraction;
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800146 mInputApplicationHandle = new InputApplicationHandle(this);
Craig Mautner322e4032012-07-13 13:35:20 -0700147 mAppAnimator = new AppWindowAnimator(this);
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800148 }
149
150 void sendAppVisibilityToClients() {
151 final int N = allAppWindows.size();
152 for (int i=0; i<N; i++) {
153 WindowState win = allAppWindows.get(i);
154 if (win == startingWindow && clientHidden) {
155 // Don't hide the starting window.
156 continue;
157 }
158 try {
159 if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG,
160 "Setting visibility of " + win + ": " + (!clientHidden));
161 win.mClient.dispatchAppVisibility(!clientHidden);
162 } catch (RemoteException e) {
163 }
164 }
165 }
166
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800167 void updateReportedVisibilityLocked() {
168 if (appToken == null) {
169 return;
170 }
171
172 int numInteresting = 0;
173 int numVisible = 0;
Dianne Hackborn2c84cfc2011-10-31 15:39:59 -0700174 int numDrawn = 0;
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800175 boolean nowGone = true;
176
Craig Mautnerc8bc97e2012-04-02 12:54:54 -0700177 if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG,
178 "Update reported visibility: " + this);
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800179 final int N = allAppWindows.size();
180 for (int i=0; i<N; i++) {
181 WindowState win = allAppWindows.get(i);
182 if (win == startingWindow || win.mAppFreezing
183 || win.mViewVisibility != View.VISIBLE
184 || win.mAttrs.type == TYPE_APPLICATION_STARTING
185 || win.mDestroying) {
186 continue;
187 }
188 if (WindowManagerService.DEBUG_VISIBILITY) {
189 Slog.v(WindowManagerService.TAG, "Win " + win + ": isDrawn="
190 + win.isDrawnLw()
Craig Mautnera2c77052012-03-26 12:14:43 -0700191 + ", isAnimating=" + win.mWinAnimator.isAnimating());
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800192 if (!win.isDrawnLw()) {
Robert Carre6a83512015-11-03 16:09:21 -0800193 Slog.v(WindowManagerService.TAG, "Not displayed: s=" +
194 win.mWinAnimator.mSurfaceController
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800195 + " pv=" + win.mPolicyVisibility
Craig Mautner749a7bb2012-04-02 13:49:53 -0700196 + " mDrawState=" + win.mWinAnimator.mDrawState
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800197 + " ah=" + win.mAttachedHidden
198 + " th="
199 + (win.mAppToken != null
200 ? win.mAppToken.hiddenRequested : false)
Craig Mautnera2c77052012-03-26 12:14:43 -0700201 + " a=" + win.mWinAnimator.mAnimating);
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800202 }
203 }
204 numInteresting++;
205 if (win.isDrawnLw()) {
Dianne Hackborn2c84cfc2011-10-31 15:39:59 -0700206 numDrawn++;
Craig Mautnera2c77052012-03-26 12:14:43 -0700207 if (!win.mWinAnimator.isAnimating()) {
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800208 numVisible++;
209 }
210 nowGone = false;
Craig Mautnera2c77052012-03-26 12:14:43 -0700211 } else if (win.mWinAnimator.isAnimating()) {
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800212 nowGone = false;
213 }
214 }
215
Dianne Hackborn2c84cfc2011-10-31 15:39:59 -0700216 boolean nowDrawn = numInteresting > 0 && numDrawn >= numInteresting;
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800217 boolean nowVisible = numInteresting > 0 && numVisible >= numInteresting;
Dianne Hackborn2c84cfc2011-10-31 15:39:59 -0700218 if (!nowGone) {
219 // If the app is not yet gone, then it can only become visible/drawn.
220 if (!nowDrawn) {
221 nowDrawn = reportedDrawn;
222 }
223 if (!nowVisible) {
224 nowVisible = reportedVisible;
225 }
226 }
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800227 if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG, "VIS " + this + ": interesting="
228 + numInteresting + " visible=" + numVisible);
Dianne Hackborn2c84cfc2011-10-31 15:39:59 -0700229 if (nowDrawn != reportedDrawn) {
230 if (nowDrawn) {
231 Message m = service.mH.obtainMessage(
232 H.REPORT_APPLICATION_TOKEN_DRAWN, this);
233 service.mH.sendMessage(m);
234 }
235 reportedDrawn = nowDrawn;
236 }
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800237 if (nowVisible != reportedVisible) {
238 if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(
239 WindowManagerService.TAG, "Visibility changed in " + this
240 + ": vis=" + nowVisible);
241 reportedVisible = nowVisible;
242 Message m = service.mH.obtainMessage(
243 H.REPORT_APPLICATION_TOKEN_WINDOWS,
244 nowVisible ? 1 : 0,
245 nowGone ? 1 : 0,
246 this);
247 service.mH.sendMessage(m);
248 }
249 }
250
251 WindowState findMainWindow() {
Filip Gruszczynski55a309f2015-09-04 17:15:01 -0700252 WindowState candidate = null;
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800253 int j = windows.size();
254 while (j > 0) {
255 j--;
256 WindowState win = windows.get(j);
257 if (win.mAttrs.type == WindowManager.LayoutParams.TYPE_BASE_APPLICATION
258 || win.mAttrs.type == WindowManager.LayoutParams.TYPE_APPLICATION_STARTING) {
Filip Gruszczynski55a309f2015-09-04 17:15:01 -0700259 // In cases where there are multiple windows, we prefer the non-exiting window. This
260 // happens for example when when replacing windows during an activity relaunch. When
261 // constructing the animation, we want the new window, not the exiting one.
262 if (win.mExiting) {
263 candidate = win;
264 } else {
265 return win;
266 }
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800267 }
268 }
Filip Gruszczynski55a309f2015-09-04 17:15:01 -0700269 return candidate;
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800270 }
271
Wale Ogunwaled045c822015-12-02 09:14:28 -0800272 boolean stackCanReceiveKeys() {
273 return (windows.size() > 0) ? windows.get(windows.size() - 1).stackCanReceiveKeys() : false;
274 }
275
Craig Mautner72669d12012-12-18 17:23:54 -0800276 boolean isVisible() {
277 final int N = allAppWindows.size();
Craig Mautner72669d12012-12-18 17:23:54 -0800278 for (int i=0; i<N; i++) {
279 WindowState win = allAppWindows.get(i);
Chong Zhangdb20b5f2015-10-23 14:01:43 -0700280 // If we're animating with a saved surface, we're already visible.
281 // Return true so that the alpha doesn't get cleared.
Craig Mautner72669d12012-12-18 17:23:54 -0800282 if (!win.mAppFreezing
Filip Gruszczynski57f76f12015-11-04 16:10:54 -0800283 && (win.mViewVisibility == View.VISIBLE || mAnimatingWithSavedSurface
284 || (win.mWinAnimator.isAnimating()
285 && !service.mAppTransition.isTransitionSet()))
286 && !win.mDestroying
287 && win.isDrawnLw()) {
Craig Mautner72669d12012-12-18 17:23:54 -0800288 return true;
289 }
290 }
291 return false;
292 }
293
Craig Mautnere3119b72015-01-20 15:02:36 -0800294 void removeAppFromTaskLocked() {
295 mIsExiting = false;
296 removeAllWindows();
297
Craig Mautner83162a92015-01-26 14:43:30 -0800298 // Use local variable because removeAppToken will null out mTask.
299 final Task task = mTask;
Craig Mautnere3119b72015-01-20 15:02:36 -0800300 if (task != null) {
301 if (!task.removeAppToken(this)) {
302 Slog.e(WindowManagerService.TAG, "removeAppFromTaskLocked: token=" + this
303 + " not found.");
304 }
305 task.mStack.mExitingAppTokens.remove(this);
306 }
307 }
308
Chong Zhangbef461f2015-10-27 11:38:24 -0700309 /**
310 * Checks whether we should save surfaces for this app.
311 *
312 * @return true if the surfaces should be saved, false otherwise.
313 */
314 boolean shouldSaveSurface() {
315 // We want to save surface if the app's windows are "allDrawn", or if we're
316 // currently animating with save surfaces. (If the app didn't even finish
317 // drawing when the user exits, but we have a saved surface from last time,
318 // we still want to keep that surface.)
319 mHasSavedSurface = allDrawn || mAnimatingWithSavedSurface;
320 if (mHasSavedSurface) {
321 if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG,
322 "Saving surface: " + this);
323 return true;
324 }
325 return false;
326 }
327
328 void restoreSavedSurfaces() {
329 if (!mHasSavedSurface) {
330 return;
331 }
332
333 if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG,
334 "Restoring saved surfaces: " + this + ", allDrawn=" + allDrawn);
335
336 mHasSavedSurface = false;
337 mAnimatingWithSavedSurface = true;
338 for (int i = windows.size() - 1; i >= 0; i--) {
339 WindowState ws = windows.get(i);
340 ws.mWinAnimator.mDrawState = WindowStateAnimator.READY_TO_SHOW;
341 }
342 }
343
344 void destroySavedSurfaces() {
345 if (mHasSavedSurface) {
346 if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG,
347 "Destroying saved surface: " + this);
348 for (int i = windows.size() - 1; i >= 0; i--) {
349 final WindowState win = windows.get(i);
350 win.mWinAnimator.destroySurfaceLocked();
351 }
352 }
353 }
354
Wale Ogunwale98e70d02014-11-10 12:12:27 -0800355 @Override
Craig Mautner7c9ee192014-08-14 16:08:26 -0700356 void removeAllWindows() {
Craig Mautner7b4655d2014-11-20 12:13:22 -0800357 for (int winNdx = allAppWindows.size() - 1; winNdx >= 0;
358 // removeWindowLocked at bottom of loop may remove multiple entries from
359 // allAppWindows if the window to be removed has child windows. It also may
360 // not remove any windows from allAppWindows at all if win is exiting and
361 // currently animating away. This ensures that winNdx is monotonically decreasing
362 // and never beyond allAppWindows bounds.
363 winNdx = Math.min(winNdx - 1, allAppWindows.size() - 1)) {
364 WindowState win = allAppWindows.get(winNdx);
Wale Ogunwale98e70d02014-11-10 12:12:27 -0800365 if (WindowManagerService.DEBUG_WINDOW_MOVEMENT) {
366 Slog.w(WindowManagerService.TAG, "removeAllWindows: removing win=" + win);
367 }
368
Wale Ogunwalea6ab5c42015-04-24 09:00:25 -0700369 service.removeWindowLocked(win);
Craig Mautner7c9ee192014-08-14 16:08:26 -0700370 }
Craig Mautnere3119b72015-01-20 15:02:36 -0800371 allAppWindows.clear();
372 windows.clear();
Craig Mautner7c9ee192014-08-14 16:08:26 -0700373 }
374
Chong Zhang112eb8c2015-11-02 11:17:00 -0800375 void removeAllDeadWindows() {
376 for (int winNdx = allAppWindows.size() - 1; winNdx >= 0;
377 // removeWindowLocked at bottom of loop may remove multiple entries from
378 // allAppWindows if the window to be removed has child windows. It also may
379 // not remove any windows from allAppWindows at all if win is exiting and
380 // currently animating away. This ensures that winNdx is monotonically decreasing
381 // and never beyond allAppWindows bounds.
382 winNdx = Math.min(winNdx - 1, allAppWindows.size() - 1)) {
383 WindowState win = allAppWindows.get(winNdx);
384 if (win.mAppDied) {
385 if (WindowManagerService.DEBUG_WINDOW_MOVEMENT) {
386 Slog.w(WindowManagerService.TAG, "removeAllDeadWindows: " + win);
387 }
388 // Set mDestroying, we don't want any animation or delayed removal here.
389 win.mDestroying = true;
390 service.removeWindowLocked(win);
391 }
392 }
393 }
394
Craig Mautnerdbb79912012-03-01 18:59:14 -0800395 @Override
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800396 void dump(PrintWriter pw, String prefix) {
397 super.dump(pw, prefix);
398 if (appToken != null) {
Dianne Hackborne30e02f2014-05-27 18:24:45 -0700399 pw.print(prefix); pw.print("app=true voiceInteraction="); pw.println(voiceInteraction);
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800400 }
401 if (allAppWindows.size() > 0) {
402 pw.print(prefix); pw.print("allAppWindows="); pw.println(allAppWindows);
403 }
Craig Mautner83162a92015-01-26 14:43:30 -0800404 pw.print(prefix); pw.print("task="); pw.println(mTask);
405 pw.print(prefix); pw.print(" appFullscreen="); pw.print(appFullscreen);
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800406 pw.print(" requestedOrientation="); pw.println(requestedOrientation);
407 pw.print(prefix); pw.print("hiddenRequested="); pw.print(hiddenRequested);
408 pw.print(" clientHidden="); pw.print(clientHidden);
Dianne Hackborn2c84cfc2011-10-31 15:39:59 -0700409 pw.print(" reportedDrawn="); pw.print(reportedDrawn);
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800410 pw.print(" reportedVisible="); pw.println(reportedVisible);
Craig Mautner59431632012-04-04 11:56:44 -0700411 if (paused) {
412 pw.print(prefix); pw.print("paused="); pw.println(paused);
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800413 }
414 if (numInterestingWindows != 0 || numDrawnWindows != 0
Craig Mautner6fbda632012-07-03 09:26:39 -0700415 || allDrawn || mAppAnimator.allDrawn) {
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800416 pw.print(prefix); pw.print("numInterestingWindows=");
417 pw.print(numInterestingWindows);
418 pw.print(" numDrawnWindows="); pw.print(numDrawnWindows);
419 pw.print(" inPendingTransaction="); pw.print(inPendingTransaction);
Craig Mautner6fbda632012-07-03 09:26:39 -0700420 pw.print(" allDrawn="); pw.print(allDrawn);
421 pw.print(" (animator="); pw.print(mAppAnimator.allDrawn);
422 pw.println(")");
423 }
424 if (inPendingTransaction) {
425 pw.print(prefix); pw.print("inPendingTransaction=");
426 pw.println(inPendingTransaction);
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800427 }
Craig Mautner799bc1d2015-01-14 10:33:48 -0800428 if (startingData != null || removed || firstWindowDrawn || mIsExiting) {
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800429 pw.print(prefix); pw.print("startingData="); pw.print(startingData);
430 pw.print(" removed="); pw.print(removed);
Craig Mautner3d7ca312015-01-08 10:56:00 -0800431 pw.print(" firstWindowDrawn="); pw.print(firstWindowDrawn);
Craig Mautner799bc1d2015-01-14 10:33:48 -0800432 pw.print(" mIsExiting="); pw.println(mIsExiting);
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800433 }
434 if (startingWindow != null || startingView != null
435 || startingDisplayed || startingMoved) {
436 pw.print(prefix); pw.print("startingWindow="); pw.print(startingWindow);
437 pw.print(" startingView="); pw.print(startingView);
438 pw.print(" startingDisplayed="); pw.print(startingDisplayed);
439 pw.print(" startingMoved"); pw.println(startingMoved);
440 }
Dianne Hackborn6e1eb762011-02-17 16:07:28 -0800441 }
442
443 @Override
444 public String toString() {
445 if (stringName == null) {
446 StringBuilder sb = new StringBuilder();
447 sb.append("AppWindowToken{");
448 sb.append(Integer.toHexString(System.identityHashCode(this)));
449 sb.append(" token="); sb.append(token); sb.append('}');
450 stringName = sb.toString();
451 }
452 return stringName;
453 }
Jeff Browne9bdb312012-04-05 15:30:10 -0700454}