Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 1 | // Copyright 2012 Google Inc. All Rights Reserved. |
| 2 | |
| 3 | package com.android.server.wm; |
| 4 | |
| 5 | import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER; |
| 6 | |
Craig Mautner | a608b88 | 2012-03-30 13:03:49 -0700 | [diff] [blame] | 7 | import static com.android.server.wm.WindowManagerService.LayoutFields.SET_UPDATE_ROTATION; |
| 8 | import static com.android.server.wm.WindowManagerService.LayoutFields.SET_WALLPAPER_MAY_CHANGE; |
Craig Mautner | d09cc4b | 2012-04-04 10:23:31 -0700 | [diff] [blame] | 9 | import static com.android.server.wm.WindowManagerService.LayoutFields.SET_FORCE_HIDING_CHANGED; |
| 10 | |
| 11 | import static com.android.server.wm.WindowManagerService.H.SET_DIM_PARAMETERS; |
Craig Mautner | a608b88 | 2012-03-30 13:03:49 -0700 | [diff] [blame] | 12 | |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 13 | import android.content.Context; |
| 14 | import android.os.SystemClock; |
| 15 | import android.util.Log; |
| 16 | import android.util.Slog; |
| 17 | import android.view.Surface; |
| 18 | import android.view.WindowManager; |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 19 | import android.view.WindowManagerPolicy; |
| 20 | import android.view.animation.Animation; |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 21 | |
| 22 | import com.android.internal.policy.impl.PhoneWindowManager; |
| 23 | |
Craig Mautner | e7ae250 | 2012-03-26 17:11:19 -0700 | [diff] [blame] | 24 | import java.io.PrintWriter; |
Dianne Hackborn | 0c2acff | 2012-04-12 15:17:07 -0700 | [diff] [blame] | 25 | import java.util.ArrayList; |
Craig Mautner | e7ae250 | 2012-03-26 17:11:19 -0700 | [diff] [blame] | 26 | |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 27 | /** |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 28 | * Singleton class that carries out the animations and Surface operations in a separate task |
| 29 | * on behalf of WindowManagerService. |
| 30 | */ |
| 31 | public class WindowAnimator { |
Craig Mautner | bb1449b | 2012-03-23 16:11:14 -0700 | [diff] [blame] | 32 | private static final String TAG = "WindowAnimator"; |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 33 | |
| 34 | final WindowManagerService mService; |
| 35 | final Context mContext; |
| 36 | final WindowManagerPolicy mPolicy; |
| 37 | |
Craig Mautner | 7358fbf | 2012-04-12 21:06:33 -0700 | [diff] [blame] | 38 | ArrayList<WindowStateAnimator> mWinAnimators = new ArrayList<WindowStateAnimator>(); |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 39 | |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 40 | boolean mAnimating; |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 41 | boolean mTokenMayBeDrawn; |
| 42 | boolean mForceHiding; |
| 43 | WindowState mWindowAnimationBackground; |
| 44 | int mWindowAnimationBackgroundColor; |
| 45 | int mAdjResult; |
| 46 | |
| 47 | int mPendingLayoutChanges; |
| 48 | |
| 49 | /** Overall window dimensions */ |
| 50 | int mDw, mDh; |
| 51 | |
| 52 | /** Interior window dimensions */ |
| 53 | int mInnerDw, mInnerDh; |
| 54 | |
| 55 | /** Time of current animation step. Reset on each iteration */ |
| 56 | long mCurrentTime; |
| 57 | |
| 58 | /** Skip repeated AppWindowTokens initialization. Note that AppWindowsToken's version of this |
| 59 | * is a long initialized to Long.MIN_VALUE so that it doesn't match this value on startup. */ |
| 60 | private int mTransactionSequence; |
| 61 | |
| 62 | /** The one and only screen rotation if one is happening */ |
| 63 | ScreenRotationAnimation mScreenRotationAnimation = null; |
| 64 | |
Craig Mautner | e7ae250 | 2012-03-26 17:11:19 -0700 | [diff] [blame] | 65 | // Window currently running an animation that has requested it be detached |
| 66 | // from the wallpaper. This means we need to ensure the wallpaper is |
| 67 | // visible behind it in case it animates in a way that would allow it to be |
| 68 | // seen. |
| 69 | WindowState mWindowDetachedWallpaper = null; |
| 70 | WindowState mDetachedWallpaper = null; |
Craig Mautner | e7ae250 | 2012-03-26 17:11:19 -0700 | [diff] [blame] | 71 | DimSurface mWindowAnimationBackgroundSurface = null; |
| 72 | |
Craig Mautner | a608b88 | 2012-03-30 13:03:49 -0700 | [diff] [blame] | 73 | int mBulkUpdateParams = 0; |
| 74 | |
Craig Mautner | d09cc4b | 2012-04-04 10:23:31 -0700 | [diff] [blame] | 75 | DimAnimator mDimAnimator = null; |
| 76 | DimAnimator.Parameters mDimParams = null; |
| 77 | |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 78 | WindowAnimator(final WindowManagerService service, final Context context, |
| 79 | final WindowManagerPolicy policy) { |
| 80 | mService = service; |
| 81 | mContext = context; |
| 82 | mPolicy = policy; |
| 83 | } |
| 84 | |
Craig Mautner | e7ae250 | 2012-03-26 17:11:19 -0700 | [diff] [blame] | 85 | private void testWallpaperAndBackgroundLocked() { |
| 86 | if (mWindowDetachedWallpaper != mDetachedWallpaper) { |
| 87 | if (WindowManagerService.DEBUG_WALLPAPER) Slog.v(TAG, |
| 88 | "Detached wallpaper changed from " + mWindowDetachedWallpaper |
| 89 | + " to " + mDetachedWallpaper); |
| 90 | mWindowDetachedWallpaper = mDetachedWallpaper; |
Craig Mautner | a608b88 | 2012-03-30 13:03:49 -0700 | [diff] [blame] | 91 | mBulkUpdateParams |= SET_WALLPAPER_MAY_CHANGE; |
Craig Mautner | e7ae250 | 2012-03-26 17:11:19 -0700 | [diff] [blame] | 92 | } |
| 93 | |
| 94 | if (mWindowAnimationBackgroundColor != 0) { |
| 95 | // If the window that wants black is the current wallpaper |
| 96 | // target, then the black goes *below* the wallpaper so we |
| 97 | // don't cause the wallpaper to suddenly disappear. |
| 98 | WindowState target = mWindowAnimationBackground; |
| 99 | if (mService.mWallpaperTarget == target |
| 100 | || mService.mLowerWallpaperTarget == target |
| 101 | || mService.mUpperWallpaperTarget == target) { |
Craig Mautner | d09cc4b | 2012-04-04 10:23:31 -0700 | [diff] [blame] | 102 | final int N = mService.mWindows.size(); |
| 103 | for (int i = 0; i < N; i++) { |
Craig Mautner | e7ae250 | 2012-03-26 17:11:19 -0700 | [diff] [blame] | 104 | WindowState w = mService.mWindows.get(i); |
| 105 | if (w.mIsWallpaper) { |
| 106 | target = w; |
| 107 | break; |
| 108 | } |
| 109 | } |
| 110 | } |
| 111 | if (mWindowAnimationBackgroundSurface == null) { |
| 112 | mWindowAnimationBackgroundSurface = new DimSurface(mService.mFxSession); |
| 113 | } |
| 114 | final int dw = mDw; |
| 115 | final int dh = mDh; |
| 116 | mWindowAnimationBackgroundSurface.show(dw, dh, |
Craig Mautner | c2f9be0 | 2012-03-27 17:32:29 -0700 | [diff] [blame] | 117 | target.mWinAnimator.mAnimLayer - WindowManagerService.LAYER_OFFSET_DIM, |
Craig Mautner | e7ae250 | 2012-03-26 17:11:19 -0700 | [diff] [blame] | 118 | mWindowAnimationBackgroundColor); |
| 119 | } else if (mWindowAnimationBackgroundSurface != null) { |
| 120 | mWindowAnimationBackgroundSurface.hide(); |
| 121 | } |
| 122 | } |
| 123 | |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 124 | private void updateWindowsAppsAndRotationAnimationsLocked() { |
| 125 | int i; |
| 126 | final int NAT = mService.mAppTokens.size(); |
| 127 | for (i=0; i<NAT; i++) { |
Craig Mautner | 5943163 | 2012-04-04 11:56:44 -0700 | [diff] [blame] | 128 | final AppWindowAnimator appAnimator = mService.mAppTokens.get(i).mAppAnimator; |
| 129 | final boolean wasAnimating = appAnimator.animation != null |
| 130 | && appAnimator.animation != WindowManagerService.sDummyAnimation; |
| 131 | if (appAnimator.stepAnimationLocked(mCurrentTime, mInnerDw, mInnerDh)) { |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 132 | mAnimating = true; |
Craig Mautner | bb1449b | 2012-03-23 16:11:14 -0700 | [diff] [blame] | 133 | } else if (wasAnimating) { |
| 134 | // stopped animating, do one more pass through the layout |
| 135 | mPendingLayoutChanges |= WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER; |
Craig Mautner | cf8cbbe | 2012-03-25 21:54:36 -0700 | [diff] [blame] | 136 | if (WindowManagerService.DEBUG_LAYOUT_REPEATS) { |
Craig Mautner | 5943163 | 2012-04-04 11:56:44 -0700 | [diff] [blame] | 137 | mService.debugLayoutRepeats("appToken " + appAnimator.mAppToken + " done", |
Craig Mautner | d09cc4b | 2012-04-04 10:23:31 -0700 | [diff] [blame] | 138 | mPendingLayoutChanges); |
Craig Mautner | cf8cbbe | 2012-03-25 21:54:36 -0700 | [diff] [blame] | 139 | } |
Craig Mautner | bb1449b | 2012-03-23 16:11:14 -0700 | [diff] [blame] | 140 | } |
| 141 | } |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 142 | |
Craig Mautner | bb1449b | 2012-03-23 16:11:14 -0700 | [diff] [blame] | 143 | final int NEAT = mService.mExitingAppTokens.size(); |
| 144 | for (i=0; i<NEAT; i++) { |
Craig Mautner | e4d8a5d | 2012-04-05 13:10:37 -0700 | [diff] [blame] | 145 | final AppWindowAnimator appAnimator = mService.mExitingAppTokens.get(i).mAppAnimator; |
Craig Mautner | 5943163 | 2012-04-04 11:56:44 -0700 | [diff] [blame] | 146 | final boolean wasAnimating = appAnimator.animation != null |
| 147 | && appAnimator.animation != WindowManagerService.sDummyAnimation; |
| 148 | if (appAnimator.stepAnimationLocked(mCurrentTime, mInnerDw, mInnerDh)) { |
Craig Mautner | bb1449b | 2012-03-23 16:11:14 -0700 | [diff] [blame] | 149 | mAnimating = true; |
| 150 | } else if (wasAnimating) { |
| 151 | // stopped animating, do one more pass through the layout |
| 152 | mPendingLayoutChanges |= WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER; |
Craig Mautner | cf8cbbe | 2012-03-25 21:54:36 -0700 | [diff] [blame] | 153 | if (WindowManagerService.DEBUG_LAYOUT_REPEATS) { |
Craig Mautner | 5943163 | 2012-04-04 11:56:44 -0700 | [diff] [blame] | 154 | mService.debugLayoutRepeats("exiting appToken " + appAnimator.mAppToken |
| 155 | + " done", mPendingLayoutChanges); |
Craig Mautner | cf8cbbe | 2012-03-25 21:54:36 -0700 | [diff] [blame] | 156 | } |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 157 | } |
| 158 | } |
| 159 | |
Dianne Hackborn | 187ae210 | 2012-04-11 18:12:06 -0700 | [diff] [blame] | 160 | if (mScreenRotationAnimation != null && mScreenRotationAnimation.isAnimating()) { |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 161 | if (mScreenRotationAnimation.stepAnimationLocked(mCurrentTime)) { |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 162 | mAnimating = true; |
| 163 | } else { |
Craig Mautner | a608b88 | 2012-03-30 13:03:49 -0700 | [diff] [blame] | 164 | mBulkUpdateParams |= SET_UPDATE_ROTATION; |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 165 | mScreenRotationAnimation.kill(); |
| 166 | mScreenRotationAnimation = null; |
| 167 | } |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | private void updateWindowsAndWallpaperLocked() { |
| 172 | ++mTransactionSequence; |
| 173 | |
Dianne Hackborn | 0c2acff | 2012-04-12 15:17:07 -0700 | [diff] [blame] | 174 | ArrayList<WindowStateAnimator> unForceHiding = null; |
| 175 | boolean wallpaperInUnForceHiding = false; |
| 176 | |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 177 | for (int i = mService.mWindows.size() - 1; i >= 0; i--) { |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 178 | WindowState win = mService.mWindows.get(i); |
| 179 | WindowStateAnimator winAnimator = win.mWinAnimator; |
| 180 | final int flags = winAnimator.mAttrFlags; |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 181 | |
Craig Mautner | c2f9be0 | 2012-03-27 17:32:29 -0700 | [diff] [blame] | 182 | if (winAnimator.mSurface != null) { |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 183 | final boolean wasAnimating = winAnimator.mWasAnimating; |
| 184 | final boolean nowAnimating = winAnimator.stepAnimationLocked(mCurrentTime); |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 185 | |
| 186 | if (WindowManagerService.DEBUG_WALLPAPER) { |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 187 | Slog.v(TAG, win + ": wasAnimating=" + wasAnimating + |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 188 | ", nowAnimating=" + nowAnimating); |
| 189 | } |
| 190 | |
| 191 | // If this window is animating, make a note that we have |
| 192 | // an animating window and take care of a request to run |
| 193 | // a detached wallpaper animation. |
| 194 | if (nowAnimating) { |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 195 | if (winAnimator.mAnimation != null) { |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 196 | if ((flags & FLAG_SHOW_WALLPAPER) != 0 |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 197 | && winAnimator.mAnimation.getDetachWallpaper()) { |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 198 | mDetachedWallpaper = win; |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 199 | } |
Craig Mautner | d09cc4b | 2012-04-04 10:23:31 -0700 | [diff] [blame] | 200 | final int backgroundColor = winAnimator.mAnimation.getBackgroundColor(); |
| 201 | if (backgroundColor != 0) { |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 202 | if (mWindowAnimationBackground == null |
Craig Mautner | c2f9be0 | 2012-03-27 17:32:29 -0700 | [diff] [blame] | 203 | || (winAnimator.mAnimLayer < |
| 204 | mWindowAnimationBackground.mWinAnimator.mAnimLayer)) { |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 205 | mWindowAnimationBackground = win; |
Craig Mautner | d09cc4b | 2012-04-04 10:23:31 -0700 | [diff] [blame] | 206 | mWindowAnimationBackgroundColor = backgroundColor; |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 207 | } |
| 208 | } |
| 209 | } |
| 210 | mAnimating = true; |
| 211 | } |
| 212 | |
| 213 | // If this window's app token is running a detached wallpaper |
| 214 | // animation, make a note so we can ensure the wallpaper is |
| 215 | // displayed behind it. |
Craig Mautner | 5943163 | 2012-04-04 11:56:44 -0700 | [diff] [blame] | 216 | final AppWindowAnimator appAnimator = |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 217 | win.mAppToken == null ? null : win.mAppToken.mAppAnimator; |
Craig Mautner | 5943163 | 2012-04-04 11:56:44 -0700 | [diff] [blame] | 218 | if (appAnimator != null && appAnimator.animation != null |
| 219 | && appAnimator.animating) { |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 220 | if ((flags & FLAG_SHOW_WALLPAPER) != 0 |
Craig Mautner | 5943163 | 2012-04-04 11:56:44 -0700 | [diff] [blame] | 221 | && appAnimator.animation.getDetachWallpaper()) { |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 222 | mDetachedWallpaper = win; |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 223 | } |
Craig Mautner | 5943163 | 2012-04-04 11:56:44 -0700 | [diff] [blame] | 224 | final int backgroundColor = appAnimator.animation.getBackgroundColor(); |
Craig Mautner | d09cc4b | 2012-04-04 10:23:31 -0700 | [diff] [blame] | 225 | if (backgroundColor != 0) { |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 226 | if (mWindowAnimationBackground == null |
Craig Mautner | c2f9be0 | 2012-03-27 17:32:29 -0700 | [diff] [blame] | 227 | || (winAnimator.mAnimLayer < |
| 228 | mWindowAnimationBackground.mWinAnimator.mAnimLayer)) { |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 229 | mWindowAnimationBackground = win; |
Craig Mautner | d09cc4b | 2012-04-04 10:23:31 -0700 | [diff] [blame] | 230 | mWindowAnimationBackgroundColor = backgroundColor; |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 231 | } |
| 232 | } |
| 233 | } |
| 234 | |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 235 | if (wasAnimating && !winAnimator.mAnimating && mService.mWallpaperTarget == win) { |
Craig Mautner | a608b88 | 2012-03-30 13:03:49 -0700 | [diff] [blame] | 236 | mBulkUpdateParams |= SET_WALLPAPER_MAY_CHANGE; |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 237 | mPendingLayoutChanges |= WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER; |
Craig Mautner | cf8cbbe | 2012-03-25 21:54:36 -0700 | [diff] [blame] | 238 | if (WindowManagerService.DEBUG_LAYOUT_REPEATS) { |
Craig Mautner | d09cc4b | 2012-04-04 10:23:31 -0700 | [diff] [blame] | 239 | mService.debugLayoutRepeats("updateWindowsAndWallpaperLocked 2", |
| 240 | mPendingLayoutChanges); |
Craig Mautner | cf8cbbe | 2012-03-25 21:54:36 -0700 | [diff] [blame] | 241 | } |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 242 | } |
| 243 | |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 244 | if (mPolicy.doesForceHide(win, win.mAttrs)) { |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 245 | if (!wasAnimating && nowAnimating) { |
| 246 | if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(TAG, |
| 247 | "Animation started that could impact force hide: " |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 248 | + win); |
Craig Mautner | d09cc4b | 2012-04-04 10:23:31 -0700 | [diff] [blame] | 249 | mBulkUpdateParams |= SET_FORCE_HIDING_CHANGED; |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 250 | mPendingLayoutChanges |= WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER; |
Craig Mautner | cf8cbbe | 2012-03-25 21:54:36 -0700 | [diff] [blame] | 251 | if (WindowManagerService.DEBUG_LAYOUT_REPEATS) { |
Craig Mautner | d09cc4b | 2012-04-04 10:23:31 -0700 | [diff] [blame] | 252 | mService.debugLayoutRepeats("updateWindowsAndWallpaperLocked 3", |
| 253 | mPendingLayoutChanges); |
Craig Mautner | cf8cbbe | 2012-03-25 21:54:36 -0700 | [diff] [blame] | 254 | } |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 255 | mService.mFocusMayChange = true; |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 256 | } else if (win.isReadyForDisplay() && winAnimator.mAnimation == null) { |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 257 | mForceHiding = true; |
| 258 | } |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 259 | } else if (mPolicy.canBeForceHidden(win, win.mAttrs)) { |
Craig Mautner | d09cc4b | 2012-04-04 10:23:31 -0700 | [diff] [blame] | 260 | final boolean changed; |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 261 | if (mForceHiding) { |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 262 | changed = win.hideLw(false, false); |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 263 | if (WindowManagerService.DEBUG_VISIBILITY && changed) Slog.v(TAG, |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 264 | "Now policy hidden: " + win); |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 265 | } else { |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 266 | changed = win.showLw(false, false); |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 267 | if (WindowManagerService.DEBUG_VISIBILITY && changed) Slog.v(TAG, |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 268 | "Now policy shown: " + win); |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 269 | if (changed) { |
Craig Mautner | d09cc4b | 2012-04-04 10:23:31 -0700 | [diff] [blame] | 270 | if ((mBulkUpdateParams & SET_FORCE_HIDING_CHANGED) != 0 |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 271 | && win.isVisibleNow() /*w.isReadyForDisplay()*/) { |
Dianne Hackborn | 0c2acff | 2012-04-12 15:17:07 -0700 | [diff] [blame] | 272 | if (unForceHiding == null) { |
| 273 | unForceHiding = new ArrayList<WindowStateAnimator>(); |
| 274 | } |
| 275 | unForceHiding.add(winAnimator); |
| 276 | if ((win.mAttrs.flags&WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER) != 0) { |
| 277 | wallpaperInUnForceHiding = true; |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 278 | } |
| 279 | } |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 280 | if (mCurrentFocus == null || mCurrentFocus.mLayer < win.mLayer) { |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 281 | // We are showing on to of the current |
| 282 | // focus, so re-evaluate focus to make |
| 283 | // sure it is correct. |
| 284 | mService.mFocusMayChange = true; |
| 285 | } |
| 286 | } |
| 287 | } |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 288 | if (changed && (flags & WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER) != 0) { |
Craig Mautner | a608b88 | 2012-03-30 13:03:49 -0700 | [diff] [blame] | 289 | mBulkUpdateParams |= SET_WALLPAPER_MAY_CHANGE; |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 290 | mPendingLayoutChanges |= WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER; |
Craig Mautner | cf8cbbe | 2012-03-25 21:54:36 -0700 | [diff] [blame] | 291 | if (WindowManagerService.DEBUG_LAYOUT_REPEATS) { |
Craig Mautner | d09cc4b | 2012-04-04 10:23:31 -0700 | [diff] [blame] | 292 | mService.debugLayoutRepeats("updateWindowsAndWallpaperLocked 4", |
| 293 | mPendingLayoutChanges); |
Craig Mautner | cf8cbbe | 2012-03-25 21:54:36 -0700 | [diff] [blame] | 294 | } |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 295 | } |
| 296 | } |
| 297 | } |
| 298 | |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 299 | final AppWindowToken atoken = win.mAppToken; |
Craig Mautner | 5943163 | 2012-04-04 11:56:44 -0700 | [diff] [blame] | 300 | if (atoken != null && (!atoken.allDrawn || atoken.mAppAnimator.freezingScreen)) { |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 301 | if (atoken.lastTransactionSequence != mTransactionSequence) { |
| 302 | atoken.lastTransactionSequence = mTransactionSequence; |
| 303 | atoken.numInterestingWindows = atoken.numDrawnWindows = 0; |
| 304 | atoken.startingDisplayed = false; |
| 305 | } |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 306 | if ((win.isOnScreen() || winAnimator.mAttrType |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 307 | == WindowManager.LayoutParams.TYPE_BASE_APPLICATION) |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 308 | && !win.mExiting && !win.mDestroying) { |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 309 | if (WindowManagerService.DEBUG_VISIBILITY || |
| 310 | WindowManagerService.DEBUG_ORIENTATION) { |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 311 | Slog.v(TAG, "Eval win " + win + ": isDrawn=" + win.isDrawnLw() |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 312 | + ", isAnimating=" + winAnimator.isAnimating()); |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 313 | if (!win.isDrawnLw()) { |
Craig Mautner | c2f9be0 | 2012-03-27 17:32:29 -0700 | [diff] [blame] | 314 | Slog.v(TAG, "Not displayed: s=" + winAnimator.mSurface |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 315 | + " pv=" + win.mPolicyVisibility |
Craig Mautner | 749a7bb | 2012-04-02 13:49:53 -0700 | [diff] [blame] | 316 | + " mDrawState=" + winAnimator.mDrawState |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 317 | + " ah=" + win.mAttachedHidden |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 318 | + " th=" + atoken.hiddenRequested |
Craig Mautner | a2c7705 | 2012-03-26 12:14:43 -0700 | [diff] [blame] | 319 | + " a=" + winAnimator.mAnimating); |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 320 | } |
| 321 | } |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 322 | if (win != atoken.startingWindow) { |
| 323 | if (!atoken.mAppAnimator.freezingScreen || !win.mAppFreezing) { |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 324 | atoken.numInterestingWindows++; |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 325 | if (win.isDrawnLw()) { |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 326 | atoken.numDrawnWindows++; |
| 327 | if (WindowManagerService.DEBUG_VISIBILITY || |
| 328 | WindowManagerService.DEBUG_ORIENTATION) Slog.v(TAG, |
| 329 | "tokenMayBeDrawn: " + atoken |
Craig Mautner | 5943163 | 2012-04-04 11:56:44 -0700 | [diff] [blame] | 330 | + " freezingScreen=" + atoken.mAppAnimator.freezingScreen |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 331 | + " mAppFreezing=" + win.mAppFreezing); |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 332 | mTokenMayBeDrawn = true; |
| 333 | } |
| 334 | } |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 335 | } else if (win.isDrawnLw()) { |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 336 | atoken.startingDisplayed = true; |
| 337 | } |
| 338 | } |
Craig Mautner | 749a7bb | 2012-04-02 13:49:53 -0700 | [diff] [blame] | 339 | } else if (winAnimator.mDrawState == WindowStateAnimator.READY_TO_SHOW) { |
Craig Mautner | c2f9be0 | 2012-03-27 17:32:29 -0700 | [diff] [blame] | 340 | if (winAnimator.performShowLocked()) { |
Craig Mautner | cf8cbbe | 2012-03-25 21:54:36 -0700 | [diff] [blame] | 341 | mPendingLayoutChanges |= WindowManagerPolicy.FINISH_LAYOUT_REDO_ANIM; |
| 342 | if (WindowManagerService.DEBUG_LAYOUT_REPEATS) { |
Craig Mautner | d09cc4b | 2012-04-04 10:23:31 -0700 | [diff] [blame] | 343 | mService.debugLayoutRepeats("updateWindowsAndWallpaperLocked 5", |
| 344 | mPendingLayoutChanges); |
Craig Mautner | cf8cbbe | 2012-03-25 21:54:36 -0700 | [diff] [blame] | 345 | } |
| 346 | } |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 347 | } |
Craig Mautner | 5943163 | 2012-04-04 11:56:44 -0700 | [diff] [blame] | 348 | final AppWindowAnimator appAnimator = |
| 349 | atoken == null ? null : atoken.mAppAnimator; |
| 350 | if (appAnimator != null && appAnimator.thumbnail != null) { |
| 351 | if (appAnimator.thumbnailTransactionSeq != mTransactionSequence) { |
| 352 | appAnimator.thumbnailTransactionSeq = mTransactionSequence; |
| 353 | appAnimator.thumbnailLayer = 0; |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 354 | } |
Craig Mautner | 5943163 | 2012-04-04 11:56:44 -0700 | [diff] [blame] | 355 | if (appAnimator.thumbnailLayer < winAnimator.mAnimLayer) { |
| 356 | appAnimator.thumbnailLayer = winAnimator.mAnimLayer; |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 357 | } |
| 358 | } |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 359 | } // end forall windows |
Dianne Hackborn | 0c2acff | 2012-04-12 15:17:07 -0700 | [diff] [blame] | 360 | |
| 361 | // If we have windows that are being show due to them no longer |
| 362 | // being force-hidden, apply the appropriate animation to them. |
| 363 | if (unForceHiding != null) { |
| 364 | for (int i=unForceHiding.size()-1; i>=0; i--) { |
| 365 | Animation a = mPolicy.createForceHideEnterAnimation(wallpaperInUnForceHiding); |
| 366 | if (a != null) { |
| 367 | unForceHiding.get(i).setAnimation(a); |
| 368 | } |
| 369 | } |
| 370 | } |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 371 | } |
| 372 | |
| 373 | private void testTokenMayBeDrawnLocked() { |
| 374 | // See if any windows have been drawn, so they (and others |
| 375 | // associated with them) can now be shown. |
| 376 | final int NT = mService.mAppTokens.size(); |
| 377 | for (int i=0; i<NT; i++) { |
| 378 | AppWindowToken wtoken = mService.mAppTokens.get(i); |
Craig Mautner | 5943163 | 2012-04-04 11:56:44 -0700 | [diff] [blame] | 379 | if (wtoken.mAppAnimator.freezingScreen) { |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 380 | int numInteresting = wtoken.numInterestingWindows; |
| 381 | if (numInteresting > 0 && wtoken.numDrawnWindows >= numInteresting) { |
| 382 | if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(TAG, |
| 383 | "allDrawn: " + wtoken |
| 384 | + " interesting=" + numInteresting |
| 385 | + " drawn=" + wtoken.numDrawnWindows); |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 386 | wtoken.mAppAnimator.showAllWindowsLocked(); |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 387 | mService.unsetAppFreezingScreenLocked(wtoken, false, true); |
| 388 | if (WindowManagerService.DEBUG_ORIENTATION) Slog.i(TAG, |
| 389 | "Setting mOrientationChangeComplete=true because wtoken " |
| 390 | + wtoken + " numInteresting=" + numInteresting |
| 391 | + " numDrawn=" + wtoken.numDrawnWindows); |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 392 | } |
| 393 | } else if (!wtoken.allDrawn) { |
| 394 | int numInteresting = wtoken.numInterestingWindows; |
| 395 | if (numInteresting > 0 && wtoken.numDrawnWindows >= numInteresting) { |
| 396 | if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(TAG, |
| 397 | "allDrawn: " + wtoken |
| 398 | + " interesting=" + numInteresting |
| 399 | + " drawn=" + wtoken.numDrawnWindows); |
| 400 | wtoken.allDrawn = true; |
| 401 | mPendingLayoutChanges |= PhoneWindowManager.FINISH_LAYOUT_REDO_ANIM; |
Craig Mautner | cf8cbbe | 2012-03-25 21:54:36 -0700 | [diff] [blame] | 402 | if (WindowManagerService.DEBUG_LAYOUT_REPEATS) { |
Craig Mautner | d09cc4b | 2012-04-04 10:23:31 -0700 | [diff] [blame] | 403 | mService.debugLayoutRepeats("testTokenMayBeDrawnLocked", |
| 404 | mPendingLayoutChanges); |
Craig Mautner | cf8cbbe | 2012-03-25 21:54:36 -0700 | [diff] [blame] | 405 | } |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 406 | |
| 407 | // We can now show all of the drawn windows! |
| 408 | if (!mService.mOpeningApps.contains(wtoken)) { |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 409 | mAnimating |= wtoken.mAppAnimator.showAllWindowsLocked(); |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 410 | } |
| 411 | } |
| 412 | } |
| 413 | } |
| 414 | } |
| 415 | |
| 416 | private void performAnimationsLocked() { |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 417 | mTokenMayBeDrawn = false; |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 418 | mForceHiding = false; |
Craig Mautner | c2f9be0 | 2012-03-27 17:32:29 -0700 | [diff] [blame] | 419 | mDetachedWallpaper = null; |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 420 | mWindowAnimationBackground = null; |
| 421 | mWindowAnimationBackgroundColor = 0; |
| 422 | |
| 423 | updateWindowsAndWallpaperLocked(); |
| 424 | |
| 425 | if (mTokenMayBeDrawn) { |
| 426 | testTokenMayBeDrawnLocked(); |
| 427 | } |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 428 | } |
| 429 | |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 430 | void animate() { |
Craig Mautner | bb1449b | 2012-03-23 16:11:14 -0700 | [diff] [blame] | 431 | mPendingLayoutChanges = 0; |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 432 | mCurrentTime = SystemClock.uptimeMillis(); |
Craig Mautner | a608b88 | 2012-03-30 13:03:49 -0700 | [diff] [blame] | 433 | mBulkUpdateParams = 0; |
Craig Mautner | 7d8df39 | 2012-04-06 15:26:23 -0700 | [diff] [blame^] | 434 | mAnimating = false; |
| 435 | if (WindowManagerService.DEBUG_WINDOW_TRACE) { |
| 436 | Slog.i(TAG, "!!! animate: entry time=" + mCurrentTime); |
| 437 | } |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 438 | |
| 439 | // Update animations of all applications, including those |
| 440 | // associated with exiting/removed apps |
| 441 | Surface.openTransaction(); |
| 442 | |
| 443 | try { |
Craig Mautner | e7ae250 | 2012-03-26 17:11:19 -0700 | [diff] [blame] | 444 | testWallpaperAndBackgroundLocked(); |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 445 | updateWindowsAppsAndRotationAnimationsLocked(); |
| 446 | performAnimationsLocked(); |
| 447 | |
| 448 | // THIRD LOOP: Update the surfaces of all windows. |
| 449 | |
| 450 | if (mScreenRotationAnimation != null) { |
| 451 | mScreenRotationAnimation.updateSurfaces(); |
| 452 | } |
| 453 | |
Craig Mautner | 7358fbf | 2012-04-12 21:06:33 -0700 | [diff] [blame] | 454 | final int N = mWinAnimators.size(); |
| 455 | for (int i = 0; i < N; i++) { |
| 456 | mWinAnimators.get(i).prepareSurfaceLocked(true); |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 457 | } |
| 458 | |
Craig Mautner | 6af9b92 | 2012-04-05 19:25:51 -0700 | [diff] [blame] | 459 | if (mDimParams != null) { |
| 460 | mDimAnimator.updateParameters(mContext.getResources(), mDimParams, mCurrentTime); |
| 461 | } |
Craig Mautner | d09cc4b | 2012-04-04 10:23:31 -0700 | [diff] [blame] | 462 | if (mDimAnimator != null && mDimAnimator.mDimShown) { |
Craig Mautner | f8d4fbb | 2012-04-11 09:25:53 -0700 | [diff] [blame] | 463 | mAnimating |= mDimAnimator.updateSurface(isDimming(), mCurrentTime, |
Craig Mautner | 6af9b92 | 2012-04-05 19:25:51 -0700 | [diff] [blame] | 464 | !mService.okToDisplay()); |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 465 | } |
| 466 | |
| 467 | if (mService.mBlackFrame != null) { |
| 468 | if (mScreenRotationAnimation != null) { |
| 469 | mService.mBlackFrame.setMatrix( |
| 470 | mScreenRotationAnimation.getEnterTransformation().getMatrix()); |
| 471 | } else { |
| 472 | mService.mBlackFrame.clearMatrix(); |
| 473 | } |
| 474 | } |
Craig Mautner | 7358fbf | 2012-04-12 21:06:33 -0700 | [diff] [blame] | 475 | |
| 476 | if (mService.mWatermark != null) { |
| 477 | mService.mWatermark.drawIfNeeded(); |
| 478 | } |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 479 | } catch (RuntimeException e) { |
| 480 | Log.wtf(TAG, "Unhandled exception in Window Manager", e); |
| 481 | } finally { |
| 482 | Surface.closeTransaction(); |
| 483 | } |
Craig Mautner | c2f9be0 | 2012-03-27 17:32:29 -0700 | [diff] [blame] | 484 | |
Craig Mautner | 7d8df39 | 2012-04-06 15:26:23 -0700 | [diff] [blame^] | 485 | mService.bulkSetParameters(mBulkUpdateParams, mPendingLayoutChanges); |
| 486 | |
| 487 | if (mAnimating) { |
| 488 | mService.scheduleAnimationLocked(); |
| 489 | } |
| 490 | if (WindowManagerService.DEBUG_WINDOW_TRACE) { |
| 491 | Slog.i(TAG, "!!! animate: exit mAnimating=" + mAnimating |
| 492 | + " mBulkUpdateParams=" + Integer.toHexString(mBulkUpdateParams) |
| 493 | + " mPendingLayoutChanges=" + Integer.toHexString(mPendingLayoutChanges)); |
| 494 | } |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 495 | } |
| 496 | |
| 497 | WindowState mCurrentFocus; |
Craig Mautner | d09cc4b | 2012-04-04 10:23:31 -0700 | [diff] [blame] | 498 | void setCurrentFocus(final WindowState currentFocus) { |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 499 | mCurrentFocus = currentFocus; |
| 500 | } |
| 501 | |
| 502 | void setDisplayDimensions(final int curWidth, final int curHeight, |
| 503 | final int appWidth, final int appHeight) { |
| 504 | mDw = curWidth; |
| 505 | mDh = curHeight; |
| 506 | mInnerDw = appWidth; |
| 507 | mInnerDh = appHeight; |
| 508 | } |
| 509 | |
Craig Mautner | d09cc4b | 2012-04-04 10:23:31 -0700 | [diff] [blame] | 510 | void startDimming(final WindowStateAnimator winAnimator, final float target, |
| 511 | final int width, final int height) { |
| 512 | if (mDimAnimator == null) { |
| 513 | mDimAnimator = new DimAnimator(mService.mFxSession); |
| 514 | } |
| 515 | mService.mH.sendMessage(mService.mH.obtainMessage(SET_DIM_PARAMETERS, |
| 516 | new DimAnimator.Parameters(winAnimator, width, height, target))); |
| 517 | } |
| 518 | |
| 519 | // TODO(cmautner): Move into Handler |
| 520 | void stopDimming() { |
| 521 | mService.mH.sendMessage(mService.mH.obtainMessage(SET_DIM_PARAMETERS, null)); |
| 522 | } |
| 523 | |
Craig Mautner | f8d4fbb | 2012-04-11 09:25:53 -0700 | [diff] [blame] | 524 | boolean isDimming() { |
| 525 | return mDimParams != null; |
| 526 | } |
| 527 | |
Craig Mautner | e7ae250 | 2012-03-26 17:11:19 -0700 | [diff] [blame] | 528 | public void dump(PrintWriter pw, String prefix, boolean dumpAll) { |
| 529 | if (mWindowDetachedWallpaper != null) { |
| 530 | pw.print(" mWindowDetachedWallpaper="); pw.println(mWindowDetachedWallpaper); |
| 531 | } |
| 532 | if (mWindowAnimationBackgroundSurface != null) { |
| 533 | pw.println(" mWindowAnimationBackgroundSurface:"); |
| 534 | mWindowAnimationBackgroundSurface.printTo(" ", pw); |
| 535 | } |
Craig Mautner | d09cc4b | 2012-04-04 10:23:31 -0700 | [diff] [blame] | 536 | if (mDimAnimator != null) { |
| 537 | pw.println(" mDimAnimator:"); |
| 538 | mDimAnimator.printTo(" ", pw); |
| 539 | } else { |
| 540 | pw.println( " no DimAnimator "); |
| 541 | } |
Craig Mautner | e7ae250 | 2012-03-26 17:11:19 -0700 | [diff] [blame] | 542 | } |
Craig Mautner | bec53f7 | 2012-04-05 11:49:05 -0700 | [diff] [blame] | 543 | |
| 544 | static class SetAnimationParams { |
| 545 | final WindowStateAnimator mWinAnimator; |
| 546 | final Animation mAnimation; |
| 547 | final int mAnimDw; |
| 548 | final int mAnimDh; |
| 549 | public SetAnimationParams(final WindowStateAnimator winAnimator, |
| 550 | final Animation animation, final int animDw, final int animDh) { |
| 551 | mWinAnimator = winAnimator; |
| 552 | mAnimation = animation; |
| 553 | mAnimDw = animDw; |
| 554 | mAnimDh = animDh; |
| 555 | } |
| 556 | } |
Craig Mautner | 764983d | 2012-03-22 11:37:36 -0700 | [diff] [blame] | 557 | } |