Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package com.android.server.wm; |
| 18 | |
Wale Ogunwale | 6cae765 | 2015-12-26 07:36:26 -0800 | [diff] [blame] | 19 | import static android.app.ActivityManager.StackId; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 20 | import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING; |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 21 | import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ANIM; |
| 22 | import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_APP_TRANSITIONS; |
Robert Carr | a1eb439 | 2015-12-10 12:43:51 -0800 | [diff] [blame] | 23 | import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ADD_REMOVE; |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 24 | import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_VISIBILITY; |
| 25 | import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WINDOW_MOVEMENT; |
| 26 | import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME; |
| 27 | import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; |
Chong Zhang | f596cd5 | 2016-01-05 13:42:44 -0800 | [diff] [blame] | 28 | import static com.android.server.wm.WindowManagerService.WINDOW_REPLACEMENT_TIMEOUT_DURATION; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 29 | |
Jeff Brown | 4532e61 | 2012-04-05 14:27:12 -0700 | [diff] [blame] | 30 | import com.android.server.input.InputApplicationHandle; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 31 | import com.android.server.wm.WindowManagerService.H; |
| 32 | |
Filip Gruszczynski | a590c99 | 2015-11-25 16:45:26 -0800 | [diff] [blame] | 33 | import android.annotation.NonNull; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 34 | import android.content.pm.ActivityInfo; |
Jorim Jaggi | 0429f35 | 2015-12-22 16:29:16 +0100 | [diff] [blame] | 35 | import android.graphics.Rect; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 36 | import android.os.Message; |
| 37 | import android.os.RemoteException; |
| 38 | import android.util.Slog; |
| 39 | import android.view.IApplicationToken; |
| 40 | import android.view.View; |
| 41 | import android.view.WindowManager; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 42 | |
| 43 | import java.io.PrintWriter; |
Jorim Jaggi | 0429f35 | 2015-12-22 16:29:16 +0100 | [diff] [blame] | 44 | import java.util.ArrayDeque; |
Craig Mautner | b1fd65c0 | 2013-02-05 13:34:57 -0800 | [diff] [blame] | 45 | import java.util.ArrayList; |
| 46 | |
| 47 | class AppTokenList extends ArrayList<AppWindowToken> { |
| 48 | } |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 49 | |
| 50 | /** |
| 51 | * Version of WindowToken that is specifically for a particular application (or |
| 52 | * really activity) that is displaying windows. |
| 53 | */ |
Craig Mautner | e32c307 | 2012-03-12 15:25:35 -0700 | [diff] [blame] | 54 | class AppWindowToken extends WindowToken { |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 55 | private static final String TAG = TAG_WITH_CLASS_NAME ? "AppWindowToken" : TAG_WM; |
| 56 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 57 | // Non-null only for application tokens. |
| 58 | final IApplicationToken appToken; |
| 59 | |
| 60 | // All of the windows and child windows that are included in this |
| 61 | // application token. Note this list is NOT sorted! |
Craig Mautner | 9686833 | 2012-12-04 14:29:11 -0800 | [diff] [blame] | 62 | final WindowList allAppWindows = new WindowList(); |
Filip Gruszczynski | a590c99 | 2015-11-25 16:45:26 -0800 | [diff] [blame] | 63 | @NonNull final AppWindowAnimator mAppAnimator; |
Craig Mautner | d09cc4b | 2012-04-04 10:23:31 -0700 | [diff] [blame] | 64 | |
Dianne Hackborn | e30e02f | 2014-05-27 18:24:45 -0700 | [diff] [blame] | 65 | final boolean voiceInteraction; |
| 66 | |
Chong Zhang | db20b5f | 2015-10-23 14:01:43 -0700 | [diff] [blame] | 67 | // Whether we're performing an entering animation with a saved surface. |
| 68 | boolean mAnimatingWithSavedSurface; |
| 69 | |
Jorim Jaggi | 4846ee3 | 2016-01-07 17:39:12 +0100 | [diff] [blame] | 70 | |
Craig Mautner | 83162a9 | 2015-01-26 14:43:30 -0800 | [diff] [blame] | 71 | Task mTask; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 72 | boolean appFullscreen; |
| 73 | int requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; |
Craig Mautner | 4c5eb22 | 2013-11-18 12:59:05 -0800 | [diff] [blame] | 74 | boolean layoutConfigChanges; |
Wale Ogunwale | 6dfdfd6 | 2015-04-15 12:01:38 -0700 | [diff] [blame] | 75 | boolean showForAllUsers; |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 76 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 77 | // The input dispatching timeout for this application token in nanoseconds. |
| 78 | long inputDispatchingTimeoutNanos; |
| 79 | |
| 80 | // These are used for determining when all windows associated with |
| 81 | // an activity have been drawn, so they can be made visible together |
| 82 | // at the same time. |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 83 | // initialize so that it doesn't match mTransactionSequence which is an int. |
| 84 | long lastTransactionSequence = Long.MIN_VALUE; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 85 | int numInterestingWindows; |
| 86 | int numDrawnWindows; |
| 87 | boolean inPendingTransaction; |
| 88 | boolean allDrawn; |
Craig Mautner | 7636dfb | 2012-11-16 15:24:11 -0800 | [diff] [blame] | 89 | // Set to true when this app creates a surface while in the middle of an animation. In that |
| 90 | // case do not clear allDrawn until the animation completes. |
| 91 | boolean deferClearAllDrawn; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 92 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 93 | // Is this window's surface needed? This is almost like hidden, except |
| 94 | // it will sometimes be true a little earlier: when the token has |
| 95 | // been shown, but is still waiting for its app transition to execute |
| 96 | // before making its windows shown. |
| 97 | boolean hiddenRequested; |
| 98 | |
| 99 | // Have we told the window clients to hide themselves? |
| 100 | boolean clientHidden; |
| 101 | |
| 102 | // Last visibility state we reported to the app token. |
| 103 | boolean reportedVisible; |
| 104 | |
Dianne Hackborn | 2c84cfc | 2011-10-31 15:39:59 -0700 | [diff] [blame] | 105 | // Last drawn state we reported to the app token. |
| 106 | boolean reportedDrawn; |
| 107 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 108 | // Set to true when the token has been removed from the window mgr. |
| 109 | boolean removed; |
| 110 | |
Chong Zhang | 112eb8c | 2015-11-02 11:17:00 -0800 | [diff] [blame] | 111 | boolean appDied; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 112 | // Information about an application starting window if displayed. |
| 113 | StartingData startingData; |
| 114 | WindowState startingWindow; |
| 115 | View startingView; |
| 116 | boolean startingDisplayed; |
| 117 | boolean startingMoved; |
| 118 | boolean firstWindowDrawn; |
| 119 | |
| 120 | // Input application handle used by the input dispatcher. |
Jeff Brown | 9302c87 | 2011-07-13 22:51:29 -0700 | [diff] [blame] | 121 | final InputApplicationHandle mInputApplicationHandle; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 122 | |
Craig Mautner | 799bc1d | 2015-01-14 10:33:48 -0800 | [diff] [blame] | 123 | boolean mIsExiting; |
Craig Mautner | 9ef471f | 2014-02-07 13:11:47 -0800 | [diff] [blame] | 124 | |
Craig Mautner | bb74246 | 2014-07-07 15:28:55 -0700 | [diff] [blame] | 125 | boolean mLaunchTaskBehind; |
Craig Mautner | 8746a47 | 2014-07-24 15:12:54 -0700 | [diff] [blame] | 126 | boolean mEnteringAnimation; |
Craig Mautner | bb74246 | 2014-07-07 15:28:55 -0700 | [diff] [blame] | 127 | |
Wale Ogunwale | 6cae765 | 2015-12-26 07:36:26 -0800 | [diff] [blame] | 128 | boolean mAlwaysFocusable; |
| 129 | |
Robert Carr | e12aece | 2016-02-02 22:43:27 -0800 | [diff] [blame^] | 130 | boolean mAppStopped; |
| 131 | |
Jorim Jaggi | 0429f35 | 2015-12-22 16:29:16 +0100 | [diff] [blame] | 132 | ArrayDeque<Rect> mFrozenBounds = new ArrayDeque<>(); |
| 133 | |
Dianne Hackborn | e30e02f | 2014-05-27 18:24:45 -0700 | [diff] [blame] | 134 | AppWindowToken(WindowManagerService _service, IApplicationToken _token, |
| 135 | boolean _voiceInteraction) { |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 136 | super(_service, _token.asBinder(), |
| 137 | WindowManager.LayoutParams.TYPE_APPLICATION, true); |
| 138 | appWindowToken = this; |
| 139 | appToken = _token; |
Dianne Hackborn | e30e02f | 2014-05-27 18:24:45 -0700 | [diff] [blame] | 140 | voiceInteraction = _voiceInteraction; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 141 | mInputApplicationHandle = new InputApplicationHandle(this); |
Craig Mautner | 322e403 | 2012-07-13 13:35:20 -0700 | [diff] [blame] | 142 | mAppAnimator = new AppWindowAnimator(this); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 143 | } |
| 144 | |
| 145 | void sendAppVisibilityToClients() { |
| 146 | final int N = allAppWindows.size(); |
| 147 | for (int i=0; i<N; i++) { |
| 148 | WindowState win = allAppWindows.get(i); |
| 149 | if (win == startingWindow && clientHidden) { |
| 150 | // Don't hide the starting window. |
| 151 | continue; |
| 152 | } |
| 153 | try { |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 154 | if (DEBUG_VISIBILITY) Slog.v(TAG, |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 155 | "Setting visibility of " + win + ": " + (!clientHidden)); |
| 156 | win.mClient.dispatchAppVisibility(!clientHidden); |
| 157 | } catch (RemoteException e) { |
| 158 | } |
| 159 | } |
| 160 | } |
| 161 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 162 | void updateReportedVisibilityLocked() { |
| 163 | if (appToken == null) { |
| 164 | return; |
| 165 | } |
| 166 | |
| 167 | int numInteresting = 0; |
| 168 | int numVisible = 0; |
Dianne Hackborn | 2c84cfc | 2011-10-31 15:39:59 -0700 | [diff] [blame] | 169 | int numDrawn = 0; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 170 | boolean nowGone = true; |
| 171 | |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 172 | if (DEBUG_VISIBILITY) Slog.v(TAG, |
Craig Mautner | c8bc97e | 2012-04-02 12:54:54 -0700 | [diff] [blame] | 173 | "Update reported visibility: " + this); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 174 | final int N = allAppWindows.size(); |
| 175 | for (int i=0; i<N; i++) { |
| 176 | WindowState win = allAppWindows.get(i); |
| 177 | if (win == startingWindow || win.mAppFreezing |
| 178 | || win.mViewVisibility != View.VISIBLE |
| 179 | || win.mAttrs.type == TYPE_APPLICATION_STARTING |
| 180 | || win.mDestroying) { |
| 181 | continue; |
| 182 | } |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 183 | if (DEBUG_VISIBILITY) { |
| 184 | Slog.v(TAG, "Win " + win + ": isDrawn=" |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 185 | + win.isDrawnLw() |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 186 | + ", isAnimating=" + win.mWinAnimator.isAnimating()); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 187 | if (!win.isDrawnLw()) { |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 188 | Slog.v(TAG, "Not displayed: s=" + |
Robert Carr | e6a8351 | 2015-11-03 16:09:21 -0800 | [diff] [blame] | 189 | win.mWinAnimator.mSurfaceController |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 190 | + " pv=" + win.mPolicyVisibility |
Craig Mautner | 749a7bb | 2012-04-02 13:49:53 -0700 | [diff] [blame] | 191 | + " mDrawState=" + win.mWinAnimator.mDrawState |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 192 | + " ah=" + win.mAttachedHidden |
| 193 | + " th=" |
| 194 | + (win.mAppToken != null |
| 195 | ? win.mAppToken.hiddenRequested : false) |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 196 | + " a=" + win.mWinAnimator.mAnimating); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 197 | } |
| 198 | } |
| 199 | numInteresting++; |
| 200 | if (win.isDrawnLw()) { |
Dianne Hackborn | 2c84cfc | 2011-10-31 15:39:59 -0700 | [diff] [blame] | 201 | numDrawn++; |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 202 | if (!win.mWinAnimator.isAnimating()) { |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 203 | numVisible++; |
| 204 | } |
| 205 | nowGone = false; |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 206 | } else if (win.mWinAnimator.isAnimating()) { |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 207 | nowGone = false; |
| 208 | } |
| 209 | } |
| 210 | |
Dianne Hackborn | 2c84cfc | 2011-10-31 15:39:59 -0700 | [diff] [blame] | 211 | boolean nowDrawn = numInteresting > 0 && numDrawn >= numInteresting; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 212 | boolean nowVisible = numInteresting > 0 && numVisible >= numInteresting; |
Dianne Hackborn | 2c84cfc | 2011-10-31 15:39:59 -0700 | [diff] [blame] | 213 | if (!nowGone) { |
| 214 | // If the app is not yet gone, then it can only become visible/drawn. |
| 215 | if (!nowDrawn) { |
| 216 | nowDrawn = reportedDrawn; |
| 217 | } |
| 218 | if (!nowVisible) { |
| 219 | nowVisible = reportedVisible; |
| 220 | } |
| 221 | } |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 222 | if (DEBUG_VISIBILITY) Slog.v(TAG, "VIS " + this + ": interesting=" |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 223 | + numInteresting + " visible=" + numVisible); |
Dianne Hackborn | 2c84cfc | 2011-10-31 15:39:59 -0700 | [diff] [blame] | 224 | if (nowDrawn != reportedDrawn) { |
| 225 | if (nowDrawn) { |
| 226 | Message m = service.mH.obtainMessage( |
| 227 | H.REPORT_APPLICATION_TOKEN_DRAWN, this); |
| 228 | service.mH.sendMessage(m); |
| 229 | } |
| 230 | reportedDrawn = nowDrawn; |
| 231 | } |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 232 | if (nowVisible != reportedVisible) { |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 233 | if (DEBUG_VISIBILITY) Slog.v( |
| 234 | TAG, "Visibility changed in " + this |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 235 | + ": vis=" + nowVisible); |
| 236 | reportedVisible = nowVisible; |
| 237 | Message m = service.mH.obtainMessage( |
| 238 | H.REPORT_APPLICATION_TOKEN_WINDOWS, |
| 239 | nowVisible ? 1 : 0, |
| 240 | nowGone ? 1 : 0, |
| 241 | this); |
| 242 | service.mH.sendMessage(m); |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | WindowState findMainWindow() { |
Filip Gruszczynski | 55a309f | 2015-09-04 17:15:01 -0700 | [diff] [blame] | 247 | WindowState candidate = null; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 248 | int j = windows.size(); |
| 249 | while (j > 0) { |
| 250 | j--; |
| 251 | WindowState win = windows.get(j); |
| 252 | if (win.mAttrs.type == WindowManager.LayoutParams.TYPE_BASE_APPLICATION |
| 253 | || win.mAttrs.type == WindowManager.LayoutParams.TYPE_APPLICATION_STARTING) { |
Filip Gruszczynski | 55a309f | 2015-09-04 17:15:01 -0700 | [diff] [blame] | 254 | // In cases where there are multiple windows, we prefer the non-exiting window. This |
Sungsoo Lim | 0d3d1f8 | 2015-12-02 14:47:59 +0900 | [diff] [blame] | 255 | // happens for example when replacing windows during an activity relaunch. When |
Filip Gruszczynski | 55a309f | 2015-09-04 17:15:01 -0700 | [diff] [blame] | 256 | // constructing the animation, we want the new window, not the exiting one. |
| 257 | if (win.mExiting) { |
| 258 | candidate = win; |
| 259 | } else { |
| 260 | return win; |
| 261 | } |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 262 | } |
| 263 | } |
Filip Gruszczynski | 55a309f | 2015-09-04 17:15:01 -0700 | [diff] [blame] | 264 | return candidate; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 265 | } |
| 266 | |
Wale Ogunwale | 6cae765 | 2015-12-26 07:36:26 -0800 | [diff] [blame] | 267 | boolean windowsAreFocusable() { |
| 268 | return StackId.canReceiveKeys(mTask.mStack.mStackId) || mAlwaysFocusable; |
Wale Ogunwale | d045c82 | 2015-12-02 09:14:28 -0800 | [diff] [blame] | 269 | } |
| 270 | |
Craig Mautner | 72669d1 | 2012-12-18 17:23:54 -0800 | [diff] [blame] | 271 | boolean isVisible() { |
| 272 | final int N = allAppWindows.size(); |
Craig Mautner | 72669d1 | 2012-12-18 17:23:54 -0800 | [diff] [blame] | 273 | for (int i=0; i<N; i++) { |
| 274 | WindowState win = allAppWindows.get(i); |
Chong Zhang | db20b5f | 2015-10-23 14:01:43 -0700 | [diff] [blame] | 275 | // If we're animating with a saved surface, we're already visible. |
| 276 | // Return true so that the alpha doesn't get cleared. |
Craig Mautner | 72669d1 | 2012-12-18 17:23:54 -0800 | [diff] [blame] | 277 | if (!win.mAppFreezing |
Filip Gruszczynski | 57f76f1 | 2015-11-04 16:10:54 -0800 | [diff] [blame] | 278 | && (win.mViewVisibility == View.VISIBLE || mAnimatingWithSavedSurface |
| 279 | || (win.mWinAnimator.isAnimating() |
| 280 | && !service.mAppTransition.isTransitionSet())) |
| 281 | && !win.mDestroying |
| 282 | && win.isDrawnLw()) { |
Craig Mautner | 72669d1 | 2012-12-18 17:23:54 -0800 | [diff] [blame] | 283 | return true; |
| 284 | } |
| 285 | } |
| 286 | return false; |
| 287 | } |
| 288 | |
Craig Mautner | e3119b7 | 2015-01-20 15:02:36 -0800 | [diff] [blame] | 289 | void removeAppFromTaskLocked() { |
| 290 | mIsExiting = false; |
| 291 | removeAllWindows(); |
| 292 | |
Craig Mautner | 83162a9 | 2015-01-26 14:43:30 -0800 | [diff] [blame] | 293 | // Use local variable because removeAppToken will null out mTask. |
| 294 | final Task task = mTask; |
Craig Mautner | e3119b7 | 2015-01-20 15:02:36 -0800 | [diff] [blame] | 295 | if (task != null) { |
| 296 | if (!task.removeAppToken(this)) { |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 297 | Slog.e(TAG, "removeAppFromTaskLocked: token=" + this |
Craig Mautner | e3119b7 | 2015-01-20 15:02:36 -0800 | [diff] [blame] | 298 | + " not found."); |
| 299 | } |
| 300 | task.mStack.mExitingAppTokens.remove(this); |
| 301 | } |
| 302 | } |
| 303 | |
Chong Zhang | bfc2f8f | 2016-01-29 15:50:34 -0800 | [diff] [blame] | 304 | void setWindowsExiting(boolean exiting) { |
Chong Zhang | eb22e8e | 2016-01-20 19:52:22 -0800 | [diff] [blame] | 305 | for (int i = allAppWindows.size() - 1; i >= 0; i--) { |
| 306 | WindowState win = allAppWindows.get(i); |
Chong Zhang | 6bb8250 | 2016-02-02 14:13:48 -0800 | [diff] [blame] | 307 | // If the app already requested to remove its window, we don't modify |
| 308 | // its exiting state. Otherwise the stale window won't get removed on |
| 309 | // exit and could cause focus to be given to the wrong window. |
| 310 | if (!(win.mRemoveOnExit && win.mExiting)) { |
| 311 | win.mExiting = exiting; |
| 312 | } |
Chong Zhang | eb22e8e | 2016-01-20 19:52:22 -0800 | [diff] [blame] | 313 | } |
| 314 | } |
| 315 | |
Robert Carr | e12aece | 2016-02-02 22:43:27 -0800 | [diff] [blame^] | 316 | // Here we destroy surfaces which have been marked as eligible by the animator, taking care |
| 317 | // to ensure the client has finished with them. If the client could still be using them |
| 318 | // we will skip destruction and try again when the client has stopped. |
| 319 | void destroySurfaces() { |
| 320 | final ArrayList<WindowState> allWindows = (ArrayList<WindowState>) allAppWindows.clone(); |
| 321 | final DisplayContentList displayList = new DisplayContentList(); |
| 322 | for (int i = allWindows.size() - 1; i >= 0; i--) { |
| 323 | final WindowState win = allWindows.get(i); |
| 324 | if (!win.mDestroying) { |
| 325 | continue; |
| 326 | } |
| 327 | |
| 328 | if (!mAppStopped && !win.mClientRemoveRequested) { |
| 329 | return; |
| 330 | } |
| 331 | |
| 332 | win.destroyOrSaveSurface(); |
| 333 | if (win.mRemoveOnExit) { |
| 334 | win.mExiting = false; |
| 335 | service.removeWindowInnerLocked(win); |
| 336 | } |
| 337 | final DisplayContent displayContent = win.getDisplayContent(); |
| 338 | if (displayContent != null && !displayList.contains(displayContent)) { |
| 339 | displayList.add(displayContent); |
| 340 | } |
| 341 | win.mDestroying = false; |
| 342 | } |
| 343 | for (int i = 0; i < displayList.size(); i++) { |
| 344 | final DisplayContent displayContent = displayList.get(i); |
| 345 | service.mLayersController.assignLayersLocked(displayContent.getWindowList()); |
| 346 | displayContent.layoutNeeded = true; |
| 347 | } |
| 348 | } |
| 349 | |
| 350 | // The application has stopped, so destroy any surfaces which were keeping alive |
| 351 | // in case they were still being used. |
| 352 | void notifyAppStopped() { |
| 353 | mAppStopped = true; |
| 354 | destroySurfaces(); |
| 355 | } |
| 356 | |
Chong Zhang | bef461f | 2015-10-27 11:38:24 -0700 | [diff] [blame] | 357 | /** |
| 358 | * Checks whether we should save surfaces for this app. |
| 359 | * |
| 360 | * @return true if the surfaces should be saved, false otherwise. |
| 361 | */ |
| 362 | boolean shouldSaveSurface() { |
Chong Zhang | bfc2f8f | 2016-01-29 15:50:34 -0800 | [diff] [blame] | 363 | // We want to save surface if the app's windows are "allDrawn". |
| 364 | // (If we started entering animation early with saved surfaces, allDrawn |
| 365 | // should have been restored to true. So we'll save again in that case |
| 366 | // even if app didn't actually finish drawing.) |
| 367 | return allDrawn; |
Robert Carr | 13f7be9e | 2015-12-02 18:39:45 -0800 | [diff] [blame] | 368 | } |
| 369 | |
| 370 | boolean hasSavedSurface() { |
| 371 | for (int i = windows.size() -1; i >= 0; i--) { |
| 372 | final WindowState ws = windows.get(i); |
| 373 | if (ws.hasSavedSurface()) { |
| 374 | return true; |
| 375 | } |
Chong Zhang | bef461f | 2015-10-27 11:38:24 -0700 | [diff] [blame] | 376 | } |
| 377 | return false; |
| 378 | } |
| 379 | |
| 380 | void restoreSavedSurfaces() { |
Robert Carr | 13f7be9e | 2015-12-02 18:39:45 -0800 | [diff] [blame] | 381 | if (!hasSavedSurface()) { |
Chong Zhang | bef461f | 2015-10-27 11:38:24 -0700 | [diff] [blame] | 382 | return; |
| 383 | } |
Chong Zhang | bef461f | 2015-10-27 11:38:24 -0700 | [diff] [blame] | 384 | mAnimatingWithSavedSurface = true; |
Chong Zhang | bfc2f8f | 2016-01-29 15:50:34 -0800 | [diff] [blame] | 385 | |
| 386 | // Check if we have enough drawn windows to mark allDrawn= true. |
| 387 | int numInteresting = 0; |
| 388 | int numDrawn = 0; |
Chong Zhang | bef461f | 2015-10-27 11:38:24 -0700 | [diff] [blame] | 389 | for (int i = windows.size() - 1; i >= 0; i--) { |
Chong Zhang | bfc2f8f | 2016-01-29 15:50:34 -0800 | [diff] [blame] | 390 | WindowState w = windows.get(i); |
| 391 | w.restoreSavedSurface(); |
| 392 | if (w != startingWindow && !w.mAppDied |
| 393 | && (!mAppAnimator.freezingScreen || !w.mAppFreezing)) { |
| 394 | numInteresting++; |
| 395 | if (w.isDrawnLw()) { |
| 396 | numDrawn++; |
| 397 | } |
| 398 | } |
Chong Zhang | bef461f | 2015-10-27 11:38:24 -0700 | [diff] [blame] | 399 | } |
Chong Zhang | bfc2f8f | 2016-01-29 15:50:34 -0800 | [diff] [blame] | 400 | |
| 401 | allDrawn |= (numInteresting == numDrawn); |
| 402 | |
| 403 | if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.d(TAG, |
| 404 | "restoreSavedSurfaces: " + appWindowToken + " allDrawn=" + allDrawn); |
Chong Zhang | bef461f | 2015-10-27 11:38:24 -0700 | [diff] [blame] | 405 | } |
| 406 | |
| 407 | void destroySavedSurfaces() { |
Robert Carr | 13f7be9e | 2015-12-02 18:39:45 -0800 | [diff] [blame] | 408 | for (int i = windows.size() - 1; i >= 0; i--) { |
| 409 | WindowState win = windows.get(i); |
| 410 | win.destroySavedSurface(); |
Chong Zhang | bef461f | 2015-10-27 11:38:24 -0700 | [diff] [blame] | 411 | } |
Chong Zhang | bfc2f8f | 2016-01-29 15:50:34 -0800 | [diff] [blame] | 412 | mAnimatingWithSavedSurface = false; |
Chong Zhang | bef461f | 2015-10-27 11:38:24 -0700 | [diff] [blame] | 413 | } |
| 414 | |
Wale Ogunwale | 98e70d0 | 2014-11-10 12:12:27 -0800 | [diff] [blame] | 415 | @Override |
Craig Mautner | 7c9ee19 | 2014-08-14 16:08:26 -0700 | [diff] [blame] | 416 | void removeAllWindows() { |
Craig Mautner | 7b4655d | 2014-11-20 12:13:22 -0800 | [diff] [blame] | 417 | for (int winNdx = allAppWindows.size() - 1; winNdx >= 0; |
| 418 | // removeWindowLocked at bottom of loop may remove multiple entries from |
| 419 | // allAppWindows if the window to be removed has child windows. It also may |
| 420 | // not remove any windows from allAppWindows at all if win is exiting and |
| 421 | // currently animating away. This ensures that winNdx is monotonically decreasing |
| 422 | // and never beyond allAppWindows bounds. |
| 423 | winNdx = Math.min(winNdx - 1, allAppWindows.size() - 1)) { |
| 424 | WindowState win = allAppWindows.get(winNdx); |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 425 | if (DEBUG_WINDOW_MOVEMENT) { |
| 426 | Slog.w(TAG, "removeAllWindows: removing win=" + win); |
Wale Ogunwale | 98e70d0 | 2014-11-10 12:12:27 -0800 | [diff] [blame] | 427 | } |
| 428 | |
Wale Ogunwale | a6ab5c4 | 2015-04-24 09:00:25 -0700 | [diff] [blame] | 429 | service.removeWindowLocked(win); |
Craig Mautner | 7c9ee19 | 2014-08-14 16:08:26 -0700 | [diff] [blame] | 430 | } |
Craig Mautner | e3119b7 | 2015-01-20 15:02:36 -0800 | [diff] [blame] | 431 | allAppWindows.clear(); |
| 432 | windows.clear(); |
Craig Mautner | 7c9ee19 | 2014-08-14 16:08:26 -0700 | [diff] [blame] | 433 | } |
| 434 | |
Chong Zhang | 112eb8c | 2015-11-02 11:17:00 -0800 | [diff] [blame] | 435 | void removeAllDeadWindows() { |
| 436 | for (int winNdx = allAppWindows.size() - 1; winNdx >= 0; |
| 437 | // removeWindowLocked at bottom of loop may remove multiple entries from |
| 438 | // allAppWindows if the window to be removed has child windows. It also may |
| 439 | // not remove any windows from allAppWindows at all if win is exiting and |
| 440 | // currently animating away. This ensures that winNdx is monotonically decreasing |
| 441 | // and never beyond allAppWindows bounds. |
| 442 | winNdx = Math.min(winNdx - 1, allAppWindows.size() - 1)) { |
| 443 | WindowState win = allAppWindows.get(winNdx); |
| 444 | if (win.mAppDied) { |
Filip Gruszczynski | 0bd180d | 2015-12-07 15:43:52 -0800 | [diff] [blame] | 445 | if (DEBUG_WINDOW_MOVEMENT) { |
| 446 | Slog.w(TAG, "removeAllDeadWindows: " + win); |
Chong Zhang | 112eb8c | 2015-11-02 11:17:00 -0800 | [diff] [blame] | 447 | } |
| 448 | // Set mDestroying, we don't want any animation or delayed removal here. |
| 449 | win.mDestroying = true; |
| 450 | service.removeWindowLocked(win); |
| 451 | } |
| 452 | } |
| 453 | } |
| 454 | |
Robert Carr | a1eb439 | 2015-12-10 12:43:51 -0800 | [diff] [blame] | 455 | void setReplacingWindows(boolean animate) { |
| 456 | if (DEBUG_ADD_REMOVE) Slog.d(TAG_WM, "Marking app token " + appWindowToken |
| 457 | + " with replacing windows."); |
| 458 | |
| 459 | for (int i = allAppWindows.size() - 1; i >= 0; i--) { |
| 460 | final WindowState w = allAppWindows.get(i); |
| 461 | w.setReplacing(animate); |
| 462 | } |
| 463 | if (animate) { |
| 464 | // Set-up dummy animation so we can start treating windows associated with this |
| 465 | // token like they are in transition before the new app window is ready for us to |
| 466 | // run the real transition animation. |
| 467 | if (DEBUG_APP_TRANSITIONS) Slog.v(TAG_WM, |
| 468 | "setReplacingWindow() Setting dummy animation on: " + this); |
| 469 | mAppAnimator.setDummyAnimation(); |
| 470 | } |
| 471 | } |
| 472 | |
Robert Carr | 23fa16b | 2016-01-13 13:19:58 -0800 | [diff] [blame] | 473 | void setReplacingChildren() { |
| 474 | if (DEBUG_ADD_REMOVE) Slog.d(TAG_WM, "Marking app token " + appWindowToken |
| 475 | + " with replacing child windows."); |
| 476 | for (int i = allAppWindows.size() - 1; i >= 0; i--) { |
| 477 | final WindowState w = allAppWindows.get(i); |
| 478 | if (w.isChildWindow()) { |
| 479 | w.setReplacing(false /* animate */); |
| 480 | } |
| 481 | } |
| 482 | } |
| 483 | |
Chong Zhang | f596cd5 | 2016-01-05 13:42:44 -0800 | [diff] [blame] | 484 | void resetReplacingWindows() { |
| 485 | if (DEBUG_ADD_REMOVE) Slog.d(TAG_WM, "Resetting app token " + appWindowToken |
| 486 | + " of replacing window marks."); |
| 487 | |
| 488 | for (int i = allAppWindows.size() - 1; i >= 0; i--) { |
| 489 | final WindowState w = allAppWindows.get(i); |
| 490 | w.resetReplacing(); |
| 491 | } |
| 492 | } |
| 493 | |
Robert Carr | a1eb439 | 2015-12-10 12:43:51 -0800 | [diff] [blame] | 494 | void addWindow(WindowState w) { |
| 495 | for (int i = allAppWindows.size() - 1; i >= 0; i--) { |
| 496 | WindowState candidate = allAppWindows.get(i); |
| 497 | if (candidate.mWillReplaceWindow && candidate.mReplacingWindow == null && |
| 498 | candidate.getWindowTag().equals(w.getWindowTag().toString())) { |
| 499 | candidate.mReplacingWindow = w; |
Chong Zhang | f596cd5 | 2016-01-05 13:42:44 -0800 | [diff] [blame] | 500 | |
| 501 | // if we got a replacement window, reset the timeout to give drawing more time |
| 502 | service.mH.removeMessages(H.WINDOW_REPLACEMENT_TIMEOUT); |
| 503 | service.mH.sendMessageDelayed( |
| 504 | service.mH.obtainMessage(H.WINDOW_REPLACEMENT_TIMEOUT, this), |
| 505 | WINDOW_REPLACEMENT_TIMEOUT_DURATION); |
Robert Carr | a1eb439 | 2015-12-10 12:43:51 -0800 | [diff] [blame] | 506 | } |
| 507 | } |
| 508 | allAppWindows.add(w); |
| 509 | } |
| 510 | |
| 511 | boolean waitingForReplacement() { |
| 512 | for (int i = allAppWindows.size() -1; i >= 0; i--) { |
| 513 | WindowState candidate = allAppWindows.get(i); |
| 514 | if (candidate.mWillReplaceWindow) { |
| 515 | return true; |
| 516 | } |
| 517 | } |
| 518 | return false; |
| 519 | } |
| 520 | |
Chong Zhang | f596cd5 | 2016-01-05 13:42:44 -0800 | [diff] [blame] | 521 | void clearTimedoutReplacesLocked() { |
Robert Carr | a1eb439 | 2015-12-10 12:43:51 -0800 | [diff] [blame] | 522 | for (int i = allAppWindows.size() - 1; i >= 0; |
| 523 | // removeWindowLocked at bottom of loop may remove multiple entries from |
| 524 | // allAppWindows if the window to be removed has child windows. It also may |
| 525 | // not remove any windows from allAppWindows at all if win is exiting and |
| 526 | // currently animating away. This ensures that winNdx is monotonically decreasing |
| 527 | // and never beyond allAppWindows bounds. |
| 528 | i = Math.min(i - 1, allAppWindows.size() - 1)) { |
| 529 | WindowState candidate = allAppWindows.get(i); |
| 530 | if (candidate.mWillReplaceWindow == false) { |
| 531 | continue; |
| 532 | } |
| 533 | candidate.mWillReplaceWindow = false; |
Chong Zhang | f596cd5 | 2016-01-05 13:42:44 -0800 | [diff] [blame] | 534 | // Since the window already timed out, remove it immediately now. |
| 535 | // Use removeWindowInnerLocked() instead of removeWindowLocked(), as the latter |
| 536 | // delays removal on certain conditions, which will leave the stale window in the |
| 537 | // stack and marked mWillReplaceWindow=false, so the window will never be removed. |
| 538 | service.removeWindowInnerLocked(candidate); |
Robert Carr | a1eb439 | 2015-12-10 12:43:51 -0800 | [diff] [blame] | 539 | } |
| 540 | } |
| 541 | |
Jorim Jaggi | 0429f35 | 2015-12-22 16:29:16 +0100 | [diff] [blame] | 542 | /** |
| 543 | * Freezes the task bounds. The size of this task reported the app will be fixed to the bounds |
| 544 | * freezed by {@link Task#prepareFreezingBounds} until {@link #unfreezeBounds} gets called, even |
| 545 | * if they change in the meantime. If the bounds are already frozen, the bounds will be frozen |
| 546 | * with a queue. |
| 547 | */ |
| 548 | void freezeBounds() { |
| 549 | mFrozenBounds.offer(new Rect(mTask.mPreparedFrozenBounds)); |
| 550 | } |
| 551 | |
| 552 | /** |
| 553 | * Unfreezes the previously frozen bounds. See {@link #freezeBounds}. |
| 554 | */ |
| 555 | void unfreezeBounds() { |
| 556 | mFrozenBounds.remove(); |
Jorim Jaggi | 4846ee3 | 2016-01-07 17:39:12 +0100 | [diff] [blame] | 557 | for (int i = windows.size() - 1; i >= 0; i--) { |
| 558 | final WindowState win = windows.get(i); |
| 559 | win.mLayoutNeeded = true; |
| 560 | win.setDisplayLayoutNeeded(); |
| 561 | if (!service.mResizingWindows.contains(win)) { |
| 562 | service.mResizingWindows.add(win); |
| 563 | } |
| 564 | } |
| 565 | service.mWindowPlacerLocked.performSurfacePlacement(); |
Jorim Jaggi | 0429f35 | 2015-12-22 16:29:16 +0100 | [diff] [blame] | 566 | } |
| 567 | |
Craig Mautner | dbb7991 | 2012-03-01 18:59:14 -0800 | [diff] [blame] | 568 | @Override |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 569 | void dump(PrintWriter pw, String prefix) { |
| 570 | super.dump(pw, prefix); |
| 571 | if (appToken != null) { |
Dianne Hackborn | e30e02f | 2014-05-27 18:24:45 -0700 | [diff] [blame] | 572 | pw.print(prefix); pw.print("app=true voiceInteraction="); pw.println(voiceInteraction); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 573 | } |
| 574 | if (allAppWindows.size() > 0) { |
| 575 | pw.print(prefix); pw.print("allAppWindows="); pw.println(allAppWindows); |
| 576 | } |
Craig Mautner | 83162a9 | 2015-01-26 14:43:30 -0800 | [diff] [blame] | 577 | pw.print(prefix); pw.print("task="); pw.println(mTask); |
| 578 | pw.print(prefix); pw.print(" appFullscreen="); pw.print(appFullscreen); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 579 | pw.print(" requestedOrientation="); pw.println(requestedOrientation); |
| 580 | pw.print(prefix); pw.print("hiddenRequested="); pw.print(hiddenRequested); |
| 581 | pw.print(" clientHidden="); pw.print(clientHidden); |
Dianne Hackborn | 2c84cfc | 2011-10-31 15:39:59 -0700 | [diff] [blame] | 582 | pw.print(" reportedDrawn="); pw.print(reportedDrawn); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 583 | pw.print(" reportedVisible="); pw.println(reportedVisible); |
Craig Mautner | 5943163 | 2012-04-04 11:56:44 -0700 | [diff] [blame] | 584 | if (paused) { |
| 585 | pw.print(prefix); pw.print("paused="); pw.println(paused); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 586 | } |
| 587 | if (numInterestingWindows != 0 || numDrawnWindows != 0 |
Craig Mautner | 6fbda63 | 2012-07-03 09:26:39 -0700 | [diff] [blame] | 588 | || allDrawn || mAppAnimator.allDrawn) { |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 589 | pw.print(prefix); pw.print("numInterestingWindows="); |
| 590 | pw.print(numInterestingWindows); |
| 591 | pw.print(" numDrawnWindows="); pw.print(numDrawnWindows); |
| 592 | pw.print(" inPendingTransaction="); pw.print(inPendingTransaction); |
Craig Mautner | 6fbda63 | 2012-07-03 09:26:39 -0700 | [diff] [blame] | 593 | pw.print(" allDrawn="); pw.print(allDrawn); |
| 594 | pw.print(" (animator="); pw.print(mAppAnimator.allDrawn); |
| 595 | pw.println(")"); |
| 596 | } |
| 597 | if (inPendingTransaction) { |
| 598 | pw.print(prefix); pw.print("inPendingTransaction="); |
| 599 | pw.println(inPendingTransaction); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 600 | } |
Craig Mautner | 799bc1d | 2015-01-14 10:33:48 -0800 | [diff] [blame] | 601 | if (startingData != null || removed || firstWindowDrawn || mIsExiting) { |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 602 | pw.print(prefix); pw.print("startingData="); pw.print(startingData); |
| 603 | pw.print(" removed="); pw.print(removed); |
Craig Mautner | 3d7ca31 | 2015-01-08 10:56:00 -0800 | [diff] [blame] | 604 | pw.print(" firstWindowDrawn="); pw.print(firstWindowDrawn); |
Craig Mautner | 799bc1d | 2015-01-14 10:33:48 -0800 | [diff] [blame] | 605 | pw.print(" mIsExiting="); pw.println(mIsExiting); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 606 | } |
| 607 | if (startingWindow != null || startingView != null |
| 608 | || startingDisplayed || startingMoved) { |
| 609 | pw.print(prefix); pw.print("startingWindow="); pw.print(startingWindow); |
| 610 | pw.print(" startingView="); pw.print(startingView); |
| 611 | pw.print(" startingDisplayed="); pw.print(startingDisplayed); |
| 612 | pw.print(" startingMoved"); pw.println(startingMoved); |
| 613 | } |
Jorim Jaggi | 0429f35 | 2015-12-22 16:29:16 +0100 | [diff] [blame] | 614 | if (!mFrozenBounds.isEmpty()) { |
| 615 | pw.print(prefix); pw.print("mFrozenBounds="); pw.print(mFrozenBounds); |
| 616 | } |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 617 | } |
| 618 | |
| 619 | @Override |
| 620 | public String toString() { |
| 621 | if (stringName == null) { |
| 622 | StringBuilder sb = new StringBuilder(); |
| 623 | sb.append("AppWindowToken{"); |
| 624 | sb.append(Integer.toHexString(System.identityHashCode(this))); |
| 625 | sb.append(" token="); sb.append(token); sb.append('}'); |
| 626 | stringName = sb.toString(); |
| 627 | } |
| 628 | return stringName; |
| 629 | } |
Jeff Brown | e9bdb31 | 2012-04-05 15:30:10 -0700 | [diff] [blame] | 630 | } |