1515 *
1616 */
1717public class AppWindowAnimator {
18+ static final String TAG = "AppWindowAnimator" ;
1819
1920 final AppWindowToken mAppToken ;
2021 final WindowManagerService mService ;
@@ -43,6 +44,8 @@ public class AppWindowAnimator {
4344 Animation thumbnailAnimation ;
4445 final Transformation thumbnailTransformation = new Transformation ();
4546
47+ static final Animation sDummyAnimation = new DummyAnimation ();
48+
4649 public AppWindowAnimator (final WindowManagerService service , final AppWindowToken atoken ) {
4750 mService = service ;
4851 mAppToken = atoken ;
@@ -51,7 +54,7 @@ public AppWindowAnimator(final WindowManagerService service, final AppWindowToke
5154
5255 public void setAnimation (Animation anim , boolean initialized ) {
5356 if (WindowManagerService .localLOGV ) Slog .v (
54- WindowManagerService . TAG , "Setting animation in " + this + ": " + anim );
57+ TAG , "Setting animation in " + this + ": " + anim );
5558 animation = anim ;
5659 animating = false ;
5760 animInitialized = initialized ;
@@ -78,8 +81,8 @@ public void setAnimation(Animation anim, boolean initialized) {
7881 public void setDummyAnimation () {
7982 if (animation == null ) {
8083 if (WindowManagerService .localLOGV ) Slog .v (
81- WindowManagerService . TAG , "Setting dummy animation in " + this );
82- animation = WindowManagerService . sDummyAnimation ;
84+ TAG , "Setting dummy animation in " + this );
85+ animation = sDummyAnimation ;
8386 animInitialized = false ;
8487 }
8588 }
@@ -111,7 +114,7 @@ void updateLayers() {
111114 if (winAnimator .mAnimLayer > thumbnailLayer ) {
112115 thumbnailLayer = winAnimator .mAnimLayer ;
113116 }
114- if (WindowManagerService .DEBUG_LAYERS ) Slog .v (WindowManagerService . TAG , "Updating layer " + w + ": "
117+ if (WindowManagerService .DEBUG_LAYERS ) Slog .v (TAG , "Updating layer " + w + ": "
115118 + winAnimator .mAnimLayer );
116119 if (w == mService .mInputMethodTarget && !mService .mInputMethodTargetWaitingAnim ) {
117120 mService .setInputMethodAnimLayerAdjustment (adj );
@@ -162,14 +165,12 @@ private boolean stepAnimation(long currentTime) {
162165 transformation .clear ();
163166 final boolean more = animation .getTransformation (currentTime , transformation );
164167 if (WindowManagerService .DEBUG_ANIM ) Slog .v (
165- WindowManagerService .TAG , "Stepped animation in " + this +
166- ": more=" + more + ", xform=" + transformation );
168+ TAG , "Stepped animation in " + this + ": more=" + more + ", xform=" + transformation );
167169 if (!more ) {
168170 animation = null ;
169171 clearThumbnail ();
170172 if (WindowManagerService .DEBUG_ANIM ) Slog .v (
171- WindowManagerService .TAG , "Finished animation in " + this +
172- " @ " + currentTime );
173+ TAG , "Finished animation in " + this + " @ " + currentTime );
173174 }
174175 hasTransformation = more ;
175176 return more ;
@@ -180,7 +181,7 @@ boolean stepAnimationLocked(long currentTime, int dw, int dh) {
180181 if (mService .okToDisplay ()) {
181182 // We will run animations as long as the display isn't frozen.
182183
183- if (animation == WindowManagerService . sDummyAnimation ) {
184+ if (animation == sDummyAnimation ) {
184185 // This guy is going to animate, but not yet. For now count
185186 // it as not animating for purposes of scheduling transactions;
186187 // when it is really time to animate, this will be set to
@@ -194,7 +195,7 @@ boolean stepAnimationLocked(long currentTime, int dw, int dh) {
194195 && animation != null ) {
195196 if (!animating ) {
196197 if (WindowManagerService .DEBUG_ANIM ) Slog .v (
197- WindowManagerService . TAG , "Starting animation in " + this +
198+ TAG , "Starting animation in " + this +
198199 " @ " + currentTime + ": dw=" + dw + " dh=" + dh
199200 + " scale=" + mService .mTransitionAnimationScale
200201 + " allDrawn=" + mAppToken .allDrawn + " animating=" + animating );
@@ -247,7 +248,7 @@ boolean stepAnimationLocked(long currentTime, int dw, int dh) {
247248 }
248249
249250 if (WindowManagerService .DEBUG_ANIM ) Slog .v (
250- WindowManagerService . TAG , "Animation done in " + this
251+ TAG , "Animation done in " + this
251252 + ": reportedVisible=" + mAppToken .reportedVisible );
252253
253254 transformation .clear ();
@@ -266,7 +267,7 @@ boolean showAllWindowsLocked() {
266267 final int NW = mAppToken .allAppWindows .size ();
267268 for (int i =0 ; i <NW ; i ++) {
268269 WindowStateAnimator winAnimator = mAppToken .allAppWindows .get (i ).mWinAnimator ;
269- if (WindowManagerService .DEBUG_VISIBILITY ) Slog .v (WindowManagerService . TAG ,
270+ if (WindowManagerService .DEBUG_VISIBILITY ) Slog .v (TAG ,
270271 "performing show on: " + winAnimator );
271272 winAnimator .performShowLocked ();
272273 isAnimating |= winAnimator .isAnimating ();
@@ -300,4 +301,15 @@ void dump(PrintWriter pw, String prefix) {
300301 pw .println (thumbnailTransformation .toShortString ());
301302 }
302303 }
304+
305+ // This is an animation that does nothing: it just immediately finishes
306+ // itself every time it is called. It is used as a stub animation in cases
307+ // where we want to synchronize multiple things that may be animating.
308+ static final class DummyAnimation extends Animation {
309+ @ Override
310+ public boolean getTransformation (long currentTime , Transformation outTransformation ) {
311+ return false ;
312+ }
313+ }
314+
303315}
0 commit comments