Merge "Animate from local list of WindowStateAnimators."
This commit is contained in:
committed by
Android (Google) Code Review
commit
1ade5ae9c8
@@ -259,6 +259,19 @@ public class AppWindowAnimator {
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean showAllWindowsLocked() {
|
||||
boolean isAnimating = false;
|
||||
final int NW = mAppToken.allAppWindows.size();
|
||||
for (int i=0; i<NW; i++) {
|
||||
WindowStateAnimator winAnimator = mAppToken.allAppWindows.get(i).mWinAnimator;
|
||||
if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG,
|
||||
"performing show on: " + winAnimator);
|
||||
winAnimator.performShowLocked();
|
||||
isAnimating |= winAnimator.isAnimating();
|
||||
}
|
||||
return isAnimating;
|
||||
}
|
||||
|
||||
void dump(PrintWriter pw, String prefix) {
|
||||
if (freezingScreen) {
|
||||
pw.print(prefix); pw.print(" freezingScreen="); pw.println(freezingScreen);
|
||||
|
||||
@@ -124,19 +124,6 @@ class AppWindowToken extends WindowToken {
|
||||
}
|
||||
}
|
||||
|
||||
boolean showAllWindowsLocked() {
|
||||
boolean isAnimating = false;
|
||||
final int NW = allAppWindows.size();
|
||||
for (int i=0; i<NW; i++) {
|
||||
WindowStateAnimator winAnimator = allAppWindows.get(i).mWinAnimator;
|
||||
if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG,
|
||||
"performing show on: " + winAnimator);
|
||||
winAnimator.performShowLocked();
|
||||
isAnimating |= winAnimator.isAnimating();
|
||||
}
|
||||
return isAnimating;
|
||||
}
|
||||
|
||||
void updateReportedVisibilityLocked() {
|
||||
if (appToken == null) {
|
||||
return;
|
||||
|
||||
@@ -41,14 +41,14 @@ class DimAnimator {
|
||||
|
||||
DimAnimator (SurfaceSession session) {
|
||||
if (mDimSurface == null) {
|
||||
if (WindowManagerService.SHOW_TRANSACTIONS ||
|
||||
WindowManagerService.SHOW_SURFACE_ALLOC) Slog.i(WindowManagerService.TAG,
|
||||
" DIM " + mDimSurface + ": CREATE");
|
||||
try {
|
||||
mDimSurface = new Surface(session, 0,
|
||||
"DimAnimator",
|
||||
-1, 16, 16, PixelFormat.OPAQUE,
|
||||
Surface.FX_SURFACE_DIM);
|
||||
if (WindowManagerService.SHOW_TRANSACTIONS ||
|
||||
WindowManagerService.SHOW_SURFACE_ALLOC) Slog.i(WindowManagerService.TAG,
|
||||
" DIM " + mDimSurface + ": CREATE");
|
||||
mDimSurface.setAlpha(0.0f);
|
||||
} catch (Exception e) {
|
||||
Slog.e(WindowManagerService.TAG, "Exception creating Dim surface", e);
|
||||
|
||||
@@ -32,14 +32,14 @@ class DimSurface {
|
||||
|
||||
DimSurface(SurfaceSession session) {
|
||||
if (mDimSurface == null) {
|
||||
if (WindowManagerService.SHOW_TRANSACTIONS ||
|
||||
WindowManagerService.SHOW_SURFACE_ALLOC) Slog.i(WindowManagerService.TAG,
|
||||
" DIM " + mDimSurface + ": CREATE");
|
||||
try {
|
||||
mDimSurface = new Surface(session, 0,
|
||||
"DimSurface",
|
||||
-1, 16, 16, PixelFormat.OPAQUE,
|
||||
Surface.FX_SURFACE_DIM);
|
||||
if (WindowManagerService.SHOW_TRANSACTIONS ||
|
||||
WindowManagerService.SHOW_SURFACE_ALLOC) Slog.i(WindowManagerService.TAG,
|
||||
" DIM " + mDimSurface + ": CREATE");
|
||||
mDimSurface.setAlpha(0.0f);
|
||||
} catch (Exception e) {
|
||||
Slog.e(WindowManagerService.TAG, "Exception creating Dim surface", e);
|
||||
|
||||
@@ -22,6 +22,7 @@ import android.view.animation.Animation;
|
||||
import com.android.internal.policy.impl.PhoneWindowManager;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.util.HashSet;
|
||||
|
||||
/**
|
||||
* Singleton class that carries out the animations and Surface operations in a separate task
|
||||
@@ -34,6 +35,9 @@ public class WindowAnimator {
|
||||
final Context mContext;
|
||||
final WindowManagerPolicy mPolicy;
|
||||
|
||||
HashSet<WindowStateAnimator> mWinAnimators = new HashSet<WindowStateAnimator>();
|
||||
HashSet<WindowStateAnimator> mFinished = new HashSet<WindowStateAnimator>();
|
||||
|
||||
boolean mAnimating;
|
||||
boolean mTokenMayBeDrawn;
|
||||
boolean mForceHiding;
|
||||
@@ -171,16 +175,16 @@ public class WindowAnimator {
|
||||
++mTransactionSequence;
|
||||
|
||||
for (int i = mService.mWindows.size() - 1; i >= 0; i--) {
|
||||
WindowState w = mService.mWindows.get(i);
|
||||
WindowStateAnimator winAnimator = w.mWinAnimator;
|
||||
final WindowManager.LayoutParams attrs = w.mAttrs;
|
||||
WindowState win = mService.mWindows.get(i);
|
||||
WindowStateAnimator winAnimator = win.mWinAnimator;
|
||||
final int flags = winAnimator.mAttrFlags;
|
||||
|
||||
if (winAnimator.mSurface != null) {
|
||||
final boolean wasAnimating = winAnimator.mWasAnimating;
|
||||
final boolean nowAnimating = winAnimator.stepAnimationLocked(mCurrentTime);
|
||||
|
||||
if (WindowManagerService.DEBUG_WALLPAPER) {
|
||||
Slog.v(TAG, w + ": wasAnimating=" + wasAnimating +
|
||||
Slog.v(TAG, win + ": wasAnimating=" + wasAnimating +
|
||||
", nowAnimating=" + nowAnimating);
|
||||
}
|
||||
|
||||
@@ -189,16 +193,16 @@ public class WindowAnimator {
|
||||
// a detached wallpaper animation.
|
||||
if (nowAnimating) {
|
||||
if (winAnimator.mAnimation != null) {
|
||||
if ((attrs.flags&FLAG_SHOW_WALLPAPER) != 0
|
||||
if ((flags & FLAG_SHOW_WALLPAPER) != 0
|
||||
&& winAnimator.mAnimation.getDetachWallpaper()) {
|
||||
mDetachedWallpaper = w;
|
||||
mDetachedWallpaper = win;
|
||||
}
|
||||
final int backgroundColor = winAnimator.mAnimation.getBackgroundColor();
|
||||
if (backgroundColor != 0) {
|
||||
if (mWindowAnimationBackground == null
|
||||
|| (winAnimator.mAnimLayer <
|
||||
mWindowAnimationBackground.mWinAnimator.mAnimLayer)) {
|
||||
mWindowAnimationBackground = w;
|
||||
mWindowAnimationBackground = win;
|
||||
mWindowAnimationBackgroundColor = backgroundColor;
|
||||
}
|
||||
}
|
||||
@@ -210,25 +214,25 @@ public class WindowAnimator {
|
||||
// animation, make a note so we can ensure the wallpaper is
|
||||
// displayed behind it.
|
||||
final AppWindowAnimator appAnimator =
|
||||
w.mAppToken == null ? null : w.mAppToken.mAppAnimator;
|
||||
win.mAppToken == null ? null : win.mAppToken.mAppAnimator;
|
||||
if (appAnimator != null && appAnimator.animation != null
|
||||
&& appAnimator.animating) {
|
||||
if ((attrs.flags&FLAG_SHOW_WALLPAPER) != 0
|
||||
if ((flags & FLAG_SHOW_WALLPAPER) != 0
|
||||
&& appAnimator.animation.getDetachWallpaper()) {
|
||||
mDetachedWallpaper = w;
|
||||
mDetachedWallpaper = win;
|
||||
}
|
||||
final int backgroundColor = appAnimator.animation.getBackgroundColor();
|
||||
if (backgroundColor != 0) {
|
||||
if (mWindowAnimationBackground == null
|
||||
|| (winAnimator.mAnimLayer <
|
||||
mWindowAnimationBackground.mWinAnimator.mAnimLayer)) {
|
||||
mWindowAnimationBackground = w;
|
||||
mWindowAnimationBackground = win;
|
||||
mWindowAnimationBackgroundColor = backgroundColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (wasAnimating && !winAnimator.mAnimating && mService.mWallpaperTarget == w) {
|
||||
if (wasAnimating && !winAnimator.mAnimating && mService.mWallpaperTarget == win) {
|
||||
mBulkUpdateParams |= SET_WALLPAPER_MAY_CHANGE;
|
||||
mPendingLayoutChanges |= WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
|
||||
if (WindowManagerService.DEBUG_LAYOUT_REPEATS) {
|
||||
@@ -237,11 +241,11 @@ public class WindowAnimator {
|
||||
}
|
||||
}
|
||||
|
||||
if (mPolicy.doesForceHide(w, attrs)) {
|
||||
if (mPolicy.doesForceHide(win, win.mAttrs)) {
|
||||
if (!wasAnimating && nowAnimating) {
|
||||
if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(TAG,
|
||||
"Animation started that could impact force hide: "
|
||||
+ w);
|
||||
+ win);
|
||||
mBulkUpdateParams |= SET_FORCE_HIDING_CHANGED;
|
||||
mPendingLayoutChanges |= WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
|
||||
if (WindowManagerService.DEBUG_LAYOUT_REPEATS) {
|
||||
@@ -249,22 +253,22 @@ public class WindowAnimator {
|
||||
mPendingLayoutChanges);
|
||||
}
|
||||
mService.mFocusMayChange = true;
|
||||
} else if (w.isReadyForDisplay() && winAnimator.mAnimation == null) {
|
||||
} else if (win.isReadyForDisplay() && winAnimator.mAnimation == null) {
|
||||
mForceHiding = true;
|
||||
}
|
||||
} else if (mPolicy.canBeForceHidden(w, attrs)) {
|
||||
} else if (mPolicy.canBeForceHidden(win, win.mAttrs)) {
|
||||
final boolean changed;
|
||||
if (mForceHiding) {
|
||||
changed = w.hideLw(false, false);
|
||||
changed = win.hideLw(false, false);
|
||||
if (WindowManagerService.DEBUG_VISIBILITY && changed) Slog.v(TAG,
|
||||
"Now policy hidden: " + w);
|
||||
"Now policy hidden: " + win);
|
||||
} else {
|
||||
changed = w.showLw(false, false);
|
||||
changed = win.showLw(false, false);
|
||||
if (WindowManagerService.DEBUG_VISIBILITY && changed) Slog.v(TAG,
|
||||
"Now policy shown: " + w);
|
||||
"Now policy shown: " + win);
|
||||
if (changed) {
|
||||
if ((mBulkUpdateParams & SET_FORCE_HIDING_CHANGED) != 0
|
||||
&& w.isVisibleNow() /*w.isReadyForDisplay()*/) {
|
||||
&& win.isVisibleNow() /*w.isReadyForDisplay()*/) {
|
||||
// Assume we will need to animate. If
|
||||
// we don't (because the wallpaper will
|
||||
// stay with the lock screen), then we will
|
||||
@@ -274,7 +278,7 @@ public class WindowAnimator {
|
||||
winAnimator.setAnimation(a);
|
||||
}
|
||||
}
|
||||
if (mCurrentFocus == null || mCurrentFocus.mLayer < w.mLayer) {
|
||||
if (mCurrentFocus == null || mCurrentFocus.mLayer < win.mLayer) {
|
||||
// We are showing on to of the current
|
||||
// focus, so re-evaluate focus to make
|
||||
// sure it is correct.
|
||||
@@ -282,8 +286,7 @@ public class WindowAnimator {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (changed && (attrs.flags
|
||||
& WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER) != 0) {
|
||||
if (changed && (flags & WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER) != 0) {
|
||||
mBulkUpdateParams |= SET_WALLPAPER_MAY_CHANGE;
|
||||
mPendingLayoutChanges |= WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
|
||||
if (WindowManagerService.DEBUG_LAYOUT_REPEATS) {
|
||||
@@ -294,44 +297,43 @@ public class WindowAnimator {
|
||||
}
|
||||
}
|
||||
|
||||
final AppWindowToken atoken = w.mAppToken;
|
||||
final AppWindowToken atoken = win.mAppToken;
|
||||
if (atoken != null && (!atoken.allDrawn || atoken.mAppAnimator.freezingScreen)) {
|
||||
if (atoken.lastTransactionSequence != mTransactionSequence) {
|
||||
atoken.lastTransactionSequence = mTransactionSequence;
|
||||
atoken.numInterestingWindows = atoken.numDrawnWindows = 0;
|
||||
atoken.startingDisplayed = false;
|
||||
}
|
||||
if ((w.isOnScreen() || w.mAttrs.type
|
||||
if ((win.isOnScreen() || winAnimator.mAttrType
|
||||
== WindowManager.LayoutParams.TYPE_BASE_APPLICATION)
|
||||
&& !w.mExiting && !w.mDestroying) {
|
||||
&& !win.mExiting && !win.mDestroying) {
|
||||
if (WindowManagerService.DEBUG_VISIBILITY ||
|
||||
WindowManagerService.DEBUG_ORIENTATION) {
|
||||
Slog.v(TAG, "Eval win " + w + ": isDrawn="
|
||||
+ w.isDrawnLw()
|
||||
Slog.v(TAG, "Eval win " + win + ": isDrawn=" + win.isDrawnLw()
|
||||
+ ", isAnimating=" + winAnimator.isAnimating());
|
||||
if (!w.isDrawnLw()) {
|
||||
if (!win.isDrawnLw()) {
|
||||
Slog.v(TAG, "Not displayed: s=" + winAnimator.mSurface
|
||||
+ " pv=" + w.mPolicyVisibility
|
||||
+ " pv=" + win.mPolicyVisibility
|
||||
+ " mDrawState=" + winAnimator.mDrawState
|
||||
+ " ah=" + w.mAttachedHidden
|
||||
+ " ah=" + win.mAttachedHidden
|
||||
+ " th=" + atoken.hiddenRequested
|
||||
+ " a=" + winAnimator.mAnimating);
|
||||
}
|
||||
}
|
||||
if (w != atoken.startingWindow) {
|
||||
if (!atoken.mAppAnimator.freezingScreen || !w.mAppFreezing) {
|
||||
if (win != atoken.startingWindow) {
|
||||
if (!atoken.mAppAnimator.freezingScreen || !win.mAppFreezing) {
|
||||
atoken.numInterestingWindows++;
|
||||
if (w.isDrawnLw()) {
|
||||
if (win.isDrawnLw()) {
|
||||
atoken.numDrawnWindows++;
|
||||
if (WindowManagerService.DEBUG_VISIBILITY ||
|
||||
WindowManagerService.DEBUG_ORIENTATION) Slog.v(TAG,
|
||||
"tokenMayBeDrawn: " + atoken
|
||||
+ " freezingScreen=" + atoken.mAppAnimator.freezingScreen
|
||||
+ " mAppFreezing=" + w.mAppFreezing);
|
||||
+ " mAppFreezing=" + win.mAppFreezing);
|
||||
mTokenMayBeDrawn = true;
|
||||
}
|
||||
}
|
||||
} else if (w.isDrawnLw()) {
|
||||
} else if (win.isDrawnLw()) {
|
||||
atoken.startingDisplayed = true;
|
||||
}
|
||||
}
|
||||
@@ -371,7 +373,7 @@ public class WindowAnimator {
|
||||
"allDrawn: " + wtoken
|
||||
+ " interesting=" + numInteresting
|
||||
+ " drawn=" + wtoken.numDrawnWindows);
|
||||
wtoken.showAllWindowsLocked();
|
||||
wtoken.mAppAnimator.showAllWindowsLocked();
|
||||
mService.unsetAppFreezingScreenLocked(wtoken, false, true);
|
||||
if (WindowManagerService.DEBUG_ORIENTATION) Slog.i(TAG,
|
||||
"Setting mOrientationChangeComplete=true because wtoken "
|
||||
@@ -394,7 +396,7 @@ public class WindowAnimator {
|
||||
|
||||
// We can now show all of the drawn windows!
|
||||
if (!mService.mOpeningApps.contains(wtoken)) {
|
||||
mAnimating |= wtoken.showAllWindowsLocked();
|
||||
mAnimating |= wtoken.mAppAnimator.showAllWindowsLocked();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -435,9 +437,16 @@ public class WindowAnimator {
|
||||
mScreenRotationAnimation.updateSurfaces();
|
||||
}
|
||||
|
||||
for (int i = mService.mWindows.size() - 1; i >= 0; i--) {
|
||||
WindowState w = mService.mWindows.get(i);
|
||||
w.mWinAnimator.prepareSurfaceLocked(true);
|
||||
mFinished.clear();
|
||||
for (final WindowStateAnimator winAnimator : mWinAnimators) {
|
||||
if (winAnimator.mSurface == null) {
|
||||
mFinished.add(winAnimator);
|
||||
} else {
|
||||
winAnimator.prepareSurfaceLocked(true);
|
||||
}
|
||||
}
|
||||
for (final WindowStateAnimator winAnimator : mFinished) {
|
||||
mWinAnimators.remove(winAnimator);
|
||||
}
|
||||
|
||||
if (mDimParams != null) {
|
||||
@@ -509,4 +518,18 @@ public class WindowAnimator {
|
||||
pw.println( " no DimAnimator ");
|
||||
}
|
||||
}
|
||||
|
||||
static class SetAnimationParams {
|
||||
final WindowStateAnimator mWinAnimator;
|
||||
final Animation mAnimation;
|
||||
final int mAnimDw;
|
||||
final int mAnimDh;
|
||||
public SetAnimationParams(final WindowStateAnimator winAnimator,
|
||||
final Animation animation, final int animDw, final int animDh) {
|
||||
mWinAnimator = winAnimator;
|
||||
mAnimation = animation;
|
||||
mAnimDw = animDw;
|
||||
mAnimDh = animDh;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -351,32 +351,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
* controlling the ordering of windows in different applications. This
|
||||
* contains AppWindowToken objects.
|
||||
*/
|
||||
final ArrayList<AppWindowToken> mAppTokens = new ArrayList<AppWindowToken>() {
|
||||
@Override
|
||||
public void add(int index, AppWindowToken object) {
|
||||
synchronized (mAnimator) {
|
||||
super.add(index, object);
|
||||
}
|
||||
};
|
||||
@Override
|
||||
public boolean add(AppWindowToken object) {
|
||||
synchronized (mAnimator) {
|
||||
return super.add(object);
|
||||
}
|
||||
};
|
||||
@Override
|
||||
public AppWindowToken remove(int index) {
|
||||
synchronized (mAnimator) {
|
||||
return super.remove(index);
|
||||
}
|
||||
};
|
||||
@Override
|
||||
public boolean remove(Object object) {
|
||||
synchronized (mAnimator) {
|
||||
return super.remove(object);
|
||||
}
|
||||
};
|
||||
};
|
||||
final ArrayList<AppWindowToken> mAppTokens = new ArrayList<AppWindowToken>();
|
||||
|
||||
/**
|
||||
* Application tokens that are in the process of exiting, but still
|
||||
@@ -393,32 +368,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
/**
|
||||
* Z-ordered (bottom-most first) list of all Window objects.
|
||||
*/
|
||||
final ArrayList<WindowState> mWindows = new ArrayList<WindowState>() {
|
||||
@Override
|
||||
public void add(int index, WindowState object) {
|
||||
synchronized (mAnimator) {
|
||||
super.add(index, object);
|
||||
}
|
||||
};
|
||||
@Override
|
||||
public boolean add(WindowState object) {
|
||||
synchronized (mAnimator) {
|
||||
return super.add(object);
|
||||
}
|
||||
};
|
||||
@Override
|
||||
public WindowState remove(int index) {
|
||||
synchronized (mAnimator) {
|
||||
return super.remove(index);
|
||||
}
|
||||
};
|
||||
@Override
|
||||
public boolean remove(Object object) {
|
||||
synchronized (mAnimator) {
|
||||
return super.remove(object);
|
||||
}
|
||||
};
|
||||
};
|
||||
final ArrayList<WindowState> mWindows = new ArrayList<WindowState>();
|
||||
|
||||
/**
|
||||
* Fake windows added to the window manager. Note: ordered from top to
|
||||
@@ -6504,6 +6454,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
public static final int SET_TRANSPARENT_REGION = ANIMATOR_WHAT_OFFSET + 1;
|
||||
public static final int SET_WALLPAPER_OFFSET = ANIMATOR_WHAT_OFFSET + 2;
|
||||
public static final int SET_DIM_PARAMETERS = ANIMATOR_WHAT_OFFSET + 3;
|
||||
public static final int SET_MOVE_ANIMATION = ANIMATOR_WHAT_OFFSET + 4;
|
||||
|
||||
private Session mLastReportedHold;
|
||||
|
||||
@@ -6942,33 +6893,37 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
|
||||
// Animation messages. Move to Window{State}Animator
|
||||
case SET_TRANSPARENT_REGION: {
|
||||
// TODO(cmautner): Remove sync.
|
||||
synchronized (mAnimator) {
|
||||
Pair<WindowStateAnimator, Region> pair =
|
||||
Pair<WindowStateAnimator, Region> pair =
|
||||
(Pair<WindowStateAnimator, Region>) msg.obj;
|
||||
final WindowStateAnimator winAnimator = pair.first;
|
||||
winAnimator.setTransparentRegionHint(pair.second);
|
||||
}
|
||||
final WindowStateAnimator winAnimator = pair.first;
|
||||
winAnimator.setTransparentRegionHint(pair.second);
|
||||
|
||||
scheduleAnimationLocked();
|
||||
break;
|
||||
}
|
||||
|
||||
case SET_WALLPAPER_OFFSET: {
|
||||
// TODO(cmautner): Remove sync.
|
||||
synchronized (mAnimator) {
|
||||
final WindowStateAnimator winAnimator = (WindowStateAnimator) msg.obj;
|
||||
winAnimator.setWallpaperOffset(msg.arg1, msg.arg2);
|
||||
}
|
||||
final WindowStateAnimator winAnimator = (WindowStateAnimator) msg.obj;
|
||||
winAnimator.setWallpaperOffset(msg.arg1, msg.arg2);
|
||||
|
||||
scheduleAnimationLocked();
|
||||
break;
|
||||
}
|
||||
|
||||
case SET_DIM_PARAMETERS: {
|
||||
synchronized (mAnimator) {
|
||||
mAnimator.mDimParams = (DimAnimator.Parameters) msg.obj;
|
||||
}
|
||||
mAnimator.mDimParams = (DimAnimator.Parameters) msg.obj;
|
||||
|
||||
scheduleAnimationLocked();
|
||||
break;
|
||||
}
|
||||
|
||||
case SET_MOVE_ANIMATION: {
|
||||
WindowAnimator.SetAnimationParams params =
|
||||
(WindowAnimator.SetAnimationParams) msg.obj;
|
||||
WindowStateAnimator winAnimator = params.mWinAnimator;
|
||||
winAnimator.setAnimation(params.mAnimation);
|
||||
winAnimator.mAnimDw = params.mAnimDw;
|
||||
winAnimator.mAnimDh = params.mAnimDh;
|
||||
|
||||
scheduleAnimationLocked();
|
||||
break;
|
||||
@@ -7752,20 +7707,19 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
AppWindowToken topOpeningApp = null;
|
||||
int topOpeningLayer = 0;
|
||||
|
||||
// TODO(cmautner): Move to animation side.
|
||||
NN = mOpeningApps.size();
|
||||
for (i=0; i<NN; i++) {
|
||||
AppWindowToken wtoken = mOpeningApps.get(i);
|
||||
if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
|
||||
"Now opening app" + wtoken);
|
||||
if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "Now opening app" + wtoken);
|
||||
wtoken.mAppAnimator.clearThumbnail();
|
||||
wtoken.reportedVisible = false;
|
||||
wtoken.inPendingTransaction = false;
|
||||
wtoken.mAppAnimator.animation = null;
|
||||
setTokenVisibilityLocked(wtoken, animLp, true,
|
||||
transit, false);
|
||||
setTokenVisibilityLocked(wtoken, animLp, true, transit, false);
|
||||
wtoken.updateReportedVisibilityLocked();
|
||||
wtoken.waitingToShow = false;
|
||||
mAnimator.mAnimating |= wtoken.showAllWindowsLocked();
|
||||
mAnimator.mAnimating |= wtoken.mAppAnimator.showAllWindowsLocked();
|
||||
if (animLp != null) {
|
||||
int layer = -1;
|
||||
for (int j=0; j<wtoken.windows.size(); j++) {
|
||||
@@ -8624,6 +8578,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
wsa.mSurfaceShown = false;
|
||||
wsa.mSurface = null;
|
||||
ws.mHasSurface = false;
|
||||
mAnimator.mWinAnimators.remove(wsa);
|
||||
mForceRemoves.add(ws);
|
||||
i--;
|
||||
N--;
|
||||
@@ -8637,6 +8592,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
wsa.mSurfaceShown = false;
|
||||
wsa.mSurface = null;
|
||||
ws.mHasSurface = false;
|
||||
mAnimator.mWinAnimators.remove(wsa);
|
||||
leakedSurface = true;
|
||||
}
|
||||
}
|
||||
@@ -8676,6 +8632,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
winAnimator.mSurfaceShown = false;
|
||||
winAnimator.mSurface = null;
|
||||
winAnimator.mWin.mHasSurface = false;
|
||||
mAnimator.mWinAnimators.remove(winAnimator);
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@@ -121,6 +121,9 @@ class WindowStateAnimator {
|
||||
/** 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 @@ class WindowStateAnimator {
|
||||
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 @@ class WindowStateAnimator {
|
||||
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 @@ class WindowStateAnimator {
|
||||
+ " / " + 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 @@ class WindowStateAnimator {
|
||||
mSurfaceShown = false;
|
||||
mSurface = null;
|
||||
mWin.mHasSurface =false;
|
||||
mAnimator.mWinAnimators.remove(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user