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 | |
| 19 | import static android.view.WindowManager.LayoutParams.FIRST_SUB_WINDOW; |
| 20 | import static android.view.WindowManager.LayoutParams.FLAG_COMPATIBLE_WINDOW; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 21 | import static android.view.WindowManager.LayoutParams.LAST_SUB_WINDOW; |
Dianne Hackborn | 1c5383c | 2013-04-15 15:07:21 -0700 | [diff] [blame] | 22 | import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_NO_MOVE_ANIMATION; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 23 | import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD; |
| 24 | import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD_DIALOG; |
Craig Mautner | e855214 | 2012-11-07 13:55:47 -0800 | [diff] [blame] | 25 | import static android.view.WindowManager.LayoutParams.TYPE_KEYGUARD; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 26 | import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER; |
| 27 | |
Dianne Hackborn | c229302 | 2013-02-06 23:14:49 -0800 | [diff] [blame] | 28 | import android.app.AppOpsManager; |
Dianne Hackborn | e3f23a3 | 2013-03-01 13:25:35 -0800 | [diff] [blame] | 29 | import android.os.RemoteCallbackList; |
Dianne Hackborn | a57c695 | 2013-03-29 14:46:40 -0700 | [diff] [blame] | 30 | import android.util.TimeUtils; |
Dianne Hackborn | e3f23a3 | 2013-03-01 13:25:35 -0800 | [diff] [blame] | 31 | import android.view.IWindowFocusObserver; |
| 32 | import android.view.IWindowId; |
Jeff Brown | 4532e61 | 2012-04-05 14:27:12 -0700 | [diff] [blame] | 33 | import com.android.server.input.InputWindowHandle; |
| 34 | |
Craig Mautner | e7ae250 | 2012-03-26 17:11:19 -0700 | [diff] [blame] | 35 | import android.content.Context; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 36 | import android.content.res.Configuration; |
| 37 | import android.graphics.Matrix; |
| 38 | import android.graphics.PixelFormat; |
| 39 | import android.graphics.Rect; |
Dianne Hackborn | d040edb | 2011-08-31 12:47:58 -0700 | [diff] [blame] | 40 | import android.graphics.RectF; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 41 | import android.graphics.Region; |
| 42 | import android.os.IBinder; |
| 43 | import android.os.RemoteException; |
Craig Mautner | 9dc52bc | 2012-08-06 14:15:42 -0700 | [diff] [blame] | 44 | import android.os.UserHandle; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 45 | import android.util.Slog; |
Craig Mautner | 59c0097 | 2012-07-30 12:10:24 -0700 | [diff] [blame] | 46 | import android.view.DisplayInfo; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 47 | import android.view.Gravity; |
| 48 | import android.view.IApplicationToken; |
| 49 | import android.view.IWindow; |
| 50 | import android.view.InputChannel; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 51 | import android.view.View; |
| 52 | import android.view.ViewTreeObserver; |
| 53 | import android.view.WindowManager; |
| 54 | import android.view.WindowManagerPolicy; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 55 | |
| 56 | import java.io.PrintWriter; |
| 57 | import java.util.ArrayList; |
| 58 | |
Craig Mautner | 59c0097 | 2012-07-30 12:10:24 -0700 | [diff] [blame] | 59 | class WindowList extends ArrayList<WindowState> { |
| 60 | } |
| 61 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 62 | /** |
| 63 | * A window in the window manager. |
| 64 | */ |
Craig Mautner | e32c307 | 2012-03-12 15:25:35 -0700 | [diff] [blame] | 65 | final class WindowState implements WindowManagerPolicy.WindowState { |
Craig Mautner | d87946b | 2012-03-29 18:00:19 -0700 | [diff] [blame] | 66 | static final String TAG = "WindowState"; |
Craig Mautner | 164d4bb | 2012-11-26 13:51:23 -0800 | [diff] [blame] | 67 | |
Dianne Hackborn | 5fd2169 | 2011-06-07 14:09:47 -0700 | [diff] [blame] | 68 | static final boolean DEBUG_VISIBILITY = WindowManagerService.DEBUG_VISIBILITY; |
| 69 | static final boolean SHOW_TRANSACTIONS = WindowManagerService.SHOW_TRANSACTIONS; |
Dianne Hackborn | 3699174 | 2011-10-11 21:35:26 -0700 | [diff] [blame] | 70 | static final boolean SHOW_LIGHT_TRANSACTIONS = WindowManagerService.SHOW_LIGHT_TRANSACTIONS; |
Dianne Hackborn | 5fd2169 | 2011-06-07 14:09:47 -0700 | [diff] [blame] | 71 | static final boolean SHOW_SURFACE_ALLOC = WindowManagerService.SHOW_SURFACE_ALLOC; |
| 72 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 73 | final WindowManagerService mService; |
Craig Mautner | e7ae250 | 2012-03-26 17:11:19 -0700 | [diff] [blame] | 74 | final WindowManagerPolicy mPolicy; |
| 75 | final Context mContext; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 76 | final Session mSession; |
| 77 | final IWindow mClient; |
Dianne Hackborn | c229302 | 2013-02-06 23:14:49 -0800 | [diff] [blame] | 78 | final int mAppOp; |
| 79 | // UserId and appId of the owner. Don't display windows of non-current user. |
| 80 | final int mOwnerUid; |
Dianne Hackborn | e3f23a3 | 2013-03-01 13:25:35 -0800 | [diff] [blame] | 81 | final IWindowId mWindowId; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 82 | WindowToken mToken; |
| 83 | WindowToken mRootToken; |
| 84 | AppWindowToken mAppToken; |
| 85 | AppWindowToken mTargetAppToken; |
Craig Mautner | d09cc4b | 2012-04-04 10:23:31 -0700 | [diff] [blame] | 86 | |
| 87 | // mAttrs.flags is tested in animation without being locked. If the bits tested are ever |
| 88 | // modified they will need to be locked. |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 89 | final WindowManager.LayoutParams mAttrs = new WindowManager.LayoutParams(); |
| 90 | final DeathRecipient mDeathRecipient; |
| 91 | final WindowState mAttachedWindow; |
Craig Mautner | 7b1aa77 | 2012-11-30 16:14:45 -0800 | [diff] [blame] | 92 | final WindowList mChildWindows = new WindowList(); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 93 | final int mBaseLayer; |
| 94 | final int mSubLayer; |
| 95 | final boolean mLayoutAttached; |
| 96 | final boolean mIsImWindow; |
| 97 | final boolean mIsWallpaper; |
| 98 | final boolean mIsFloatingLayer; |
Dianne Hackborn | 9a230e0 | 2011-10-06 11:51:27 -0700 | [diff] [blame] | 99 | int mSeq; |
Dianne Hackborn | 5fd2169 | 2011-06-07 14:09:47 -0700 | [diff] [blame] | 100 | boolean mEnforceSizeCompat; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 101 | int mViewVisibility; |
Dianne Hackborn | 9a230e0 | 2011-10-06 11:51:27 -0700 | [diff] [blame] | 102 | int mSystemUiVisibility; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 103 | boolean mPolicyVisibility = true; |
| 104 | boolean mPolicyVisibilityAfterAnim = true; |
Dianne Hackborn | b6b23ec | 2013-02-11 19:29:06 -0800 | [diff] [blame] | 105 | boolean mAppOpVisibility = true; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 106 | boolean mAppFreezing; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 107 | boolean mAttachedHidden; // is our parent window hidden? |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 108 | boolean mWallpaperVisible; // for wallpaper, what was last vis report? |
Dianne Hackborn | ffb3d93 | 2011-05-17 17:44:51 -0700 | [diff] [blame] | 109 | |
Dianne Hackborn | e3f23a3 | 2013-03-01 13:25:35 -0800 | [diff] [blame] | 110 | RemoteCallbackList<IWindowFocusObserver> mFocusCallbacks; |
| 111 | |
Dianne Hackborn | ffb3d93 | 2011-05-17 17:44:51 -0700 | [diff] [blame] | 112 | /** |
| 113 | * The window size that was requested by the application. These are in |
| 114 | * the application's coordinate space (without compatibility scale applied). |
| 115 | */ |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 116 | int mRequestedWidth; |
| 117 | int mRequestedHeight; |
Dianne Hackborn | 1743b64 | 2012-03-12 17:04:43 -0700 | [diff] [blame] | 118 | int mLastRequestedWidth; |
| 119 | int mLastRequestedHeight; |
Dianne Hackborn | ffb3d93 | 2011-05-17 17:44:51 -0700 | [diff] [blame] | 120 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 121 | int mLayer; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 122 | boolean mHaveFrame; |
| 123 | boolean mObscured; |
| 124 | boolean mTurnOnScreen; |
| 125 | |
| 126 | int mLayoutSeq = -1; |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 127 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 128 | Configuration mConfiguration = null; |
Craig Mautner | e855214 | 2012-11-07 13:55:47 -0800 | [diff] [blame] | 129 | // Sticky answer to isConfigChanged(), remains true until new Configuration is assigned. |
| 130 | // Used only on {@link #TYPE_KEYGUARD}. |
| 131 | private boolean mConfigHasChanged; |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 132 | |
Dianne Hackborn | ffb3d93 | 2011-05-17 17:44:51 -0700 | [diff] [blame] | 133 | /** |
| 134 | * Actual frame shown on-screen (may be modified by animation). These |
| 135 | * are in the screen's coordinate space (WITH the compatibility scale |
| 136 | * applied). |
| 137 | */ |
Dianne Hackborn | d040edb | 2011-08-31 12:47:58 -0700 | [diff] [blame] | 138 | final RectF mShownFrame = new RectF(); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 139 | |
| 140 | /** |
Dianne Hackborn | ffb3d93 | 2011-05-17 17:44:51 -0700 | [diff] [blame] | 141 | * Insets that determine the actually visible area. These are in the application's |
| 142 | * coordinate space (without compatibility scale applied). |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 143 | */ |
| 144 | final Rect mVisibleInsets = new Rect(); |
| 145 | final Rect mLastVisibleInsets = new Rect(); |
| 146 | boolean mVisibleInsetsChanged; |
| 147 | |
| 148 | /** |
Dianne Hackborn | 5c58de3 | 2012-04-28 19:52:37 -0700 | [diff] [blame] | 149 | * Insets that are covered by system windows (such as the status bar) and |
| 150 | * transient docking windows (such as the IME). These are in the application's |
Dianne Hackborn | ffb3d93 | 2011-05-17 17:44:51 -0700 | [diff] [blame] | 151 | * coordinate space (without compatibility scale applied). |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 152 | */ |
| 153 | final Rect mContentInsets = new Rect(); |
| 154 | final Rect mLastContentInsets = new Rect(); |
| 155 | boolean mContentInsetsChanged; |
| 156 | |
| 157 | /** |
Dianne Hackborn | c4aad01 | 2013-02-22 15:05:25 -0800 | [diff] [blame] | 158 | * Insets that determine the area covered by the display overscan region. These are in the |
| 159 | * application's coordinate space (without compatibility scale applied). |
| 160 | */ |
| 161 | final Rect mOverscanInsets = new Rect(); |
| 162 | final Rect mLastOverscanInsets = new Rect(); |
| 163 | boolean mOverscanInsetsChanged; |
| 164 | |
| 165 | /** |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 166 | * Set to true if we are waiting for this window to receive its |
| 167 | * given internal insets before laying out other windows based on it. |
| 168 | */ |
| 169 | boolean mGivenInsetsPending; |
| 170 | |
| 171 | /** |
| 172 | * These are the content insets that were given during layout for |
| 173 | * this window, to be applied to windows behind it. |
| 174 | */ |
| 175 | final Rect mGivenContentInsets = new Rect(); |
| 176 | |
| 177 | /** |
| 178 | * These are the visible insets that were given during layout for |
| 179 | * this window, to be applied to windows behind it. |
| 180 | */ |
| 181 | final Rect mGivenVisibleInsets = new Rect(); |
| 182 | |
| 183 | /** |
| 184 | * This is the given touchable area relative to the window frame, or null if none. |
| 185 | */ |
| 186 | final Region mGivenTouchableRegion = new Region(); |
| 187 | |
| 188 | /** |
| 189 | * Flag indicating whether the touchable region should be adjusted by |
| 190 | * the visible insets; if false the area outside the visible insets is |
| 191 | * NOT touchable, so we must use those to adjust the frame during hit |
| 192 | * tests. |
| 193 | */ |
| 194 | int mTouchableInsets = ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_FRAME; |
| 195 | |
Dianne Hackborn | 85afd1b | 2012-05-13 13:31:06 -0700 | [diff] [blame] | 196 | /** |
| 197 | * This is rectangle of the window's surface that is not covered by |
| 198 | * system decorations. |
| 199 | */ |
| 200 | final Rect mSystemDecorRect = new Rect(); |
| 201 | final Rect mLastSystemDecorRect = new Rect(); |
| 202 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 203 | // Current transformation being applied. |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 204 | float mGlobalScale=1; |
Dianne Hackborn | ffb3d93 | 2011-05-17 17:44:51 -0700 | [diff] [blame] | 205 | float mInvGlobalScale=1; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 206 | float mHScale=1, mVScale=1; |
| 207 | float mLastHScale=1, mLastVScale=1; |
| 208 | final Matrix mTmpMatrix = new Matrix(); |
| 209 | |
Dianne Hackborn | ffb3d93 | 2011-05-17 17:44:51 -0700 | [diff] [blame] | 210 | // "Real" frame that the application sees, in display coordinate space. |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 211 | final Rect mFrame = new Rect(); |
| 212 | final Rect mLastFrame = new Rect(); |
Dianne Hackborn | ffb3d93 | 2011-05-17 17:44:51 -0700 | [diff] [blame] | 213 | // Frame that is scaled to the application's coordinate space when in |
| 214 | // screen size compatibility mode. |
| 215 | final Rect mCompatFrame = new Rect(); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 216 | |
| 217 | final Rect mContainingFrame = new Rect(); |
| 218 | final Rect mDisplayFrame = new Rect(); |
Dianne Hackborn | c4aad01 | 2013-02-22 15:05:25 -0800 | [diff] [blame] | 219 | final Rect mOverscanFrame = new Rect(); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 220 | final Rect mContentFrame = new Rect(); |
| 221 | final Rect mParentFrame = new Rect(); |
| 222 | final Rect mVisibleFrame = new Rect(); |
| 223 | |
| 224 | boolean mContentChanged; |
| 225 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 226 | // If a window showing a wallpaper: the requested offset for the |
| 227 | // wallpaper; if a wallpaper window: the currently applied offset. |
| 228 | float mWallpaperX = -1; |
| 229 | float mWallpaperY = -1; |
| 230 | |
| 231 | // If a window showing a wallpaper: what fraction of the offset |
| 232 | // range corresponds to a full virtual screen. |
| 233 | float mWallpaperXStep = -1; |
| 234 | float mWallpaperYStep = -1; |
| 235 | |
| 236 | // Wallpaper windows: pixels offset based on above variables. |
| 237 | int mXOffset; |
| 238 | int mYOffset; |
| 239 | |
Craig Mautner | 2268e7e | 2012-12-13 15:40:00 -0800 | [diff] [blame] | 240 | /** |
| 241 | * This is set after IWindowSession.relayout() has been called at |
| 242 | * least once for the window. It allows us to detect the situation |
| 243 | * where we don't yet have a surface, but should have one soon, so |
| 244 | * we can give the window focus before waiting for the relayout. |
| 245 | */ |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 246 | boolean mRelayoutCalled; |
| 247 | |
Craig Mautner | 0bf6ec9 | 2012-12-18 08:33:27 -0800 | [diff] [blame] | 248 | /** |
| 249 | * If the application has called relayout() with changes that can |
| 250 | * impact its window's size, we need to perform a layout pass on it |
| 251 | * even if it is not currently visible for layout. This is set |
| 252 | * when in that case until the layout is done. |
| 253 | */ |
Dianne Hackborn | b7ff51b | 2012-01-23 19:15:27 -0800 | [diff] [blame] | 254 | boolean mLayoutNeeded; |
| 255 | |
Craig Mautner | 0bf6ec9 | 2012-12-18 08:33:27 -0800 | [diff] [blame] | 256 | /** Currently running an exit animation? */ |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 257 | boolean mExiting; |
| 258 | |
Craig Mautner | 0bf6ec9 | 2012-12-18 08:33:27 -0800 | [diff] [blame] | 259 | /** Currently on the mDestroySurface list? */ |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 260 | boolean mDestroying; |
| 261 | |
Craig Mautner | 0bf6ec9 | 2012-12-18 08:33:27 -0800 | [diff] [blame] | 262 | /** Completely remove from window manager after exit animation? */ |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 263 | boolean mRemoveOnExit; |
| 264 | |
Craig Mautner | 0bf6ec9 | 2012-12-18 08:33:27 -0800 | [diff] [blame] | 265 | /** |
| 266 | * Set when the orientation is changing and this window has not yet |
| 267 | * been updated for the new orientation. |
| 268 | */ |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 269 | boolean mOrientationChanging; |
| 270 | |
Dianne Hackborn | a57c695 | 2013-03-29 14:46:40 -0700 | [diff] [blame] | 271 | /** |
| 272 | * How long we last kept the screen frozen. |
| 273 | */ |
| 274 | int mLastFreezeDuration; |
| 275 | |
Craig Mautner | 0bf6ec9 | 2012-12-18 08:33:27 -0800 | [diff] [blame] | 276 | /** Is this window now (or just being) removed? */ |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 277 | boolean mRemoved; |
| 278 | |
Craig Mautner | 0bf6ec9 | 2012-12-18 08:33:27 -0800 | [diff] [blame] | 279 | /** |
| 280 | * Temp for keeping track of windows that have been removed when |
| 281 | * rebuilding window list. |
| 282 | */ |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 283 | boolean mRebuilding; |
| 284 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 285 | // Input channel and input window handle used by the input dispatcher. |
Jeff Brown | 9302c87 | 2011-07-13 22:51:29 -0700 | [diff] [blame] | 286 | final InputWindowHandle mInputWindowHandle; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 287 | InputChannel mInputChannel; |
Craig Mautner | 164d4bb | 2012-11-26 13:51:23 -0800 | [diff] [blame] | 288 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 289 | // Used to improve performance of toString() |
| 290 | String mStringNameCache; |
| 291 | CharSequence mLastTitle; |
Dianne Hackborn | 529e744 | 2012-11-01 14:22:28 -0700 | [diff] [blame] | 292 | boolean mWasExiting; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 293 | |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 294 | final WindowStateAnimator mWinAnimator; |
| 295 | |
Craig Mautner | c8bc97e | 2012-04-02 12:54:54 -0700 | [diff] [blame] | 296 | boolean mHasSurface = false; |
| 297 | |
Craig Mautner | 59c0097 | 2012-07-30 12:10:24 -0700 | [diff] [blame] | 298 | DisplayContent mDisplayContent; |
Craig Mautner | 6881a10 | 2012-07-27 13:04:51 -0700 | [diff] [blame] | 299 | |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 300 | /** When true this window can be displayed on screens owther than mOwnerUid's */ |
| 301 | private boolean mShowToOwnerOnly; |
Craig Mautner | 9dc52bc | 2012-08-06 14:15:42 -0700 | [diff] [blame] | 302 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 303 | WindowState(WindowManagerService service, Session s, IWindow c, WindowToken token, |
Dianne Hackborn | c229302 | 2013-02-06 23:14:49 -0800 | [diff] [blame] | 304 | WindowState attachedWindow, int appOp, int seq, WindowManager.LayoutParams a, |
Craig Mautner | 59c0097 | 2012-07-30 12:10:24 -0700 | [diff] [blame] | 305 | int viewVisibility, final DisplayContent displayContent) { |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 306 | mService = service; |
| 307 | mSession = s; |
| 308 | mClient = c; |
Dianne Hackborn | c229302 | 2013-02-06 23:14:49 -0800 | [diff] [blame] | 309 | mAppOp = appOp; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 310 | mToken = token; |
Craig Mautner | a2d7b11 | 2012-08-21 15:12:20 -0700 | [diff] [blame] | 311 | mOwnerUid = s.mUid; |
Dianne Hackborn | e3f23a3 | 2013-03-01 13:25:35 -0800 | [diff] [blame] | 312 | mWindowId = new IWindowId.Stub() { |
| 313 | @Override |
| 314 | public void registerFocusObserver(IWindowFocusObserver observer) { |
| 315 | WindowState.this.registerFocusObserver(observer); |
| 316 | } |
| 317 | @Override |
| 318 | public void unregisterFocusObserver(IWindowFocusObserver observer) { |
| 319 | WindowState.this.unregisterFocusObserver(observer); |
| 320 | } |
| 321 | @Override |
| 322 | public boolean isFocused() { |
| 323 | return WindowState.this.isFocused(); |
| 324 | } |
| 325 | }; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 326 | mAttrs.copyFrom(a); |
| 327 | mViewVisibility = viewVisibility; |
Craig Mautner | 59c0097 | 2012-07-30 12:10:24 -0700 | [diff] [blame] | 328 | mDisplayContent = displayContent; |
Craig Mautner | e7ae250 | 2012-03-26 17:11:19 -0700 | [diff] [blame] | 329 | mPolicy = mService.mPolicy; |
| 330 | mContext = mService.mContext; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 331 | DeathRecipient deathRecipient = new DeathRecipient(); |
Dianne Hackborn | 9a230e0 | 2011-10-06 11:51:27 -0700 | [diff] [blame] | 332 | mSeq = seq; |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 333 | mEnforceSizeCompat = (mAttrs.flags & FLAG_COMPATIBLE_WINDOW) != 0; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 334 | if (WindowManagerService.localLOGV) Slog.v( |
Craig Mautner | d87946b | 2012-03-29 18:00:19 -0700 | [diff] [blame] | 335 | TAG, "Window " + this + " client=" + c.asBinder() |
Craig Mautner | ad09bcc | 2012-10-08 13:33:11 -0700 | [diff] [blame] | 336 | + " token=" + token + " (" + mAttrs.token + ")" + " params=" + a); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 337 | try { |
| 338 | c.asBinder().linkToDeath(deathRecipient, 0); |
| 339 | } catch (RemoteException e) { |
| 340 | mDeathRecipient = null; |
| 341 | mAttachedWindow = null; |
| 342 | mLayoutAttached = false; |
| 343 | mIsImWindow = false; |
| 344 | mIsWallpaper = false; |
| 345 | mIsFloatingLayer = false; |
| 346 | mBaseLayer = 0; |
| 347 | mSubLayer = 0; |
Jeff Brown | 9302c87 | 2011-07-13 22:51:29 -0700 | [diff] [blame] | 348 | mInputWindowHandle = null; |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 349 | mWinAnimator = null; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 350 | return; |
| 351 | } |
| 352 | mDeathRecipient = deathRecipient; |
| 353 | |
| 354 | if ((mAttrs.type >= FIRST_SUB_WINDOW && |
| 355 | mAttrs.type <= LAST_SUB_WINDOW)) { |
| 356 | // The multiplier here is to reserve space for multiple |
| 357 | // windows in the same type layer. |
Craig Mautner | e7ae250 | 2012-03-26 17:11:19 -0700 | [diff] [blame] | 358 | mBaseLayer = mPolicy.windowTypeToLayerLw( |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 359 | attachedWindow.mAttrs.type) * WindowManagerService.TYPE_LAYER_MULTIPLIER |
| 360 | + WindowManagerService.TYPE_LAYER_OFFSET; |
Craig Mautner | e7ae250 | 2012-03-26 17:11:19 -0700 | [diff] [blame] | 361 | mSubLayer = mPolicy.subWindowTypeToLayerLw(a.type); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 362 | mAttachedWindow = attachedWindow; |
Craig Mautner | d87946b | 2012-03-29 18:00:19 -0700 | [diff] [blame] | 363 | if (WindowManagerService.DEBUG_ADD_REMOVE) Slog.v(TAG, "Adding " + this + " to " + mAttachedWindow); |
takeda.masayuki | 1873509 | 2012-12-12 11:06:24 +0900 | [diff] [blame] | 364 | |
| 365 | int children_size = mAttachedWindow.mChildWindows.size(); |
| 366 | if (children_size == 0) { |
| 367 | mAttachedWindow.mChildWindows.add(this); |
| 368 | } else { |
| 369 | for (int i = 0; i < children_size; i++) { |
| 370 | WindowState child = (WindowState)mAttachedWindow.mChildWindows.get(i); |
| 371 | if (this.mSubLayer < child.mSubLayer) { |
| 372 | mAttachedWindow.mChildWindows.add(i, this); |
| 373 | break; |
| 374 | } else if (this.mSubLayer > child.mSubLayer) { |
| 375 | continue; |
| 376 | } |
| 377 | |
| 378 | if (this.mBaseLayer <= child.mBaseLayer) { |
| 379 | mAttachedWindow.mChildWindows.add(i, this); |
| 380 | break; |
| 381 | } else { |
| 382 | continue; |
| 383 | } |
| 384 | } |
| 385 | if (children_size == mAttachedWindow.mChildWindows.size()) { |
| 386 | mAttachedWindow.mChildWindows.add(this); |
| 387 | } |
| 388 | } |
| 389 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 390 | mLayoutAttached = mAttrs.type != |
| 391 | WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG; |
| 392 | mIsImWindow = attachedWindow.mAttrs.type == TYPE_INPUT_METHOD |
| 393 | || attachedWindow.mAttrs.type == TYPE_INPUT_METHOD_DIALOG; |
| 394 | mIsWallpaper = attachedWindow.mAttrs.type == TYPE_WALLPAPER; |
| 395 | mIsFloatingLayer = mIsImWindow || mIsWallpaper; |
| 396 | } else { |
| 397 | // The multiplier here is to reserve space for multiple |
| 398 | // windows in the same type layer. |
Craig Mautner | e7ae250 | 2012-03-26 17:11:19 -0700 | [diff] [blame] | 399 | mBaseLayer = mPolicy.windowTypeToLayerLw(a.type) |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 400 | * WindowManagerService.TYPE_LAYER_MULTIPLIER |
| 401 | + WindowManagerService.TYPE_LAYER_OFFSET; |
| 402 | mSubLayer = 0; |
| 403 | mAttachedWindow = null; |
| 404 | mLayoutAttached = false; |
| 405 | mIsImWindow = mAttrs.type == TYPE_INPUT_METHOD |
| 406 | || mAttrs.type == TYPE_INPUT_METHOD_DIALOG; |
| 407 | mIsWallpaper = mAttrs.type == TYPE_WALLPAPER; |
| 408 | mIsFloatingLayer = mIsImWindow || mIsWallpaper; |
| 409 | } |
| 410 | |
| 411 | WindowState appWin = this; |
| 412 | while (appWin.mAttachedWindow != null) { |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 413 | appWin = appWin.mAttachedWindow; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 414 | } |
| 415 | WindowToken appToken = appWin.mToken; |
| 416 | while (appToken.appWindowToken == null) { |
| 417 | WindowToken parent = mService.mTokenMap.get(appToken.token); |
| 418 | if (parent == null || appToken == parent) { |
| 419 | break; |
| 420 | } |
| 421 | appToken = parent; |
| 422 | } |
| 423 | mRootToken = appToken; |
| 424 | mAppToken = appToken.appWindowToken; |
| 425 | |
Craig Mautner | 322e403 | 2012-07-13 13:35:20 -0700 | [diff] [blame] | 426 | mWinAnimator = new WindowStateAnimator(this); |
| 427 | mWinAnimator.mAlpha = a.alpha; |
| 428 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 429 | mRequestedWidth = 0; |
| 430 | mRequestedHeight = 0; |
Dianne Hackborn | 1743b64 | 2012-03-12 17:04:43 -0700 | [diff] [blame] | 431 | mLastRequestedWidth = 0; |
| 432 | mLastRequestedHeight = 0; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 433 | mXOffset = 0; |
| 434 | mYOffset = 0; |
| 435 | mLayer = 0; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 436 | mInputWindowHandle = new InputWindowHandle( |
Craig Mautner | 59c0097 | 2012-07-30 12:10:24 -0700 | [diff] [blame] | 437 | mAppToken != null ? mAppToken.mInputApplicationHandle : null, this, |
| 438 | displayContent.getDisplayId()); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 439 | } |
| 440 | |
| 441 | void attach() { |
| 442 | if (WindowManagerService.localLOGV) Slog.v( |
Craig Mautner | d87946b | 2012-03-29 18:00:19 -0700 | [diff] [blame] | 443 | TAG, "Attaching " + this + " token=" + mToken |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 444 | + ", list=" + mToken.windows); |
| 445 | mSession.windowAddedLocked(); |
| 446 | } |
| 447 | |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 448 | @Override |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 449 | public int getOwningUid() { |
Dianne Hackborn | c229302 | 2013-02-06 23:14:49 -0800 | [diff] [blame] | 450 | return mOwnerUid; |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 451 | } |
| 452 | |
| 453 | @Override |
| 454 | public String getOwningPackage() { |
| 455 | return mAttrs.packageName; |
| 456 | } |
| 457 | |
| 458 | @Override |
Dianne Hackborn | c4aad01 | 2013-02-22 15:05:25 -0800 | [diff] [blame] | 459 | public void computeFrameLw(Rect pf, Rect df, Rect of, Rect cf, Rect vf) { |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 460 | mHaveFrame = true; |
| 461 | |
| 462 | final Rect container = mContainingFrame; |
| 463 | container.set(pf); |
| 464 | |
| 465 | final Rect display = mDisplayFrame; |
| 466 | display.set(df); |
| 467 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 468 | final int pw = container.right - container.left; |
| 469 | final int ph = container.bottom - container.top; |
| 470 | |
| 471 | int w,h; |
Dianne Hackborn | ffb3d93 | 2011-05-17 17:44:51 -0700 | [diff] [blame] | 472 | if ((mAttrs.flags & WindowManager.LayoutParams.FLAG_SCALED) != 0) { |
| 473 | if (mAttrs.width < 0) { |
| 474 | w = pw; |
| 475 | } else if (mEnforceSizeCompat) { |
| 476 | w = (int)(mAttrs.width * mGlobalScale + .5f); |
| 477 | } else { |
| 478 | w = mAttrs.width; |
| 479 | } |
| 480 | if (mAttrs.height < 0) { |
| 481 | h = ph; |
| 482 | } else if (mEnforceSizeCompat) { |
| 483 | h = (int)(mAttrs.height * mGlobalScale + .5f); |
| 484 | } else { |
| 485 | h = mAttrs.height; |
| 486 | } |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 487 | } else { |
Dianne Hackborn | ffb3d93 | 2011-05-17 17:44:51 -0700 | [diff] [blame] | 488 | if (mAttrs.width == WindowManager.LayoutParams.MATCH_PARENT) { |
| 489 | w = pw; |
| 490 | } else if (mEnforceSizeCompat) { |
| 491 | w = (int)(mRequestedWidth * mGlobalScale + .5f); |
| 492 | } else { |
| 493 | w = mRequestedWidth; |
| 494 | } |
| 495 | if (mAttrs.height == WindowManager.LayoutParams.MATCH_PARENT) { |
| 496 | h = ph; |
| 497 | } else if (mEnforceSizeCompat) { |
| 498 | h = (int)(mRequestedHeight * mGlobalScale + .5f); |
| 499 | } else { |
| 500 | h = mRequestedHeight; |
| 501 | } |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 502 | } |
| 503 | |
| 504 | if (!mParentFrame.equals(pf)) { |
| 505 | //Slog.i(TAG, "Window " + this + " content frame from " + mParentFrame |
| 506 | // + " to " + pf); |
| 507 | mParentFrame.set(pf); |
| 508 | mContentChanged = true; |
| 509 | } |
Dianne Hackborn | 1743b64 | 2012-03-12 17:04:43 -0700 | [diff] [blame] | 510 | if (mRequestedWidth != mLastRequestedWidth || mRequestedHeight != mLastRequestedHeight) { |
| 511 | mLastRequestedWidth = mRequestedWidth; |
| 512 | mLastRequestedHeight = mRequestedHeight; |
| 513 | mContentChanged = true; |
| 514 | } |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 515 | |
Dianne Hackborn | c4aad01 | 2013-02-22 15:05:25 -0800 | [diff] [blame] | 516 | final Rect overscan = mOverscanFrame; |
| 517 | overscan.set(of); |
| 518 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 519 | final Rect content = mContentFrame; |
| 520 | content.set(cf); |
| 521 | |
| 522 | final Rect visible = mVisibleFrame; |
| 523 | visible.set(vf); |
| 524 | |
| 525 | final Rect frame = mFrame; |
| 526 | final int fw = frame.width(); |
| 527 | final int fh = frame.height(); |
| 528 | |
| 529 | //System.out.println("In: w=" + w + " h=" + h + " container=" + |
| 530 | // container + " x=" + mAttrs.x + " y=" + mAttrs.y); |
| 531 | |
Dianne Hackborn | ffb3d93 | 2011-05-17 17:44:51 -0700 | [diff] [blame] | 532 | float x, y; |
| 533 | if (mEnforceSizeCompat) { |
| 534 | x = mAttrs.x * mGlobalScale; |
| 535 | y = mAttrs.y * mGlobalScale; |
| 536 | } else { |
| 537 | x = mAttrs.x; |
| 538 | y = mAttrs.y; |
| 539 | } |
| 540 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 541 | Gravity.apply(mAttrs.gravity, w, h, container, |
Dianne Hackborn | ffb3d93 | 2011-05-17 17:44:51 -0700 | [diff] [blame] | 542 | (int) (x + mAttrs.horizontalMargin * pw), |
| 543 | (int) (y + mAttrs.verticalMargin * ph), frame); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 544 | |
| 545 | //System.out.println("Out: " + mFrame); |
| 546 | |
| 547 | // Now make sure the window fits in the overall display. |
| 548 | Gravity.applyDisplay(mAttrs.gravity, df, frame); |
| 549 | |
Craig Mautner | a248eee | 2013-05-07 11:41:27 -0700 | [diff] [blame] | 550 | // Make sure the content and visible frames are inside of the |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 551 | // final window frame. |
| 552 | if (content.left < frame.left) content.left = frame.left; |
| 553 | if (content.top < frame.top) content.top = frame.top; |
| 554 | if (content.right > frame.right) content.right = frame.right; |
| 555 | if (content.bottom > frame.bottom) content.bottom = frame.bottom; |
| 556 | if (visible.left < frame.left) visible.left = frame.left; |
| 557 | if (visible.top < frame.top) visible.top = frame.top; |
| 558 | if (visible.right > frame.right) visible.right = frame.right; |
| 559 | if (visible.bottom > frame.bottom) visible.bottom = frame.bottom; |
| 560 | |
Dianne Hackborn | c4aad01 | 2013-02-22 15:05:25 -0800 | [diff] [blame] | 561 | final Rect overscanInsets = mOverscanInsets; |
Dianne Hackborn | bee1fb9 | 2013-05-08 15:51:26 -0700 | [diff] [blame] | 562 | overscanInsets.left = overscan.left > frame.left ? overscan.left-frame.left : 0; |
| 563 | overscanInsets.top = overscan.top > frame.top ? overscan.top-frame.top : 0; |
| 564 | overscanInsets.right = overscan.right < frame.right ? frame.right-overscan.right : 0; |
| 565 | overscanInsets.bottom = overscan.bottom < frame.bottom ? frame.bottom-overscan.bottom : 0; |
Dianne Hackborn | c4aad01 | 2013-02-22 15:05:25 -0800 | [diff] [blame] | 566 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 567 | final Rect contentInsets = mContentInsets; |
| 568 | contentInsets.left = content.left-frame.left; |
| 569 | contentInsets.top = content.top-frame.top; |
| 570 | contentInsets.right = frame.right-content.right; |
| 571 | contentInsets.bottom = frame.bottom-content.bottom; |
| 572 | |
| 573 | final Rect visibleInsets = mVisibleInsets; |
| 574 | visibleInsets.left = visible.left-frame.left; |
| 575 | visibleInsets.top = visible.top-frame.top; |
| 576 | visibleInsets.right = frame.right-visible.right; |
| 577 | visibleInsets.bottom = frame.bottom-visible.bottom; |
| 578 | |
Dianne Hackborn | ffb3d93 | 2011-05-17 17:44:51 -0700 | [diff] [blame] | 579 | mCompatFrame.set(frame); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 580 | if (mEnforceSizeCompat) { |
Dianne Hackborn | ffb3d93 | 2011-05-17 17:44:51 -0700 | [diff] [blame] | 581 | // If there is a size compatibility scale being applied to the |
| 582 | // window, we need to apply this to its insets so that they are |
| 583 | // reported to the app in its coordinate space. |
Dianne Hackborn | c4aad01 | 2013-02-22 15:05:25 -0800 | [diff] [blame] | 584 | overscanInsets.scale(mInvGlobalScale); |
Dianne Hackborn | ffb3d93 | 2011-05-17 17:44:51 -0700 | [diff] [blame] | 585 | contentInsets.scale(mInvGlobalScale); |
| 586 | visibleInsets.scale(mInvGlobalScale); |
| 587 | |
| 588 | // Also the scaled frame that we report to the app needs to be |
| 589 | // adjusted to be in its coordinate space. |
| 590 | mCompatFrame.scale(mInvGlobalScale); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 591 | } |
| 592 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 593 | if (mIsWallpaper && (fw != frame.width() || fh != frame.height())) { |
Craig Mautner | 59c0097 | 2012-07-30 12:10:24 -0700 | [diff] [blame] | 594 | final DisplayInfo displayInfo = mDisplayContent.getDisplayInfo(); |
| 595 | mService.updateWallpaperOffsetLocked(this, displayInfo.appWidth, displayInfo.appHeight, |
| 596 | false); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 597 | } |
| 598 | |
| 599 | if (WindowManagerService.localLOGV) { |
| 600 | //if ("com.google.android.youtube".equals(mAttrs.packageName) |
| 601 | // && mAttrs.type == WindowManager.LayoutParams.TYPE_APPLICATION_PANEL) { |
Craig Mautner | d87946b | 2012-03-29 18:00:19 -0700 | [diff] [blame] | 602 | Slog.v(TAG, "Resolving (mRequestedWidth=" |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 603 | + mRequestedWidth + ", mRequestedheight=" |
| 604 | + mRequestedHeight + ") to" + " (pw=" + pw + ", ph=" + ph |
| 605 | + "): frame=" + mFrame.toShortString() |
| 606 | + " ci=" + contentInsets.toShortString() |
| 607 | + " vi=" + visibleInsets.toShortString()); |
| 608 | //} |
| 609 | } |
| 610 | } |
| 611 | |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 612 | @Override |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 613 | public Rect getFrameLw() { |
| 614 | return mFrame; |
| 615 | } |
| 616 | |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 617 | @Override |
Dianne Hackborn | d040edb | 2011-08-31 12:47:58 -0700 | [diff] [blame] | 618 | public RectF getShownFrameLw() { |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 619 | return mShownFrame; |
| 620 | } |
| 621 | |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 622 | @Override |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 623 | public Rect getDisplayFrameLw() { |
| 624 | return mDisplayFrame; |
| 625 | } |
| 626 | |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 627 | @Override |
Dianne Hackborn | c4aad01 | 2013-02-22 15:05:25 -0800 | [diff] [blame] | 628 | public Rect getOverscanFrameLw() { |
| 629 | return mOverscanFrame; |
| 630 | } |
| 631 | |
| 632 | @Override |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 633 | public Rect getContentFrameLw() { |
| 634 | return mContentFrame; |
| 635 | } |
| 636 | |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 637 | @Override |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 638 | public Rect getVisibleFrameLw() { |
| 639 | return mVisibleFrame; |
| 640 | } |
| 641 | |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 642 | @Override |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 643 | public boolean getGivenInsetsPendingLw() { |
| 644 | return mGivenInsetsPending; |
| 645 | } |
| 646 | |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 647 | @Override |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 648 | public Rect getGivenContentInsetsLw() { |
| 649 | return mGivenContentInsets; |
| 650 | } |
| 651 | |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 652 | @Override |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 653 | public Rect getGivenVisibleInsetsLw() { |
| 654 | return mGivenVisibleInsets; |
| 655 | } |
| 656 | |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 657 | @Override |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 658 | public WindowManager.LayoutParams getAttrs() { |
| 659 | return mAttrs; |
| 660 | } |
| 661 | |
Craig Mautner | 812d2ca | 2012-09-27 15:35:34 -0700 | [diff] [blame] | 662 | @Override |
Dianne Hackborn | 73ab6a4 | 2011-12-13 11:16:23 -0800 | [diff] [blame] | 663 | public boolean getNeedsMenuLw(WindowManagerPolicy.WindowState bottom) { |
| 664 | int index = -1; |
| 665 | WindowState ws = this; |
Craig Mautner | 59c0097 | 2012-07-30 12:10:24 -0700 | [diff] [blame] | 666 | WindowList windows = getWindowList(); |
Dianne Hackborn | 73ab6a4 | 2011-12-13 11:16:23 -0800 | [diff] [blame] | 667 | while (true) { |
| 668 | if ((ws.mAttrs.privateFlags |
| 669 | & WindowManager.LayoutParams.PRIVATE_FLAG_SET_NEEDS_MENU_KEY) != 0) { |
| 670 | return (ws.mAttrs.flags & WindowManager.LayoutParams.FLAG_NEEDS_MENU_KEY) != 0; |
| 671 | } |
| 672 | // If we reached the bottom of the range of windows we are considering, |
| 673 | // assume no menu is needed. |
| 674 | if (ws == bottom) { |
| 675 | return false; |
| 676 | } |
| 677 | // The current window hasn't specified whether menu key is needed; |
| 678 | // look behind it. |
| 679 | // First, we may need to determine the starting position. |
| 680 | if (index < 0) { |
Craig Mautner | 59c0097 | 2012-07-30 12:10:24 -0700 | [diff] [blame] | 681 | index = windows.indexOf(ws); |
Dianne Hackborn | 73ab6a4 | 2011-12-13 11:16:23 -0800 | [diff] [blame] | 682 | } |
| 683 | index--; |
| 684 | if (index < 0) { |
| 685 | return false; |
| 686 | } |
Craig Mautner | 59c0097 | 2012-07-30 12:10:24 -0700 | [diff] [blame] | 687 | ws = windows.get(index); |
Dianne Hackborn | 73ab6a4 | 2011-12-13 11:16:23 -0800 | [diff] [blame] | 688 | } |
| 689 | } |
| 690 | |
Craig Mautner | 19d59bc | 2012-09-04 11:15:56 -0700 | [diff] [blame] | 691 | @Override |
Dianne Hackborn | 9a230e0 | 2011-10-06 11:51:27 -0700 | [diff] [blame] | 692 | public int getSystemUiVisibility() { |
| 693 | return mSystemUiVisibility; |
| 694 | } |
| 695 | |
Craig Mautner | 19d59bc | 2012-09-04 11:15:56 -0700 | [diff] [blame] | 696 | @Override |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 697 | public int getSurfaceLayer() { |
| 698 | return mLayer; |
| 699 | } |
| 700 | |
Craig Mautner | 812d2ca | 2012-09-27 15:35:34 -0700 | [diff] [blame] | 701 | @Override |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 702 | public IApplicationToken getAppToken() { |
| 703 | return mAppToken != null ? mAppToken.appToken : null; |
| 704 | } |
Craig Mautner | 19d59bc | 2012-09-04 11:15:56 -0700 | [diff] [blame] | 705 | |
| 706 | public int getDisplayId() { |
| 707 | return mDisplayContent.getDisplayId(); |
| 708 | } |
| 709 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 710 | public long getInputDispatchingTimeoutNanos() { |
| 711 | return mAppToken != null |
| 712 | ? mAppToken.inputDispatchingTimeoutNanos |
| 713 | : WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS; |
| 714 | } |
| 715 | |
Craig Mautner | e855214 | 2012-11-07 13:55:47 -0800 | [diff] [blame] | 716 | @Override |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 717 | public boolean hasAppShownWindows() { |
Craig Mautner | f412095 | 2012-06-21 18:25:39 -0700 | [diff] [blame] | 718 | return mAppToken != null && (mAppToken.firstWindowDrawn || mAppToken.startingDisplayed); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 719 | } |
| 720 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 721 | boolean isIdentityMatrix(float dsdx, float dtdx, float dsdy, float dtdy) { |
| 722 | if (dsdx < .99999f || dsdx > 1.00001f) return false; |
| 723 | if (dtdy < .99999f || dtdy > 1.00001f) return false; |
| 724 | if (dtdx < -.000001f || dtdx > .000001f) return false; |
| 725 | if (dsdy < -.000001f || dsdy > .000001f) return false; |
| 726 | return true; |
| 727 | } |
| 728 | |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 729 | void prelayout() { |
| 730 | if (mEnforceSizeCompat) { |
| 731 | mGlobalScale = mService.mCompatibleScreenScale; |
Dianne Hackborn | ffb3d93 | 2011-05-17 17:44:51 -0700 | [diff] [blame] | 732 | mInvGlobalScale = 1/mGlobalScale; |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 733 | } else { |
Dianne Hackborn | ffb3d93 | 2011-05-17 17:44:51 -0700 | [diff] [blame] | 734 | mGlobalScale = mInvGlobalScale = 1; |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 735 | } |
| 736 | } |
| 737 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 738 | /** |
| 739 | * Is this window visible? It is not visible if there is no |
| 740 | * surface, or we are in the process of running an exit animation |
| 741 | * that will remove the surface, or its app token has been hidden. |
| 742 | */ |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 743 | @Override |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 744 | public boolean isVisibleLw() { |
| 745 | final AppWindowToken atoken = mAppToken; |
Craig Mautner | c8bc97e | 2012-04-02 12:54:54 -0700 | [diff] [blame] | 746 | return mHasSurface && mPolicyVisibility && !mAttachedHidden |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 747 | && (atoken == null || !atoken.hiddenRequested) |
| 748 | && !mExiting && !mDestroying; |
| 749 | } |
| 750 | |
| 751 | /** |
| 752 | * Like {@link #isVisibleLw}, but also counts a window that is currently |
| 753 | * "hidden" behind the keyguard as visible. This allows us to apply |
| 754 | * things like window flags that impact the keyguard. |
| 755 | * XXX I am starting to think we need to have ANOTHER visibility flag |
| 756 | * for this "hidden behind keyguard" state rather than overloading |
| 757 | * mPolicyVisibility. Ungh. |
| 758 | */ |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 759 | @Override |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 760 | public boolean isVisibleOrBehindKeyguardLw() { |
Dianne Hackborn | bc1aa7b | 2011-09-20 11:20:31 -0700 | [diff] [blame] | 761 | if (mRootToken.waitingToShow && |
Craig Mautner | 164d4bb | 2012-11-26 13:51:23 -0800 | [diff] [blame] | 762 | mService.mAppTransition.isTransitionSet()) { |
Dianne Hackborn | bc1aa7b | 2011-09-20 11:20:31 -0700 | [diff] [blame] | 763 | return false; |
| 764 | } |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 765 | final AppWindowToken atoken = mAppToken; |
Dianne Hackborn | bc1aa7b | 2011-09-20 11:20:31 -0700 | [diff] [blame] | 766 | final boolean animating = atoken != null |
Craig Mautner | 5943163 | 2012-04-04 11:56:44 -0700 | [diff] [blame] | 767 | ? (atoken.mAppAnimator.animation != null) : false; |
Craig Mautner | c8bc97e | 2012-04-02 12:54:54 -0700 | [diff] [blame] | 768 | return mHasSurface && !mDestroying && !mExiting |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 769 | && (atoken == null ? mPolicyVisibility : !atoken.hiddenRequested) |
Dianne Hackborn | bc1aa7b | 2011-09-20 11:20:31 -0700 | [diff] [blame] | 770 | && ((!mAttachedHidden && mViewVisibility == View.VISIBLE |
| 771 | && !mRootToken.hidden) |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 772 | || mWinAnimator.mAnimation != null || animating); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 773 | } |
| 774 | |
| 775 | /** |
| 776 | * Is this window visible, ignoring its app token? It is not visible |
| 777 | * if there is no surface, or we are in the process of running an exit animation |
| 778 | * that will remove the surface. |
| 779 | */ |
| 780 | public boolean isWinVisibleLw() { |
| 781 | final AppWindowToken atoken = mAppToken; |
Craig Mautner | c8bc97e | 2012-04-02 12:54:54 -0700 | [diff] [blame] | 782 | return mHasSurface && mPolicyVisibility && !mAttachedHidden |
Craig Mautner | 5943163 | 2012-04-04 11:56:44 -0700 | [diff] [blame] | 783 | && (atoken == null || !atoken.hiddenRequested || atoken.mAppAnimator.animating) |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 784 | && !mExiting && !mDestroying; |
| 785 | } |
| 786 | |
| 787 | /** |
| 788 | * The same as isVisible(), but follows the current hidden state of |
| 789 | * the associated app token, not the pending requested hidden state. |
| 790 | */ |
| 791 | boolean isVisibleNow() { |
Craig Mautner | c8bc97e | 2012-04-02 12:54:54 -0700 | [diff] [blame] | 792 | return mHasSurface && mPolicyVisibility && !mAttachedHidden |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 793 | && !mRootToken.hidden && !mExiting && !mDestroying; |
| 794 | } |
| 795 | |
| 796 | /** |
| 797 | * Can this window possibly be a drag/drop target? The test here is |
| 798 | * a combination of the above "visible now" with the check that the |
| 799 | * Input Manager uses when discarding windows from input consideration. |
| 800 | */ |
| 801 | boolean isPotentialDragTarget() { |
Jeff Brown | cc4f7db | 2011-08-30 20:34:48 -0700 | [diff] [blame] | 802 | return isVisibleNow() && !mRemoved |
| 803 | && mInputChannel != null && mInputWindowHandle != null; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 804 | } |
| 805 | |
| 806 | /** |
| 807 | * Same as isVisible(), but we also count it as visible between the |
| 808 | * call to IWindowSession.add() and the first relayout(). |
| 809 | */ |
| 810 | boolean isVisibleOrAdding() { |
| 811 | final AppWindowToken atoken = mAppToken; |
Craig Mautner | bf08af3 | 2012-05-16 19:43:42 -0700 | [diff] [blame] | 812 | return (mHasSurface || (!mRelayoutCalled && mViewVisibility == View.VISIBLE)) |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 813 | && mPolicyVisibility && !mAttachedHidden |
| 814 | && (atoken == null || !atoken.hiddenRequested) |
| 815 | && !mExiting && !mDestroying; |
| 816 | } |
| 817 | |
| 818 | /** |
| 819 | * Is this window currently on-screen? It is on-screen either if it |
| 820 | * is visible or it is currently running an animation before no longer |
| 821 | * being visible. |
| 822 | */ |
| 823 | boolean isOnScreen() { |
Craig Mautner | c8bc97e | 2012-04-02 12:54:54 -0700 | [diff] [blame] | 824 | if (!mHasSurface || !mPolicyVisibility || mDestroying) { |
| 825 | return false; |
| 826 | } |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 827 | final AppWindowToken atoken = mAppToken; |
| 828 | if (atoken != null) { |
Craig Mautner | c8bc97e | 2012-04-02 12:54:54 -0700 | [diff] [blame] | 829 | return ((!mAttachedHidden && !atoken.hiddenRequested) |
Craig Mautner | ccc9e9b | 2012-12-11 09:40:34 -0800 | [diff] [blame] | 830 | || mWinAnimator.mAnimation != null || atoken.mAppAnimator.animation != null); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 831 | } |
Craig Mautner | c8bc97e | 2012-04-02 12:54:54 -0700 | [diff] [blame] | 832 | return !mAttachedHidden || mWinAnimator.mAnimation != null; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 833 | } |
| 834 | |
| 835 | /** |
| 836 | * Like isOnScreen(), but we don't return true if the window is part |
| 837 | * of a transition that has not yet been started. |
| 838 | */ |
| 839 | boolean isReadyForDisplay() { |
| 840 | if (mRootToken.waitingToShow && |
Craig Mautner | 164d4bb | 2012-11-26 13:51:23 -0800 | [diff] [blame] | 841 | mService.mAppTransition.isTransitionSet()) { |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 842 | return false; |
| 843 | } |
Craig Mautner | c8bc97e | 2012-04-02 12:54:54 -0700 | [diff] [blame] | 844 | return mHasSurface && mPolicyVisibility && !mDestroying |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 845 | && ((!mAttachedHidden && mViewVisibility == View.VISIBLE |
| 846 | && !mRootToken.hidden) |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 847 | || mWinAnimator.mAnimation != null |
Craig Mautner | 5943163 | 2012-04-04 11:56:44 -0700 | [diff] [blame] | 848 | || ((mAppToken != null) && (mAppToken.mAppAnimator.animation != null))); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 849 | } |
| 850 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 851 | /** |
Dianne Hackborn | 6e2281d | 2012-06-19 17:48:32 -0700 | [diff] [blame] | 852 | * Like isReadyForDisplay(), but ignores any force hiding of the window due |
| 853 | * to the keyguard. |
| 854 | */ |
| 855 | boolean isReadyForDisplayIgnoringKeyguard() { |
Craig Mautner | 164d4bb | 2012-11-26 13:51:23 -0800 | [diff] [blame] | 856 | if (mRootToken.waitingToShow && mService.mAppTransition.isTransitionSet()) { |
Dianne Hackborn | 6e2281d | 2012-06-19 17:48:32 -0700 | [diff] [blame] | 857 | return false; |
| 858 | } |
| 859 | final AppWindowToken atoken = mAppToken; |
| 860 | if (atoken == null && !mPolicyVisibility) { |
| 861 | // If this is not an app window, and the policy has asked to force |
| 862 | // hide, then we really do want to hide. |
| 863 | return false; |
| 864 | } |
| 865 | return mHasSurface && !mDestroying |
| 866 | && ((!mAttachedHidden && mViewVisibility == View.VISIBLE |
| 867 | && !mRootToken.hidden) |
| 868 | || mWinAnimator.mAnimation != null |
Craig Mautner | 9c5bf3b | 2012-06-22 15:19:13 -0700 | [diff] [blame] | 869 | || ((atoken != null) && (atoken.mAppAnimator.animation != null) |
| 870 | && !mWinAnimator.isDummyAnimation())); |
Dianne Hackborn | 6e2281d | 2012-06-19 17:48:32 -0700 | [diff] [blame] | 871 | } |
| 872 | |
| 873 | /** |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 874 | * Like isOnScreen, but returns false if the surface hasn't yet |
| 875 | * been drawn. |
| 876 | */ |
Craig Mautner | e6f7d505 | 2012-10-08 10:34:17 -0700 | [diff] [blame] | 877 | @Override |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 878 | public boolean isDisplayedLw() { |
| 879 | final AppWindowToken atoken = mAppToken; |
Craig Mautner | bf90eaa | 2012-03-15 11:28:53 -0700 | [diff] [blame] | 880 | return isDrawnLw() && mPolicyVisibility |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 881 | && ((!mAttachedHidden && |
| 882 | (atoken == null || !atoken.hiddenRequested)) |
Craig Mautner | e6f7d505 | 2012-10-08 10:34:17 -0700 | [diff] [blame] | 883 | || mWinAnimator.mAnimating |
| 884 | || (atoken != null && atoken.mAppAnimator.animation != null)); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 885 | } |
| 886 | |
Dianne Hackborn | 5c58de3 | 2012-04-28 19:52:37 -0700 | [diff] [blame] | 887 | /** |
Craig Mautner | ae44659 | 2012-12-06 19:05:05 -0800 | [diff] [blame] | 888 | * Return true if this window or its app token is currently animating. |
Dianne Hackborn | 5c58de3 | 2012-04-28 19:52:37 -0700 | [diff] [blame] | 889 | */ |
Craig Mautner | e6f7d505 | 2012-10-08 10:34:17 -0700 | [diff] [blame] | 890 | @Override |
Dianne Hackborn | 5c58de3 | 2012-04-28 19:52:37 -0700 | [diff] [blame] | 891 | public boolean isAnimatingLw() { |
Craig Mautner | ae44659 | 2012-12-06 19:05:05 -0800 | [diff] [blame] | 892 | return mWinAnimator.mAnimation != null |
| 893 | || (mAppToken != null && mAppToken.mAppAnimator.animation != null); |
Dianne Hackborn | 5c58de3 | 2012-04-28 19:52:37 -0700 | [diff] [blame] | 894 | } |
| 895 | |
Craig Mautner | 812d2ca | 2012-09-27 15:35:34 -0700 | [diff] [blame] | 896 | @Override |
Dianne Hackborn | cfbf7de | 2012-01-12 14:05:03 -0800 | [diff] [blame] | 897 | public boolean isGoneForLayoutLw() { |
| 898 | final AppWindowToken atoken = mAppToken; |
| 899 | return mViewVisibility == View.GONE |
| 900 | || !mRelayoutCalled |
| 901 | || (atoken == null && mRootToken.hidden) |
Craig Mautner | 812d2ca | 2012-09-27 15:35:34 -0700 | [diff] [blame] | 902 | || (atoken != null && (atoken.hiddenRequested || atoken.hidden)) |
Dianne Hackborn | cfbf7de | 2012-01-12 14:05:03 -0800 | [diff] [blame] | 903 | || mAttachedHidden |
| 904 | || mExiting || mDestroying; |
| 905 | } |
| 906 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 907 | /** |
| 908 | * Returns true if the window has a surface that it has drawn a |
| 909 | * complete UI in to. |
| 910 | */ |
Craig Mautner | ccc9e9b | 2012-12-11 09:40:34 -0800 | [diff] [blame] | 911 | public boolean isDrawFinishedLw() { |
| 912 | return mHasSurface && !mDestroying && |
| 913 | (mWinAnimator.mDrawState == WindowStateAnimator.COMMIT_DRAW_PENDING |
| 914 | || mWinAnimator.mDrawState == WindowStateAnimator.READY_TO_SHOW |
| 915 | || mWinAnimator.mDrawState == WindowStateAnimator.HAS_DRAWN); |
| 916 | } |
| 917 | |
| 918 | /** |
| 919 | * Returns true if the window has a surface that it has drawn a |
| 920 | * complete UI in to. |
| 921 | */ |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 922 | public boolean isDrawnLw() { |
Craig Mautner | c8bc97e | 2012-04-02 12:54:54 -0700 | [diff] [blame] | 923 | return mHasSurface && !mDestroying && |
Craig Mautner | 749a7bb | 2012-04-02 13:49:53 -0700 | [diff] [blame] | 924 | (mWinAnimator.mDrawState == WindowStateAnimator.READY_TO_SHOW |
| 925 | || mWinAnimator.mDrawState == WindowStateAnimator.HAS_DRAWN); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 926 | } |
| 927 | |
| 928 | /** |
| 929 | * Return true if the window is opaque and fully drawn. This indicates |
| 930 | * it may obscure windows behind it. |
| 931 | */ |
| 932 | boolean isOpaqueDrawn() { |
| 933 | return (mAttrs.format == PixelFormat.OPAQUE |
| 934 | || mAttrs.type == TYPE_WALLPAPER) |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 935 | && isDrawnLw() && mWinAnimator.mAnimation == null |
Craig Mautner | 5943163 | 2012-04-04 11:56:44 -0700 | [diff] [blame] | 936 | && (mAppToken == null || mAppToken.mAppAnimator.animation == null); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 937 | } |
| 938 | |
| 939 | /** |
| 940 | * Return whether this window is wanting to have a translation |
| 941 | * animation applied to it for an in-progress move. (Only makes |
| 942 | * sense to call from performLayoutAndPlaceSurfacesLockedInner().) |
| 943 | */ |
| 944 | boolean shouldAnimateMove() { |
Craig Mautner | 749a7bb | 2012-04-02 13:49:53 -0700 | [diff] [blame] | 945 | return mContentChanged && !mExiting && !mWinAnimator.mLastHidden && mService.okToDisplay() |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 946 | && (mFrame.top != mLastFrame.top |
| 947 | || mFrame.left != mLastFrame.left) |
Dianne Hackborn | 1c5383c | 2013-04-15 15:07:21 -0700 | [diff] [blame] | 948 | && (mAttrs.privateFlags&PRIVATE_FLAG_NO_MOVE_ANIMATION) == 0 |
Craig Mautner | 2fb98b1 | 2012-03-20 17:24:00 -0700 | [diff] [blame] | 949 | && (mAttachedWindow == null || !mAttachedWindow.shouldAnimateMove()); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 950 | } |
| 951 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 952 | boolean isFullscreen(int screenWidth, int screenHeight) { |
Dianne Hackborn | ffb3d93 | 2011-05-17 17:44:51 -0700 | [diff] [blame] | 953 | return mFrame.left <= 0 && mFrame.top <= 0 && |
| 954 | mFrame.right >= screenWidth && mFrame.bottom >= screenHeight; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 955 | } |
| 956 | |
Craig Mautner | 812d2ca | 2012-09-27 15:35:34 -0700 | [diff] [blame] | 957 | boolean isConfigChanged() { |
Craig Mautner | e855214 | 2012-11-07 13:55:47 -0800 | [diff] [blame] | 958 | boolean configChanged = mConfiguration != mService.mCurConfiguration |
Craig Mautner | 812d2ca | 2012-09-27 15:35:34 -0700 | [diff] [blame] | 959 | && (mConfiguration == null |
| 960 | || (mConfiguration.diff(mService.mCurConfiguration) != 0)); |
Craig Mautner | e855214 | 2012-11-07 13:55:47 -0800 | [diff] [blame] | 961 | |
| 962 | if (mAttrs.type == TYPE_KEYGUARD) { |
| 963 | // Retain configuration changed status until resetConfiguration called. |
| 964 | mConfigHasChanged |= configChanged; |
| 965 | configChanged = mConfigHasChanged; |
| 966 | } |
| 967 | |
| 968 | return configChanged; |
Craig Mautner | 812d2ca | 2012-09-27 15:35:34 -0700 | [diff] [blame] | 969 | } |
| 970 | |
| 971 | boolean isConfigDiff(int mask) { |
| 972 | return mConfiguration != mService.mCurConfiguration |
| 973 | && mConfiguration != null |
| 974 | && (mConfiguration.diff(mService.mCurConfiguration) & mask) != 0; |
| 975 | } |
| 976 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 977 | void removeLocked() { |
| 978 | disposeInputChannel(); |
Craig Mautner | 164d4bb | 2012-11-26 13:51:23 -0800 | [diff] [blame] | 979 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 980 | if (mAttachedWindow != null) { |
Craig Mautner | d87946b | 2012-03-29 18:00:19 -0700 | [diff] [blame] | 981 | if (WindowManagerService.DEBUG_ADD_REMOVE) Slog.v(TAG, "Removing " + this + " from " + mAttachedWindow); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 982 | mAttachedWindow.mChildWindows.remove(this); |
| 983 | } |
Craig Mautner | 9686833 | 2012-12-04 14:29:11 -0800 | [diff] [blame] | 984 | mWinAnimator.destroyDeferredSurfaceLocked(); |
| 985 | mWinAnimator.destroySurfaceLocked(); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 986 | mSession.windowRemovedLocked(); |
| 987 | try { |
| 988 | mClient.asBinder().unlinkToDeath(mDeathRecipient, 0); |
| 989 | } catch (RuntimeException e) { |
| 990 | // Ignore if it has already been removed (usually because |
| 991 | // we are doing this as part of processing a death note.) |
| 992 | } |
| 993 | } |
Jeff Brown | cc4f7db | 2011-08-30 20:34:48 -0700 | [diff] [blame] | 994 | |
Craig Mautner | e855214 | 2012-11-07 13:55:47 -0800 | [diff] [blame] | 995 | void setConfiguration(final Configuration newConfig) { |
| 996 | mConfiguration = newConfig; |
| 997 | mConfigHasChanged = false; |
| 998 | } |
| 999 | |
Jeff Brown | cc4f7db | 2011-08-30 20:34:48 -0700 | [diff] [blame] | 1000 | void setInputChannel(InputChannel inputChannel) { |
| 1001 | if (mInputChannel != null) { |
| 1002 | throw new IllegalStateException("Window already has an input channel."); |
| 1003 | } |
| 1004 | |
| 1005 | mInputChannel = inputChannel; |
| 1006 | mInputWindowHandle.inputChannel = inputChannel; |
| 1007 | } |
| 1008 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1009 | void disposeInputChannel() { |
| 1010 | if (mInputChannel != null) { |
| 1011 | mService.mInputManager.unregisterInputChannel(mInputChannel); |
Craig Mautner | 164d4bb | 2012-11-26 13:51:23 -0800 | [diff] [blame] | 1012 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1013 | mInputChannel.dispose(); |
| 1014 | mInputChannel = null; |
| 1015 | } |
Jeff Brown | cc4f7db | 2011-08-30 20:34:48 -0700 | [diff] [blame] | 1016 | |
| 1017 | mInputWindowHandle.inputChannel = null; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1018 | } |
| 1019 | |
| 1020 | private class DeathRecipient implements IBinder.DeathRecipient { |
Craig Mautner | e855214 | 2012-11-07 13:55:47 -0800 | [diff] [blame] | 1021 | @Override |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1022 | public void binderDied() { |
| 1023 | try { |
| 1024 | synchronized(mService.mWindowMap) { |
| 1025 | WindowState win = mService.windowForClientLocked(mSession, mClient, false); |
Craig Mautner | d87946b | 2012-03-29 18:00:19 -0700 | [diff] [blame] | 1026 | Slog.i(TAG, "WIN DEATH: " + win); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1027 | if (win != null) { |
| 1028 | mService.removeWindowLocked(mSession, win); |
Craig Mautner | a99764e | 2013-03-06 10:22:16 -0800 | [diff] [blame] | 1029 | } else if (WindowState.this.mHasSurface) { |
| 1030 | Slog.e(TAG, "!!! LEAK !!! Window removed but surface still valid."); |
| 1031 | mService.removeWindowLocked(mSession, WindowState.this); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1032 | } |
| 1033 | } |
| 1034 | } catch (IllegalArgumentException ex) { |
| 1035 | // This will happen if the window has already been |
| 1036 | // removed. |
| 1037 | } |
| 1038 | } |
| 1039 | } |
| 1040 | |
Craig Mautner | 5810681 | 2012-12-28 12:27:40 -0800 | [diff] [blame] | 1041 | /** |
| 1042 | * @return true if this window desires key events. |
Craig Mautner | ef25d7a | 2012-05-15 23:01:47 -0700 | [diff] [blame] | 1043 | */ |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1044 | public final boolean canReceiveKeys() { |
Craig Mautner | 5810681 | 2012-12-28 12:27:40 -0800 | [diff] [blame] | 1045 | return isVisibleOrAdding() |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1046 | && (mViewVisibility == View.VISIBLE) |
| 1047 | && ((mAttrs.flags & WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE) == 0); |
| 1048 | } |
| 1049 | |
Craig Mautner | 749a7bb | 2012-04-02 13:49:53 -0700 | [diff] [blame] | 1050 | @Override |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1051 | public boolean hasDrawnLw() { |
Craig Mautner | 749a7bb | 2012-04-02 13:49:53 -0700 | [diff] [blame] | 1052 | return mWinAnimator.mDrawState == WindowStateAnimator.HAS_DRAWN; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1053 | } |
| 1054 | |
Craig Mautner | 749a7bb | 2012-04-02 13:49:53 -0700 | [diff] [blame] | 1055 | @Override |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1056 | public boolean showLw(boolean doAnimation) { |
| 1057 | return showLw(doAnimation, true); |
| 1058 | } |
| 1059 | |
| 1060 | boolean showLw(boolean doAnimation, boolean requestAnim) { |
Craig Mautner | 5962b12 | 2012-10-05 14:45:52 -0700 | [diff] [blame] | 1061 | if (isHiddenFromUserLocked()) { |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 1062 | Slog.w(TAG, "current user violation " + mService.mCurrentUserId + " trying to display " |
Craig Mautner | a2d7b11 | 2012-08-21 15:12:20 -0700 | [diff] [blame] | 1063 | + this + ", type " + mAttrs.type + ", belonging to " + mOwnerUid); |
Craig Mautner | 9dc52bc | 2012-08-06 14:15:42 -0700 | [diff] [blame] | 1064 | return false; |
| 1065 | } |
Dianne Hackborn | b6b23ec | 2013-02-11 19:29:06 -0800 | [diff] [blame] | 1066 | if (!mAppOpVisibility) { |
| 1067 | // Being hidden due to app op request. |
| 1068 | return false; |
| 1069 | } |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1070 | if (mPolicyVisibility && mPolicyVisibilityAfterAnim) { |
Craig Mautner | e32c307 | 2012-03-12 15:25:35 -0700 | [diff] [blame] | 1071 | // Already showing. |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1072 | return false; |
| 1073 | } |
Craig Mautner | d87946b | 2012-03-29 18:00:19 -0700 | [diff] [blame] | 1074 | if (DEBUG_VISIBILITY) Slog.v(TAG, "Policy visibility true: " + this); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1075 | if (doAnimation) { |
Craig Mautner | d87946b | 2012-03-29 18:00:19 -0700 | [diff] [blame] | 1076 | if (DEBUG_VISIBILITY) Slog.v(TAG, "doAnimation: mPolicyVisibility=" |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 1077 | + mPolicyVisibility + " mAnimation=" + mWinAnimator.mAnimation); |
Craig Mautner | 2fb98b1 | 2012-03-20 17:24:00 -0700 | [diff] [blame] | 1078 | if (!mService.okToDisplay()) { |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1079 | doAnimation = false; |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 1080 | } else if (mPolicyVisibility && mWinAnimator.mAnimation == null) { |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1081 | // Check for the case where we are currently visible and |
| 1082 | // not animating; we do not want to do animation at such a |
| 1083 | // point to become visible when we already are. |
| 1084 | doAnimation = false; |
| 1085 | } |
| 1086 | } |
| 1087 | mPolicyVisibility = true; |
| 1088 | mPolicyVisibilityAfterAnim = true; |
| 1089 | if (doAnimation) { |
Craig Mautner | c2f9be0 | 2012-03-27 17:32:29 -0700 | [diff] [blame] | 1090 | mWinAnimator.applyAnimationLocked(WindowManagerPolicy.TRANSIT_ENTER, true); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1091 | } |
| 1092 | if (requestAnim) { |
Craig Mautner | 9686833 | 2012-12-04 14:29:11 -0800 | [diff] [blame] | 1093 | mService.scheduleAnimationLocked(); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1094 | } |
| 1095 | return true; |
| 1096 | } |
| 1097 | |
Dianne Hackborn | f87d196 | 2012-04-04 12:48:24 -0700 | [diff] [blame] | 1098 | @Override |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1099 | public boolean hideLw(boolean doAnimation) { |
| 1100 | return hideLw(doAnimation, true); |
| 1101 | } |
| 1102 | |
| 1103 | boolean hideLw(boolean doAnimation, boolean requestAnim) { |
| 1104 | if (doAnimation) { |
Craig Mautner | 2fb98b1 | 2012-03-20 17:24:00 -0700 | [diff] [blame] | 1105 | if (!mService.okToDisplay()) { |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1106 | doAnimation = false; |
| 1107 | } |
| 1108 | } |
| 1109 | boolean current = doAnimation ? mPolicyVisibilityAfterAnim |
| 1110 | : mPolicyVisibility; |
| 1111 | if (!current) { |
Craig Mautner | e32c307 | 2012-03-12 15:25:35 -0700 | [diff] [blame] | 1112 | // Already hiding. |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1113 | return false; |
| 1114 | } |
| 1115 | if (doAnimation) { |
Craig Mautner | c2f9be0 | 2012-03-27 17:32:29 -0700 | [diff] [blame] | 1116 | mWinAnimator.applyAnimationLocked(WindowManagerPolicy.TRANSIT_EXIT, false); |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 1117 | if (mWinAnimator.mAnimation == null) { |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1118 | doAnimation = false; |
| 1119 | } |
| 1120 | } |
| 1121 | if (doAnimation) { |
| 1122 | mPolicyVisibilityAfterAnim = false; |
| 1123 | } else { |
Craig Mautner | d87946b | 2012-03-29 18:00:19 -0700 | [diff] [blame] | 1124 | if (DEBUG_VISIBILITY) Slog.v(TAG, "Policy visibility false: " + this); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1125 | mPolicyVisibilityAfterAnim = false; |
| 1126 | mPolicyVisibility = false; |
| 1127 | // Window is no longer visible -- make sure if we were waiting |
| 1128 | // for it to be displayed before enabling the display, that |
| 1129 | // we allow the display to be enabled now. |
| 1130 | mService.enableScreenIfNeededLocked(); |
| 1131 | if (mService.mCurrentFocus == this) { |
| 1132 | mService.mFocusMayChange = true; |
| 1133 | } |
| 1134 | } |
| 1135 | if (requestAnim) { |
Craig Mautner | 9686833 | 2012-12-04 14:29:11 -0800 | [diff] [blame] | 1136 | mService.scheduleAnimationLocked(); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1137 | } |
| 1138 | return true; |
| 1139 | } |
| 1140 | |
Craig Mautner | 2ad9207 | 2013-02-25 16:19:24 -0800 | [diff] [blame] | 1141 | public boolean setAppOpVisibilityLw(boolean state) { |
Dianne Hackborn | b6b23ec | 2013-02-11 19:29:06 -0800 | [diff] [blame] | 1142 | if (mAppOpVisibility != state) { |
| 1143 | mAppOpVisibility = state; |
| 1144 | if (state) { |
| 1145 | // If the policy visibility had last been to hide, then this |
| 1146 | // will incorrectly show at this point since we lost that |
| 1147 | // information. Not a big deal -- for the windows that have app |
| 1148 | // ops modifies they should only be hidden by policy due to the |
| 1149 | // lock screen, and the user won't be changing this if locked. |
| 1150 | // Plus it will quickly be fixed the next time we do a layout. |
Craig Mautner | 2ad9207 | 2013-02-25 16:19:24 -0800 | [diff] [blame] | 1151 | showLw(true, false); |
Dianne Hackborn | b6b23ec | 2013-02-11 19:29:06 -0800 | [diff] [blame] | 1152 | } else { |
Craig Mautner | 2ad9207 | 2013-02-25 16:19:24 -0800 | [diff] [blame] | 1153 | hideLw(true, false); |
Dianne Hackborn | b6b23ec | 2013-02-11 19:29:06 -0800 | [diff] [blame] | 1154 | } |
Craig Mautner | 2ad9207 | 2013-02-25 16:19:24 -0800 | [diff] [blame] | 1155 | return true; |
Dianne Hackborn | b6b23ec | 2013-02-11 19:29:06 -0800 | [diff] [blame] | 1156 | } |
Craig Mautner | 2ad9207 | 2013-02-25 16:19:24 -0800 | [diff] [blame] | 1157 | return false; |
Dianne Hackborn | b6b23ec | 2013-02-11 19:29:06 -0800 | [diff] [blame] | 1158 | } |
| 1159 | |
Dianne Hackborn | f87d196 | 2012-04-04 12:48:24 -0700 | [diff] [blame] | 1160 | @Override |
| 1161 | public boolean isAlive() { |
| 1162 | return mClient.asBinder().isBinderAlive(); |
| 1163 | } |
| 1164 | |
Craig Mautner | a987d43 | 2012-10-11 14:07:58 -0700 | [diff] [blame] | 1165 | boolean isClosing() { |
| 1166 | return mExiting || (mService.mClosingApps.contains(mAppToken)); |
| 1167 | } |
| 1168 | |
Craig Mautner | 69b0818 | 2012-09-05 13:07:13 -0700 | [diff] [blame] | 1169 | @Override |
| 1170 | public boolean isDefaultDisplay() { |
| 1171 | return mDisplayContent.isDefaultDisplay; |
| 1172 | } |
| 1173 | |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 1174 | public void setShowToOwnerOnlyLocked(boolean showToOwnerOnly) { |
| 1175 | mShowToOwnerOnly = showToOwnerOnly; |
| 1176 | } |
| 1177 | |
Craig Mautner | 5962b12 | 2012-10-05 14:45:52 -0700 | [diff] [blame] | 1178 | boolean isHiddenFromUserLocked() { |
Craig Mautner | 341220f | 2012-10-16 15:20:09 -0700 | [diff] [blame] | 1179 | // Attached windows are evaluated based on the window that they are attached to. |
| 1180 | WindowState win = this; |
| 1181 | while (win.mAttachedWindow != null) { |
| 1182 | win = win.mAttachedWindow; |
| 1183 | } |
| 1184 | if (win.mAttrs.type < WindowManager.LayoutParams.FIRST_SYSTEM_WINDOW |
| 1185 | && win.mAppToken != null && win.mAppToken.showWhenLocked) { |
| 1186 | // Save some cycles by not calling getDisplayInfo unless it is an application |
| 1187 | // window intended for all users. |
| 1188 | final DisplayInfo displayInfo = win.mDisplayContent.getDisplayInfo(); |
| 1189 | if (win.mFrame.left <= 0 && win.mFrame.top <= 0 |
| 1190 | && win.mFrame.right >= displayInfo.appWidth |
| 1191 | && win.mFrame.bottom >= displayInfo.appHeight) { |
Craig Mautner | 5962b12 | 2012-10-05 14:45:52 -0700 | [diff] [blame] | 1192 | // Is a fullscreen window, like the clock alarm. Show to everyone. |
| 1193 | return false; |
| 1194 | } |
| 1195 | } |
| 1196 | |
Craig Mautner | 341220f | 2012-10-16 15:20:09 -0700 | [diff] [blame] | 1197 | return win.mShowToOwnerOnly |
| 1198 | && UserHandle.getUserId(win.mOwnerUid) != mService.mCurrentUserId; |
Craig Mautner | 9dc52bc | 2012-08-06 14:15:42 -0700 | [diff] [blame] | 1199 | } |
| 1200 | |
Dianne Hackborn | ffb3d93 | 2011-05-17 17:44:51 -0700 | [diff] [blame] | 1201 | private static void applyInsets(Region outRegion, Rect frame, Rect inset) { |
| 1202 | outRegion.set( |
| 1203 | frame.left + inset.left, frame.top + inset.top, |
| 1204 | frame.right - inset.right, frame.bottom - inset.bottom); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 1205 | } |
| 1206 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1207 | public void getTouchableRegion(Region outRegion) { |
Dianne Hackborn | ffb3d93 | 2011-05-17 17:44:51 -0700 | [diff] [blame] | 1208 | final Rect frame = mFrame; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1209 | switch (mTouchableInsets) { |
| 1210 | default: |
| 1211 | case ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_FRAME: |
| 1212 | outRegion.set(frame); |
| 1213 | break; |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 1214 | case ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_CONTENT: |
Dianne Hackborn | ffb3d93 | 2011-05-17 17:44:51 -0700 | [diff] [blame] | 1215 | applyInsets(outRegion, frame, mGivenContentInsets); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1216 | break; |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 1217 | case ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_VISIBLE: |
Dianne Hackborn | ffb3d93 | 2011-05-17 17:44:51 -0700 | [diff] [blame] | 1218 | applyInsets(outRegion, frame, mGivenVisibleInsets); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1219 | break; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1220 | case ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION: { |
| 1221 | final Region givenTouchableRegion = mGivenTouchableRegion; |
| 1222 | outRegion.set(givenTouchableRegion); |
| 1223 | outRegion.translate(frame.left, frame.top); |
| 1224 | break; |
| 1225 | } |
| 1226 | } |
| 1227 | } |
| 1228 | |
Craig Mautner | 59c0097 | 2012-07-30 12:10:24 -0700 | [diff] [blame] | 1229 | WindowList getWindowList() { |
| 1230 | return mDisplayContent.getWindowList(); |
| 1231 | } |
| 1232 | |
Dianne Hackborn | e3f23a3 | 2013-03-01 13:25:35 -0800 | [diff] [blame] | 1233 | /** |
| 1234 | * Report a focus change. Must be called with no locks held, and consistently |
| 1235 | * from the same serialized thread (such as dispatched from a handler). |
| 1236 | */ |
| 1237 | public void reportFocusChangedSerialized(boolean focused, boolean inTouchMode) { |
| 1238 | try { |
| 1239 | mClient.windowFocusChanged(focused, inTouchMode); |
| 1240 | } catch (RemoteException e) { |
| 1241 | } |
| 1242 | if (mFocusCallbacks != null) { |
| 1243 | final int N = mFocusCallbacks.beginBroadcast(); |
| 1244 | for (int i=0; i<N; i++) { |
| 1245 | IWindowFocusObserver obs = mFocusCallbacks.getBroadcastItem(i); |
| 1246 | try { |
| 1247 | if (focused) { |
| 1248 | obs.focusGained(mWindowId.asBinder()); |
| 1249 | } else { |
| 1250 | obs.focusLost(mWindowId.asBinder()); |
| 1251 | } |
| 1252 | } catch (RemoteException e) { |
| 1253 | } |
| 1254 | } |
| 1255 | mFocusCallbacks.finishBroadcast(); |
| 1256 | } |
| 1257 | } |
| 1258 | |
| 1259 | public void registerFocusObserver(IWindowFocusObserver observer) { |
| 1260 | synchronized(mService.mWindowMap) { |
| 1261 | if (mFocusCallbacks == null) { |
| 1262 | mFocusCallbacks = new RemoteCallbackList<IWindowFocusObserver>(); |
| 1263 | } |
| 1264 | mFocusCallbacks.register(observer); |
| 1265 | } |
| 1266 | } |
| 1267 | |
| 1268 | public void unregisterFocusObserver(IWindowFocusObserver observer) { |
| 1269 | synchronized(mService.mWindowMap) { |
| 1270 | if (mFocusCallbacks != null) { |
| 1271 | mFocusCallbacks.unregister(observer); |
| 1272 | } |
| 1273 | } |
| 1274 | } |
| 1275 | |
| 1276 | public boolean isFocused() { |
| 1277 | synchronized(mService.mWindowMap) { |
| 1278 | return mService.mCurrentFocus == this; |
| 1279 | } |
| 1280 | } |
| 1281 | |
Dianne Hackborn | a44abeb | 2011-08-08 19:24:01 -0700 | [diff] [blame] | 1282 | void dump(PrintWriter pw, String prefix, boolean dumpAll) { |
Craig Mautner | 59c0097 | 2012-07-30 12:10:24 -0700 | [diff] [blame] | 1283 | pw.print(prefix); pw.print("mDisplayId="); pw.print(mDisplayContent.getDisplayId()); |
| 1284 | pw.print(" mSession="); pw.print(mSession); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1285 | pw.print(" mClient="); pw.println(mClient.asBinder()); |
Craig Mautner | 88400d3 | 2012-09-30 12:35:45 -0700 | [diff] [blame] | 1286 | pw.print(prefix); pw.print("mOwnerUid="); pw.print(mOwnerUid); |
Dianne Hackborn | c229302 | 2013-02-06 23:14:49 -0800 | [diff] [blame] | 1287 | pw.print(" mShowToOwnerOnly="); pw.print(mShowToOwnerOnly); |
| 1288 | pw.print(" package="); pw.print(mAttrs.packageName); |
| 1289 | pw.print(" appop="); pw.println(AppOpsManager.opToName(mAppOp)); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1290 | pw.print(prefix); pw.print("mAttrs="); pw.println(mAttrs); |
Dianne Hackborn | a44abeb | 2011-08-08 19:24:01 -0700 | [diff] [blame] | 1291 | pw.print(prefix); pw.print("Requested w="); pw.print(mRequestedWidth); |
| 1292 | pw.print(" h="); pw.print(mRequestedHeight); |
| 1293 | pw.print(" mLayoutSeq="); pw.println(mLayoutSeq); |
Dianne Hackborn | 1743b64 | 2012-03-12 17:04:43 -0700 | [diff] [blame] | 1294 | if (mRequestedWidth != mLastRequestedWidth || mRequestedHeight != mLastRequestedHeight) { |
| 1295 | pw.print(prefix); pw.print("LastRequested w="); pw.print(mLastRequestedWidth); |
| 1296 | pw.print(" h="); pw.println(mLastRequestedHeight); |
| 1297 | } |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1298 | if (mAttachedWindow != null || mLayoutAttached) { |
| 1299 | pw.print(prefix); pw.print("mAttachedWindow="); pw.print(mAttachedWindow); |
| 1300 | pw.print(" mLayoutAttached="); pw.println(mLayoutAttached); |
| 1301 | } |
| 1302 | if (mIsImWindow || mIsWallpaper || mIsFloatingLayer) { |
| 1303 | pw.print(prefix); pw.print("mIsImWindow="); pw.print(mIsImWindow); |
| 1304 | pw.print(" mIsWallpaper="); pw.print(mIsWallpaper); |
| 1305 | pw.print(" mIsFloatingLayer="); pw.print(mIsFloatingLayer); |
| 1306 | pw.print(" mWallpaperVisible="); pw.println(mWallpaperVisible); |
| 1307 | } |
Dianne Hackborn | a44abeb | 2011-08-08 19:24:01 -0700 | [diff] [blame] | 1308 | if (dumpAll) { |
| 1309 | pw.print(prefix); pw.print("mBaseLayer="); pw.print(mBaseLayer); |
| 1310 | pw.print(" mSubLayer="); pw.print(mSubLayer); |
| 1311 | pw.print(" mAnimLayer="); pw.print(mLayer); pw.print("+"); |
Craig Mautner | 5943163 | 2012-04-04 11:56:44 -0700 | [diff] [blame] | 1312 | pw.print((mTargetAppToken != null ? |
| 1313 | mTargetAppToken.mAppAnimator.animLayerAdjustment |
| 1314 | : (mAppToken != null ? mAppToken.mAppAnimator.animLayerAdjustment : 0))); |
Craig Mautner | c2f9be0 | 2012-03-27 17:32:29 -0700 | [diff] [blame] | 1315 | pw.print("="); pw.print(mWinAnimator.mAnimLayer); |
| 1316 | pw.print(" mLastLayer="); pw.println(mWinAnimator.mLastLayer); |
Dianne Hackborn | 6d05fd3 | 2011-11-19 14:36:15 -0800 | [diff] [blame] | 1317 | } |
Dianne Hackborn | a44abeb | 2011-08-08 19:24:01 -0700 | [diff] [blame] | 1318 | if (dumpAll) { |
| 1319 | pw.print(prefix); pw.print("mToken="); pw.println(mToken); |
| 1320 | pw.print(prefix); pw.print("mRootToken="); pw.println(mRootToken); |
| 1321 | if (mAppToken != null) { |
| 1322 | pw.print(prefix); pw.print("mAppToken="); pw.println(mAppToken); |
| 1323 | } |
| 1324 | if (mTargetAppToken != null) { |
| 1325 | pw.print(prefix); pw.print("mTargetAppToken="); pw.println(mTargetAppToken); |
| 1326 | } |
| 1327 | pw.print(prefix); pw.print("mViewVisibility=0x"); |
| 1328 | pw.print(Integer.toHexString(mViewVisibility)); |
Dianne Hackborn | a44abeb | 2011-08-08 19:24:01 -0700 | [diff] [blame] | 1329 | pw.print(" mHaveFrame="); pw.print(mHaveFrame); |
| 1330 | pw.print(" mObscured="); pw.println(mObscured); |
Dianne Hackborn | 9a230e0 | 2011-10-06 11:51:27 -0700 | [diff] [blame] | 1331 | pw.print(prefix); pw.print("mSeq="); pw.print(mSeq); |
| 1332 | pw.print(" mSystemUiVisibility=0x"); |
| 1333 | pw.println(Integer.toHexString(mSystemUiVisibility)); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1334 | } |
Dianne Hackborn | b6b23ec | 2013-02-11 19:29:06 -0800 | [diff] [blame] | 1335 | if (!mPolicyVisibility || !mPolicyVisibilityAfterAnim || !mAppOpVisibility |
| 1336 | || mAttachedHidden) { |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1337 | pw.print(prefix); pw.print("mPolicyVisibility="); |
| 1338 | pw.print(mPolicyVisibility); |
| 1339 | pw.print(" mPolicyVisibilityAfterAnim="); |
| 1340 | pw.print(mPolicyVisibilityAfterAnim); |
Dianne Hackborn | b6b23ec | 2013-02-11 19:29:06 -0800 | [diff] [blame] | 1341 | pw.print(" mAppOpVisibility="); |
| 1342 | pw.print(mAppOpVisibility); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1343 | pw.print(" mAttachedHidden="); pw.println(mAttachedHidden); |
| 1344 | } |
Dianne Hackborn | b7ff51b | 2012-01-23 19:15:27 -0800 | [diff] [blame] | 1345 | if (!mRelayoutCalled || mLayoutNeeded) { |
| 1346 | pw.print(prefix); pw.print("mRelayoutCalled="); pw.print(mRelayoutCalled); |
| 1347 | pw.print(" mLayoutNeeded="); pw.println(mLayoutNeeded); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1348 | } |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1349 | if (mXOffset != 0 || mYOffset != 0) { |
| 1350 | pw.print(prefix); pw.print("Offsets x="); pw.print(mXOffset); |
| 1351 | pw.print(" y="); pw.println(mYOffset); |
| 1352 | } |
Dianne Hackborn | a44abeb | 2011-08-08 19:24:01 -0700 | [diff] [blame] | 1353 | if (dumpAll) { |
| 1354 | pw.print(prefix); pw.print("mGivenContentInsets="); |
| 1355 | mGivenContentInsets.printShortString(pw); |
| 1356 | pw.print(" mGivenVisibleInsets="); |
| 1357 | mGivenVisibleInsets.printShortString(pw); |
| 1358 | pw.println(); |
| 1359 | if (mTouchableInsets != 0 || mGivenInsetsPending) { |
| 1360 | pw.print(prefix); pw.print("mTouchableInsets="); pw.print(mTouchableInsets); |
| 1361 | pw.print(" mGivenInsetsPending="); pw.println(mGivenInsetsPending); |
Dianne Hackborn | a4b7f2f | 2012-05-21 11:28:41 -0700 | [diff] [blame] | 1362 | Region region = new Region(); |
| 1363 | getTouchableRegion(region); |
| 1364 | pw.print(prefix); pw.print("touchable region="); pw.println(region); |
Dianne Hackborn | a44abeb | 2011-08-08 19:24:01 -0700 | [diff] [blame] | 1365 | } |
| 1366 | pw.print(prefix); pw.print("mConfiguration="); pw.println(mConfiguration); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1367 | } |
Craig Mautner | c8bc97e | 2012-04-02 12:54:54 -0700 | [diff] [blame] | 1368 | pw.print(prefix); pw.print("mHasSurface="); pw.print(mHasSurface); |
Craig Mautner | 178af59 | 2012-09-17 10:37:29 -0700 | [diff] [blame] | 1369 | pw.print(" mShownFrame="); mShownFrame.printShortString(pw); |
| 1370 | pw.print(" isReadyForDisplay()="); pw.println(isReadyForDisplay()); |
Dianne Hackborn | a44abeb | 2011-08-08 19:24:01 -0700 | [diff] [blame] | 1371 | if (dumpAll) { |
| 1372 | pw.print(prefix); pw.print("mFrame="); mFrame.printShortString(pw); |
| 1373 | pw.print(" last="); mLastFrame.printShortString(pw); |
| 1374 | pw.println(); |
Dianne Hackborn | 85afd1b | 2012-05-13 13:31:06 -0700 | [diff] [blame] | 1375 | pw.print(prefix); pw.print("mSystemDecorRect="); mSystemDecorRect.printShortString(pw); |
| 1376 | pw.print(" last="); mLastSystemDecorRect.printShortString(pw); |
| 1377 | pw.println(); |
Dianne Hackborn | a44abeb | 2011-08-08 19:24:01 -0700 | [diff] [blame] | 1378 | } |
Dianne Hackborn | ffb3d93 | 2011-05-17 17:44:51 -0700 | [diff] [blame] | 1379 | if (mEnforceSizeCompat) { |
| 1380 | pw.print(prefix); pw.print("mCompatFrame="); mCompatFrame.printShortString(pw); |
Dianne Hackborn | ffb3d93 | 2011-05-17 17:44:51 -0700 | [diff] [blame] | 1381 | pw.println(); |
| 1382 | } |
Dianne Hackborn | a44abeb | 2011-08-08 19:24:01 -0700 | [diff] [blame] | 1383 | if (dumpAll) { |
Dianne Hackborn | 5c58de3 | 2012-04-28 19:52:37 -0700 | [diff] [blame] | 1384 | pw.print(prefix); pw.print("Frames: containing="); |
Dianne Hackborn | a44abeb | 2011-08-08 19:24:01 -0700 | [diff] [blame] | 1385 | mContainingFrame.printShortString(pw); |
Dianne Hackborn | 5c58de3 | 2012-04-28 19:52:37 -0700 | [diff] [blame] | 1386 | pw.print(" parent="); mParentFrame.printShortString(pw); |
Dianne Hackborn | c4aad01 | 2013-02-22 15:05:25 -0800 | [diff] [blame] | 1387 | pw.println(); |
| 1388 | pw.print(prefix); pw.print(" display="); mDisplayFrame.printShortString(pw); |
| 1389 | pw.print(" overscan="); mOverscanFrame.printShortString(pw); |
Dianne Hackborn | a44abeb | 2011-08-08 19:24:01 -0700 | [diff] [blame] | 1390 | pw.println(); |
Dianne Hackborn | 85afd1b | 2012-05-13 13:31:06 -0700 | [diff] [blame] | 1391 | pw.print(prefix); pw.print(" content="); mContentFrame.printShortString(pw); |
Dianne Hackborn | 5c58de3 | 2012-04-28 19:52:37 -0700 | [diff] [blame] | 1392 | pw.print(" visible="); mVisibleFrame.printShortString(pw); |
Dianne Hackborn | a44abeb | 2011-08-08 19:24:01 -0700 | [diff] [blame] | 1393 | pw.println(); |
Dianne Hackborn | c4aad01 | 2013-02-22 15:05:25 -0800 | [diff] [blame] | 1394 | pw.print(prefix); pw.print("Cur insets: overscan="); |
| 1395 | mOverscanInsets.printShortString(pw); |
| 1396 | pw.print(" content="); mContentInsets.printShortString(pw); |
Dianne Hackborn | 5c58de3 | 2012-04-28 19:52:37 -0700 | [diff] [blame] | 1397 | pw.print(" visible="); mVisibleInsets.printShortString(pw); |
| 1398 | pw.println(); |
Dianne Hackborn | c4aad01 | 2013-02-22 15:05:25 -0800 | [diff] [blame] | 1399 | pw.print(prefix); pw.print("Lst insets: overscan="); |
| 1400 | mLastOverscanInsets.printShortString(pw); |
| 1401 | pw.print(" content="); mLastContentInsets.printShortString(pw); |
Dianne Hackborn | 5c58de3 | 2012-04-28 19:52:37 -0700 | [diff] [blame] | 1402 | pw.print(" visible="); mLastVisibleInsets.printShortString(pw); |
Dianne Hackborn | a44abeb | 2011-08-08 19:24:01 -0700 | [diff] [blame] | 1403 | pw.println(); |
| 1404 | } |
Dianne Hackborn | 529e744 | 2012-11-01 14:22:28 -0700 | [diff] [blame] | 1405 | pw.print(prefix); pw.print(mWinAnimator); pw.println(":"); |
| 1406 | mWinAnimator.dump(pw, prefix + " ", dumpAll); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1407 | if (mExiting || mRemoveOnExit || mDestroying || mRemoved) { |
| 1408 | pw.print(prefix); pw.print("mExiting="); pw.print(mExiting); |
| 1409 | pw.print(" mRemoveOnExit="); pw.print(mRemoveOnExit); |
| 1410 | pw.print(" mDestroying="); pw.print(mDestroying); |
| 1411 | pw.print(" mRemoved="); pw.println(mRemoved); |
| 1412 | } |
| 1413 | if (mOrientationChanging || mAppFreezing || mTurnOnScreen) { |
| 1414 | pw.print(prefix); pw.print("mOrientationChanging="); |
| 1415 | pw.print(mOrientationChanging); |
| 1416 | pw.print(" mAppFreezing="); pw.print(mAppFreezing); |
| 1417 | pw.print(" mTurnOnScreen="); pw.println(mTurnOnScreen); |
| 1418 | } |
Dianne Hackborn | a57c695 | 2013-03-29 14:46:40 -0700 | [diff] [blame] | 1419 | if (mLastFreezeDuration != 0) { |
| 1420 | pw.print(prefix); pw.print("mLastFreezeDuration="); |
| 1421 | TimeUtils.formatDuration(mLastFreezeDuration, pw); pw.println(); |
| 1422 | } |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1423 | if (mHScale != 1 || mVScale != 1) { |
| 1424 | pw.print(prefix); pw.print("mHScale="); pw.print(mHScale); |
| 1425 | pw.print(" mVScale="); pw.println(mVScale); |
| 1426 | } |
| 1427 | if (mWallpaperX != -1 || mWallpaperY != -1) { |
| 1428 | pw.print(prefix); pw.print("mWallpaperX="); pw.print(mWallpaperX); |
| 1429 | pw.print(" mWallpaperY="); pw.println(mWallpaperY); |
| 1430 | } |
| 1431 | if (mWallpaperXStep != -1 || mWallpaperYStep != -1) { |
| 1432 | pw.print(prefix); pw.print("mWallpaperXStep="); pw.print(mWallpaperXStep); |
| 1433 | pw.print(" mWallpaperYStep="); pw.println(mWallpaperYStep); |
| 1434 | } |
| 1435 | } |
Craig Mautner | 164d4bb | 2012-11-26 13:51:23 -0800 | [diff] [blame] | 1436 | |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1437 | String makeInputChannelName() { |
| 1438 | return Integer.toHexString(System.identityHashCode(this)) |
| 1439 | + " " + mAttrs.getTitle(); |
| 1440 | } |
| 1441 | |
| 1442 | @Override |
| 1443 | public String toString() { |
Dianne Hackborn | c229302 | 2013-02-06 23:14:49 -0800 | [diff] [blame] | 1444 | CharSequence title = mAttrs.getTitle(); |
| 1445 | if (title == null || title.length() <= 0) { |
| 1446 | title = mAttrs.packageName; |
| 1447 | } |
| 1448 | if (mStringNameCache == null || mLastTitle != title || mWasExiting != mExiting) { |
| 1449 | mLastTitle = title; |
Dianne Hackborn | 529e744 | 2012-11-01 14:22:28 -0700 | [diff] [blame] | 1450 | mWasExiting = mExiting; |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1451 | mStringNameCache = "Window{" + Integer.toHexString(System.identityHashCode(this)) |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 1452 | + " u" + UserHandle.getUserId(mSession.mUid) |
Craig Mautner | a987d43 | 2012-10-11 14:07:58 -0700 | [diff] [blame] | 1453 | + " " + mLastTitle + (mExiting ? " EXITING}" : "}"); |
Dianne Hackborn | 6e1eb76 | 2011-02-17 16:07:28 -0800 | [diff] [blame] | 1454 | } |
| 1455 | return mStringNameCache; |
| 1456 | } |
satok | cef37fb | 2011-10-24 21:49:38 +0900 | [diff] [blame] | 1457 | } |