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
@@ -192,7 +193,7 @@ boolean stepAnimationLocked(long currentTime, int dw, int dh) {
192193 && animation != null ) {
193194 if (!animating ) {
194195 if (WindowManagerService .DEBUG_ANIM ) Slog .v (
195- WindowManagerService . TAG , "Starting animation in " + this +
196+ TAG , "Starting animation in " + this +
196197 " @ " + currentTime + ": dw=" + dw + " dh=" + dh
197198 + " scale=" + mService .mTransitionAnimationScale
198199 + " allDrawn=" + mAppToken .allDrawn + " animating=" + animating );
@@ -245,7 +246,7 @@ boolean stepAnimationLocked(long currentTime, int dw, int dh) {
245246 }
246247
247248 if (WindowManagerService .DEBUG_ANIM ) Slog .v (
248- WindowManagerService . TAG , "Animation done in " + this
249+ TAG , "Animation done in " + this
249250 + ": reportedVisible=" + mAppToken .reportedVisible );
250251
251252 transformation .clear ();
@@ -264,7 +265,7 @@ boolean showAllWindowsLocked() {
264265 final int NW = mAppToken .allAppWindows .size ();
265266 for (int i =0 ; i <NW ; i ++) {
266267 WindowStateAnimator winAnimator = mAppToken .allAppWindows .get (i ).mWinAnimator ;
267- if (WindowManagerService .DEBUG_VISIBILITY ) Slog .v (WindowManagerService . TAG ,
268+ if (WindowManagerService .DEBUG_VISIBILITY ) Slog .v (TAG ,
268269 "performing show on: " + winAnimator );
269270 winAnimator .performShowLocked ();
270271 isAnimating |= winAnimator .isAnimating ();
@@ -298,4 +299,15 @@ void dump(PrintWriter pw, String prefix) {
298299 pw .println (thumbnailTransformation .toShortString ());
299300 }
300301 }
302+
303+ // This is an animation that does nothing: it just immediately finishes
304+ // itself every time it is called. It is used as a stub animation in cases
305+ // where we want to synchronize multiple things that may be animating.
306+ static final class DummyAnimation extends Animation {
307+ @ Override
308+ public boolean getTransformation (long currentTime , Transformation outTransformation ) {
309+ return false ;
310+ }
311+ }
312+
301313}
0 commit comments