Animate from local list of WindowStateAnimators.
Stop animate() from using the mWindows maintained by
WindowManagerService. Animating WindowStateAnimators are now drawn from
a HashSet maintained by WindowAnimator and containing just those
WindowStateAnimators that have Surfaces.
When starting a move animation do not place parameters directly into
the WindowStateAnimator, instead pass them through the Handler.
Also removed synchronization points from mWindows/mAppTokens
add/remove.
diff --git a/services/java/com/android/server/wm/WindowStateAnimator.java b/services/java/com/android/server/wm/WindowStateAnimator.java
index 6d0921e..220f5e0 100644
--- a/services/java/com/android/server/wm/WindowStateAnimator.java
+++ b/services/java/com/android/server/wm/WindowStateAnimator.java
@@ -121,6 +121,9 @@
/** Was this window last hidden? */
boolean mLastHidden;
+ int mAttrFlags;
+ int mAttrType;
+
public WindowStateAnimator(final WindowManagerService service, final WindowState win,
final WindowState attachedWindow) {
mService = service;
@@ -130,11 +133,12 @@
mSession = win.mSession;
mPolicy = mService.mPolicy;
mContext = mService.mContext;
+ mAttrFlags = win.mAttrs.flags;
+ mAttrType = win.mAttrs.type;
}
public void setAnimation(Animation anim) {
- if (localLOGV) Slog.v(
- TAG, "Setting animation in " + this + ": " + anim);
+ if (localLOGV) Slog.v(TAG, "Setting animation in " + this + ": " + anim);
mAnimating = false;
mLocalAnimating = false;
mAnimation = anim;
@@ -453,6 +457,7 @@
attrs.getTitle().toString(),
0, w, h, format, flags);
mWin.mHasSurface = true;
+ mAnimator.mWinAnimators.add(this);
if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) Slog.i(TAG,
" CREATE SURFACE "
+ mSurface + " IN SESSION "
@@ -463,12 +468,14 @@
+ " / " + this);
} catch (Surface.OutOfResourcesException e) {
mWin.mHasSurface = false;
+ mAnimator.mWinAnimators.remove(this);
Slog.w(TAG, "OutOfResourcesException creating surface");
mService.reclaimSomeSurfaceMemoryLocked(this, "create", true);
mDrawState = NO_SURFACE;
return null;
} catch (Exception e) {
mWin.mHasSurface = false;
+ mAnimator.mWinAnimators.remove(this);
Slog.e(TAG, "Exception creating surface", e);
mDrawState = NO_SURFACE;
return null;
@@ -586,6 +593,7 @@
mSurfaceShown = false;
mSurface = null;
mWin.mHasSurface =false;
+ mAnimator.mWinAnimators.remove(this);
}
}