blob: eddfe9217d9a140ea4640b38c8547e452db03b42 [file] [log] [blame]
Craig Mautner764983d2012-03-22 11:37:36 -07001// Copyright 2012 Google Inc. All Rights Reserved.
2
3package com.android.server.wm;
4
5import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
6
7import android.content.Context;
8import android.os.SystemClock;
9import android.util.Log;
10import android.util.Slog;
11import android.view.Surface;
12import android.view.WindowManager;
Craig Mautner764983d2012-03-22 11:37:36 -070013import android.view.WindowManagerPolicy;
14import android.view.animation.Animation;
Craig Mautner764983d2012-03-22 11:37:36 -070015
16import com.android.internal.policy.impl.PhoneWindowManager;
17
Craig Mautnere7ae2502012-03-26 17:11:19 -070018import java.io.PrintWriter;
19
Craig Mautner764983d2012-03-22 11:37:36 -070020/**
21 * @author cmautner@google.com (Craig Mautner)
22 * Singleton class that carries out the animations and Surface operations in a separate task
23 * on behalf of WindowManagerService.
24 */
25public class WindowAnimator {
Craig Mautnerbb1449b2012-03-23 16:11:14 -070026 private static final String TAG = "WindowAnimator";
Craig Mautner764983d2012-03-22 11:37:36 -070027
28 final WindowManagerService mService;
29 final Context mContext;
30 final WindowManagerPolicy mPolicy;
31
32 boolean mAnimating;
33 boolean mUpdateRotation;
34 boolean mTokenMayBeDrawn;
35 boolean mForceHiding;
36 WindowState mWindowAnimationBackground;
37 int mWindowAnimationBackgroundColor;
38 int mAdjResult;
39
40 int mPendingLayoutChanges;
41
42 /** Overall window dimensions */
43 int mDw, mDh;
44
45 /** Interior window dimensions */
46 int mInnerDw, mInnerDh;
47
48 /** Time of current animation step. Reset on each iteration */
49 long mCurrentTime;
50
51 /** Skip repeated AppWindowTokens initialization. Note that AppWindowsToken's version of this
52 * is a long initialized to Long.MIN_VALUE so that it doesn't match this value on startup. */
53 private int mTransactionSequence;
54
55 /** The one and only screen rotation if one is happening */
56 ScreenRotationAnimation mScreenRotationAnimation = null;
57
Craig Mautnere7ae2502012-03-26 17:11:19 -070058 // Window currently running an animation that has requested it be detached
59 // from the wallpaper. This means we need to ensure the wallpaper is
60 // visible behind it in case it animates in a way that would allow it to be
61 // seen.
62 WindowState mWindowDetachedWallpaper = null;
63 WindowState mDetachedWallpaper = null;
64 boolean mWallpaperMayChange;
65 DimSurface mWindowAnimationBackgroundSurface = null;
66
Craig Mautner764983d2012-03-22 11:37:36 -070067 WindowAnimator(final WindowManagerService service, final Context context,
68 final WindowManagerPolicy policy) {
69 mService = service;
70 mContext = context;
71 mPolicy = policy;
72 }
73
Craig Mautnere7ae2502012-03-26 17:11:19 -070074 private void testWallpaperAndBackgroundLocked() {
75 if (mWindowDetachedWallpaper != mDetachedWallpaper) {
76 if (WindowManagerService.DEBUG_WALLPAPER) Slog.v(TAG,
77 "Detached wallpaper changed from " + mWindowDetachedWallpaper
78 + " to " + mDetachedWallpaper);
79 mWindowDetachedWallpaper = mDetachedWallpaper;
80 mWallpaperMayChange = true;
81 }
82
83 if (mWindowAnimationBackgroundColor != 0) {
84 // If the window that wants black is the current wallpaper
85 // target, then the black goes *below* the wallpaper so we
86 // don't cause the wallpaper to suddenly disappear.
87 WindowState target = mWindowAnimationBackground;
88 if (mService.mWallpaperTarget == target
89 || mService.mLowerWallpaperTarget == target
90 || mService.mUpperWallpaperTarget == target) {
91 for (int i=0; i<mService.mWindows.size(); i++) {
92 WindowState w = mService.mWindows.get(i);
93 if (w.mIsWallpaper) {
94 target = w;
95 break;
96 }
97 }
98 }
99 if (mWindowAnimationBackgroundSurface == null) {
100 mWindowAnimationBackgroundSurface = new DimSurface(mService.mFxSession);
101 }
102 final int dw = mDw;
103 final int dh = mDh;
104 mWindowAnimationBackgroundSurface.show(dw, dh,
Craig Mautnerc2f9be02012-03-27 17:32:29 -0700105 target.mWinAnimator.mAnimLayer - WindowManagerService.LAYER_OFFSET_DIM,
Craig Mautnere7ae2502012-03-26 17:11:19 -0700106 mWindowAnimationBackgroundColor);
107 } else if (mWindowAnimationBackgroundSurface != null) {
108 mWindowAnimationBackgroundSurface.hide();
109 }
110 }
111
Craig Mautner764983d2012-03-22 11:37:36 -0700112 private void updateWindowsAppsAndRotationAnimationsLocked() {
113 int i;
114 final int NAT = mService.mAppTokens.size();
115 for (i=0; i<NAT; i++) {
116 final AppWindowToken appToken = mService.mAppTokens.get(i);
Craig Mautnercf8cbbe2012-03-25 21:54:36 -0700117 final boolean wasAnimating = appToken.animation != null
118 && appToken.animation != WindowManagerService.sDummyAnimation;
Craig Mautner764983d2012-03-22 11:37:36 -0700119 if (appToken.stepAnimationLocked(mCurrentTime, mInnerDw, mInnerDh)) {
120 mAnimating = true;
Craig Mautnerbb1449b2012-03-23 16:11:14 -0700121 } else if (wasAnimating) {
122 // stopped animating, do one more pass through the layout
123 mPendingLayoutChanges |= WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
Craig Mautnercf8cbbe2012-03-25 21:54:36 -0700124 if (WindowManagerService.DEBUG_LAYOUT_REPEATS) {
125 mService.debugLayoutRepeats("appToken " + appToken + " done");
126 }
Craig Mautnerbb1449b2012-03-23 16:11:14 -0700127 }
128 }
Craig Mautnera2c77052012-03-26 12:14:43 -0700129
Craig Mautnerbb1449b2012-03-23 16:11:14 -0700130 final int NEAT = mService.mExitingAppTokens.size();
131 for (i=0; i<NEAT; i++) {
132 final AppWindowToken appToken = mService.mExitingAppTokens.get(i);
Craig Mautnercf8cbbe2012-03-25 21:54:36 -0700133 final boolean wasAnimating = appToken.animation != null
134 && appToken.animation != WindowManagerService.sDummyAnimation;
Craig Mautnerbb1449b2012-03-23 16:11:14 -0700135 if (appToken.stepAnimationLocked(mCurrentTime, mInnerDw, mInnerDh)) {
136 mAnimating = true;
137 } else if (wasAnimating) {
138 // stopped animating, do one more pass through the layout
139 mPendingLayoutChanges |= WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
Craig Mautnercf8cbbe2012-03-25 21:54:36 -0700140 if (WindowManagerService.DEBUG_LAYOUT_REPEATS) {
141 mService.debugLayoutRepeats("exiting appToken " + appToken + " done");
142 }
Craig Mautner764983d2012-03-22 11:37:36 -0700143 }
144 }
145
146 if (mScreenRotationAnimation != null &&
147 (mScreenRotationAnimation.isAnimating() ||
148 mScreenRotationAnimation.mFinishAnimReady)) {
149 if (mScreenRotationAnimation.stepAnimationLocked(mCurrentTime)) {
150 mUpdateRotation = false;
151 mAnimating = true;
152 } else {
153 mUpdateRotation = true;
154 mScreenRotationAnimation.kill();
155 mScreenRotationAnimation = null;
156 }
157 }
158 }
159
160 private void updateWindowsAndWallpaperLocked() {
161 ++mTransactionSequence;
162
163 for (int i = mService.mWindows.size() - 1; i >= 0; i--) {
164 WindowState w = mService.mWindows.get(i);
Craig Mautnera2c77052012-03-26 12:14:43 -0700165 WindowStateAnimator winAnimator = w.mWinAnimator;
Craig Mautner764983d2012-03-22 11:37:36 -0700166 final WindowManager.LayoutParams attrs = w.mAttrs;
167
Craig Mautnerc2f9be02012-03-27 17:32:29 -0700168 if (winAnimator.mSurface != null) {
Craig Mautnera2c77052012-03-26 12:14:43 -0700169 final boolean wasAnimating = winAnimator.mWasAnimating;
170 final boolean nowAnimating = winAnimator.stepAnimationLocked(mCurrentTime);
Craig Mautner764983d2012-03-22 11:37:36 -0700171
172 if (WindowManagerService.DEBUG_WALLPAPER) {
173 Slog.v(TAG, w + ": wasAnimating=" + wasAnimating +
174 ", nowAnimating=" + nowAnimating);
175 }
176
177 // If this window is animating, make a note that we have
178 // an animating window and take care of a request to run
179 // a detached wallpaper animation.
180 if (nowAnimating) {
Craig Mautnera2c77052012-03-26 12:14:43 -0700181 if (winAnimator.mAnimation != null) {
Craig Mautnerc2f9be02012-03-27 17:32:29 -0700182 if ((attrs.flags&FLAG_SHOW_WALLPAPER) != 0
Craig Mautnera2c77052012-03-26 12:14:43 -0700183 && winAnimator.mAnimation.getDetachWallpaper()) {
Craig Mautnerc2f9be02012-03-27 17:32:29 -0700184 mDetachedWallpaper = w;
Craig Mautner764983d2012-03-22 11:37:36 -0700185 }
Craig Mautnera2c77052012-03-26 12:14:43 -0700186 if (winAnimator.mAnimation.getBackgroundColor() != 0) {
Craig Mautner764983d2012-03-22 11:37:36 -0700187 if (mWindowAnimationBackground == null
Craig Mautnerc2f9be02012-03-27 17:32:29 -0700188 || (winAnimator.mAnimLayer <
189 mWindowAnimationBackground.mWinAnimator.mAnimLayer)) {
Craig Mautner764983d2012-03-22 11:37:36 -0700190 mWindowAnimationBackground = w;
191 mWindowAnimationBackgroundColor =
Craig Mautnera2c77052012-03-26 12:14:43 -0700192 winAnimator.mAnimation.getBackgroundColor();
Craig Mautner764983d2012-03-22 11:37:36 -0700193 }
194 }
195 }
196 mAnimating = true;
197 }
198
199 // If this window's app token is running a detached wallpaper
200 // animation, make a note so we can ensure the wallpaper is
201 // displayed behind it.
202 if (w.mAppToken != null && w.mAppToken.animation != null
203 && w.mAppToken.animating) {
Craig Mautnerc2f9be02012-03-27 17:32:29 -0700204 if ((attrs.flags&FLAG_SHOW_WALLPAPER) != 0
Craig Mautner764983d2012-03-22 11:37:36 -0700205 && w.mAppToken.animation.getDetachWallpaper()) {
Craig Mautnerc2f9be02012-03-27 17:32:29 -0700206 mDetachedWallpaper = w;
Craig Mautner764983d2012-03-22 11:37:36 -0700207 }
208 if (w.mAppToken.animation.getBackgroundColor() != 0) {
209 if (mWindowAnimationBackground == null
Craig Mautnerc2f9be02012-03-27 17:32:29 -0700210 || (winAnimator.mAnimLayer <
211 mWindowAnimationBackground.mWinAnimator.mAnimLayer)) {
Craig Mautner764983d2012-03-22 11:37:36 -0700212 mWindowAnimationBackground = w;
213 mWindowAnimationBackgroundColor =
214 w.mAppToken.animation.getBackgroundColor();
215 }
216 }
217 }
218
Craig Mautnera2c77052012-03-26 12:14:43 -0700219 if (wasAnimating && !winAnimator.mAnimating && mService.mWallpaperTarget == w) {
Craig Mautnere7ae2502012-03-26 17:11:19 -0700220 mWallpaperMayChange = true;
Craig Mautner764983d2012-03-22 11:37:36 -0700221 mPendingLayoutChanges |= WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
Craig Mautnercf8cbbe2012-03-25 21:54:36 -0700222 if (WindowManagerService.DEBUG_LAYOUT_REPEATS) {
223 mService.debugLayoutRepeats("updateWindowsAndWallpaperLocked 2");
224 }
Craig Mautner764983d2012-03-22 11:37:36 -0700225 }
226
227 if (mPolicy.doesForceHide(w, attrs)) {
228 if (!wasAnimating && nowAnimating) {
229 if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(TAG,
230 "Animation started that could impact force hide: "
231 + w);
232 mService.mInnerFields.mWallpaperForceHidingChanged = true;
233 mPendingLayoutChanges |= WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
Craig Mautnercf8cbbe2012-03-25 21:54:36 -0700234 if (WindowManagerService.DEBUG_LAYOUT_REPEATS) {
235 mService.debugLayoutRepeats("updateWindowsAndWallpaperLocked 3");
236 }
Craig Mautner764983d2012-03-22 11:37:36 -0700237 mService.mFocusMayChange = true;
Craig Mautnera2c77052012-03-26 12:14:43 -0700238 } else if (w.isReadyForDisplay() && winAnimator.mAnimation == null) {
Craig Mautner764983d2012-03-22 11:37:36 -0700239 mForceHiding = true;
240 }
241 } else if (mPolicy.canBeForceHidden(w, attrs)) {
242 boolean changed;
243 if (mForceHiding) {
244 changed = w.hideLw(false, false);
245 if (WindowManagerService.DEBUG_VISIBILITY && changed) Slog.v(TAG,
246 "Now policy hidden: " + w);
247 } else {
248 changed = w.showLw(false, false);
249 if (WindowManagerService.DEBUG_VISIBILITY && changed) Slog.v(TAG,
250 "Now policy shown: " + w);
251 if (changed) {
252 if (mService.mInnerFields.mWallpaperForceHidingChanged
253 && w.isVisibleNow() /*w.isReadyForDisplay()*/) {
254 // Assume we will need to animate. If
255 // we don't (because the wallpaper will
256 // stay with the lock screen), then we will
257 // clean up later.
258 Animation a = mPolicy.createForceHideEnterAnimation();
259 if (a != null) {
Craig Mautnera2c77052012-03-26 12:14:43 -0700260 winAnimator.setAnimation(a);
Craig Mautner764983d2012-03-22 11:37:36 -0700261 }
262 }
263 if (mCurrentFocus == null || mCurrentFocus.mLayer < w.mLayer) {
264 // We are showing on to of the current
265 // focus, so re-evaluate focus to make
266 // sure it is correct.
267 mService.mFocusMayChange = true;
268 }
269 }
270 }
271 if (changed && (attrs.flags
272 & WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER) != 0) {
Craig Mautnere7ae2502012-03-26 17:11:19 -0700273 mWallpaperMayChange = true;
Craig Mautner764983d2012-03-22 11:37:36 -0700274 mPendingLayoutChanges |= WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
Craig Mautnercf8cbbe2012-03-25 21:54:36 -0700275 if (WindowManagerService.DEBUG_LAYOUT_REPEATS) {
276 mService.debugLayoutRepeats("updateWindowsAndWallpaperLocked 4");
277 }
Craig Mautner764983d2012-03-22 11:37:36 -0700278 }
279 }
280 }
281
282 final AppWindowToken atoken = w.mAppToken;
283 if (atoken != null && (!atoken.allDrawn || atoken.freezingScreen)) {
284 if (atoken.lastTransactionSequence != mTransactionSequence) {
285 atoken.lastTransactionSequence = mTransactionSequence;
286 atoken.numInterestingWindows = atoken.numDrawnWindows = 0;
287 atoken.startingDisplayed = false;
288 }
289 if ((w.isOnScreen() || w.mAttrs.type
290 == WindowManager.LayoutParams.TYPE_BASE_APPLICATION)
291 && !w.mExiting && !w.mDestroying) {
292 if (WindowManagerService.DEBUG_VISIBILITY ||
293 WindowManagerService.DEBUG_ORIENTATION) {
294 Slog.v(TAG, "Eval win " + w + ": isDrawn="
295 + w.isDrawnLw()
Craig Mautnera2c77052012-03-26 12:14:43 -0700296 + ", isAnimating=" + winAnimator.isAnimating());
Craig Mautner764983d2012-03-22 11:37:36 -0700297 if (!w.isDrawnLw()) {
Craig Mautnerc2f9be02012-03-27 17:32:29 -0700298 Slog.v(TAG, "Not displayed: s=" + winAnimator.mSurface
Craig Mautner764983d2012-03-22 11:37:36 -0700299 + " pv=" + w.mPolicyVisibility
300 + " dp=" + w.mDrawPending
301 + " cdp=" + w.mCommitDrawPending
302 + " ah=" + w.mAttachedHidden
303 + " th=" + atoken.hiddenRequested
Craig Mautnera2c77052012-03-26 12:14:43 -0700304 + " a=" + winAnimator.mAnimating);
Craig Mautner764983d2012-03-22 11:37:36 -0700305 }
306 }
307 if (w != atoken.startingWindow) {
308 if (!atoken.freezingScreen || !w.mAppFreezing) {
309 atoken.numInterestingWindows++;
310 if (w.isDrawnLw()) {
311 atoken.numDrawnWindows++;
312 if (WindowManagerService.DEBUG_VISIBILITY ||
313 WindowManagerService.DEBUG_ORIENTATION) Slog.v(TAG,
314 "tokenMayBeDrawn: " + atoken
315 + " freezingScreen=" + atoken.freezingScreen
316 + " mAppFreezing=" + w.mAppFreezing);
317 mTokenMayBeDrawn = true;
318 }
319 }
320 } else if (w.isDrawnLw()) {
321 atoken.startingDisplayed = true;
322 }
323 }
324 } else if (w.mReadyToShow) {
Craig Mautnerc2f9be02012-03-27 17:32:29 -0700325 if (winAnimator.performShowLocked()) {
Craig Mautnercf8cbbe2012-03-25 21:54:36 -0700326 mPendingLayoutChanges |= WindowManagerPolicy.FINISH_LAYOUT_REDO_ANIM;
327 if (WindowManagerService.DEBUG_LAYOUT_REPEATS) {
328 mService.debugLayoutRepeats("updateWindowsAndWallpaperLocked 5");
329 }
330 }
Craig Mautner764983d2012-03-22 11:37:36 -0700331 }
Dianne Hackborn8078d8c2012-03-20 11:11:26 -0700332 if (atoken != null && atoken.thumbnail != null) {
333 if (atoken.thumbnailTransactionSeq != mTransactionSequence) {
334 atoken.thumbnailTransactionSeq = mTransactionSequence;
335 atoken.thumbnailLayer = 0;
336 }
Craig Mautnerc2f9be02012-03-27 17:32:29 -0700337 if (atoken.thumbnailLayer < winAnimator.mAnimLayer) {
338 atoken.thumbnailLayer = winAnimator.mAnimLayer;
Dianne Hackborn8078d8c2012-03-20 11:11:26 -0700339 }
340 }
Craig Mautner764983d2012-03-22 11:37:36 -0700341 } // end forall windows
342 }
343
344 private void testTokenMayBeDrawnLocked() {
345 // See if any windows have been drawn, so they (and others
346 // associated with them) can now be shown.
347 final int NT = mService.mAppTokens.size();
348 for (int i=0; i<NT; i++) {
349 AppWindowToken wtoken = mService.mAppTokens.get(i);
350 if (wtoken.freezingScreen) {
351 int numInteresting = wtoken.numInterestingWindows;
352 if (numInteresting > 0 && wtoken.numDrawnWindows >= numInteresting) {
353 if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(TAG,
354 "allDrawn: " + wtoken
355 + " interesting=" + numInteresting
356 + " drawn=" + wtoken.numDrawnWindows);
357 wtoken.showAllWindowsLocked();
358 mService.unsetAppFreezingScreenLocked(wtoken, false, true);
359 if (WindowManagerService.DEBUG_ORIENTATION) Slog.i(TAG,
360 "Setting mOrientationChangeComplete=true because wtoken "
361 + wtoken + " numInteresting=" + numInteresting
362 + " numDrawn=" + wtoken.numDrawnWindows);
363 mService.mInnerFields.mOrientationChangeComplete = true;
364 }
365 } else if (!wtoken.allDrawn) {
366 int numInteresting = wtoken.numInterestingWindows;
367 if (numInteresting > 0 && wtoken.numDrawnWindows >= numInteresting) {
368 if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(TAG,
369 "allDrawn: " + wtoken
370 + " interesting=" + numInteresting
371 + " drawn=" + wtoken.numDrawnWindows);
372 wtoken.allDrawn = true;
373 mPendingLayoutChanges |= PhoneWindowManager.FINISH_LAYOUT_REDO_ANIM;
Craig Mautnercf8cbbe2012-03-25 21:54:36 -0700374 if (WindowManagerService.DEBUG_LAYOUT_REPEATS) {
375 mService.debugLayoutRepeats("testTokenMayBeDrawnLocked");
376 }
Craig Mautner764983d2012-03-22 11:37:36 -0700377
378 // We can now show all of the drawn windows!
379 if (!mService.mOpeningApps.contains(wtoken)) {
380 mAnimating |= wtoken.showAllWindowsLocked();
381 }
382 }
383 }
384 }
385 }
386
387 private void performAnimationsLocked() {
Craig Mautner764983d2012-03-22 11:37:36 -0700388 mTokenMayBeDrawn = false;
389 mService.mInnerFields.mWallpaperMayChange = false;
390 mForceHiding = false;
Craig Mautnerc2f9be02012-03-27 17:32:29 -0700391 mDetachedWallpaper = null;
Craig Mautner764983d2012-03-22 11:37:36 -0700392 mWindowAnimationBackground = null;
393 mWindowAnimationBackgroundColor = 0;
394
395 updateWindowsAndWallpaperLocked();
396
397 if (mTokenMayBeDrawn) {
398 testTokenMayBeDrawnLocked();
399 }
Craig Mautner764983d2012-03-22 11:37:36 -0700400 }
401
Craig Mautner764983d2012-03-22 11:37:36 -0700402
403 void animate() {
Craig Mautnerbb1449b2012-03-23 16:11:14 -0700404 mPendingLayoutChanges = 0;
Craig Mautnere7ae2502012-03-26 17:11:19 -0700405 mWallpaperMayChange = false;
Craig Mautner764983d2012-03-22 11:37:36 -0700406 mCurrentTime = SystemClock.uptimeMillis();
407
408 // Update animations of all applications, including those
409 // associated with exiting/removed apps
410 Surface.openTransaction();
411
412 try {
Craig Mautnere7ae2502012-03-26 17:11:19 -0700413 testWallpaperAndBackgroundLocked();
Craig Mautner764983d2012-03-22 11:37:36 -0700414 updateWindowsAppsAndRotationAnimationsLocked();
415 performAnimationsLocked();
416
417 // THIRD LOOP: Update the surfaces of all windows.
418
419 if (mScreenRotationAnimation != null) {
420 mScreenRotationAnimation.updateSurfaces();
421 }
422
423 final int N = mService.mWindows.size();
424 for (int i=N-1; i>=0; i--) {
425 WindowState w = mService.mWindows.get(i);
Craig Mautnerc2f9be02012-03-27 17:32:29 -0700426 w.mWinAnimator.prepareSurfaceLocked(true);
Craig Mautner764983d2012-03-22 11:37:36 -0700427 }
428
429 if (mService.mDimAnimator != null && mService.mDimAnimator.mDimShown) {
430 mAnimating |= mService.mDimAnimator.updateSurface(mService.mInnerFields.mDimming,
431 mCurrentTime, !mService.okToDisplay());
432 }
433
434 if (mService.mBlackFrame != null) {
435 if (mScreenRotationAnimation != null) {
436 mService.mBlackFrame.setMatrix(
437 mScreenRotationAnimation.getEnterTransformation().getMatrix());
438 } else {
439 mService.mBlackFrame.clearMatrix();
440 }
441 }
442 } catch (RuntimeException e) {
443 Log.wtf(TAG, "Unhandled exception in Window Manager", e);
444 } finally {
445 Surface.closeTransaction();
446 }
Craig Mautnerc2f9be02012-03-27 17:32:29 -0700447
Craig Mautnere7ae2502012-03-26 17:11:19 -0700448 if (mWallpaperMayChange) {
449 mService.notifyWallpaperMayChange();
450 }
Craig Mautner764983d2012-03-22 11:37:36 -0700451 }
452
453 WindowState mCurrentFocus;
454 void setCurrentFocus(WindowState currentFocus) {
455 mCurrentFocus = currentFocus;
456 }
457
458 void setDisplayDimensions(final int curWidth, final int curHeight,
459 final int appWidth, final int appHeight) {
460 mDw = curWidth;
461 mDh = curHeight;
462 mInnerDw = appWidth;
463 mInnerDh = appHeight;
464 }
465
Craig Mautnere7ae2502012-03-26 17:11:19 -0700466 public void dump(PrintWriter pw, String prefix, boolean dumpAll) {
467 if (mWindowDetachedWallpaper != null) {
468 pw.print(" mWindowDetachedWallpaper="); pw.println(mWindowDetachedWallpaper);
469 }
470 if (mWindowAnimationBackgroundSurface != null) {
471 pw.println(" mWindowAnimationBackgroundSurface:");
472 mWindowAnimationBackgroundSurface.printTo(" ", pw);
473 }
474 }
Craig Mautner764983d2012-03-22 11:37:36 -0700475}