Skip to content

Commit 8a197a4

Browse files
author
Craig Mautner
committed
Fix dark flash when transition ends.
The DimSurface layer was momentarily being placed above the entering app animtion. This lets the layering be set after the animations have been evaluated. Plus debug enhancements. Change-Id: Icc034bc5264ae9bc6c57c593534683b56588b59a
1 parent bdb1c40 commit 8a197a4

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

services/java/com/android/server/wm/AppWindowAnimator.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public AppWindowAnimator(final WindowManagerService service, final AppWindowToke
5454

5555
public void setAnimation(Animation anim, boolean initialized) {
5656
if (WindowManagerService.localLOGV) Slog.v(
57-
TAG, "Setting animation in " + this + ": " + anim);
57+
TAG, "Setting animation in " + mAppToken + ": " + anim);
5858
animation = anim;
5959
animating = false;
6060
animInitialized = initialized;
@@ -81,7 +81,7 @@ public void setAnimation(Animation anim, boolean initialized) {
8181
public void setDummyAnimation() {
8282
if (animation == null) {
8383
if (WindowManagerService.localLOGV) Slog.v(
84-
TAG, "Setting dummy animation in " + this);
84+
TAG, "Setting dummy animation in " + mAppToken);
8585
animation = sDummyAnimation;
8686
animInitialized = false;
8787
}
@@ -165,12 +165,12 @@ private boolean stepAnimation(long currentTime) {
165165
transformation.clear();
166166
final boolean more = animation.getTransformation(currentTime, transformation);
167167
if (WindowManagerService.DEBUG_ANIM) Slog.v(
168-
TAG, "Stepped animation in " + this + ": more=" + more + ", xform=" + transformation);
168+
TAG, "Stepped animation in " + mAppToken + ": more=" + more + ", xform=" + transformation);
169169
if (!more) {
170170
animation = null;
171171
clearThumbnail();
172172
if (WindowManagerService.DEBUG_ANIM) Slog.v(
173-
TAG, "Finished animation in " + this + " @ " + currentTime);
173+
TAG, "Finished animation in " + mAppToken + " @ " + currentTime);
174174
}
175175
hasTransformation = more;
176176
return more;
@@ -195,7 +195,7 @@ boolean stepAnimationLocked(long currentTime, int dw, int dh) {
195195
&& animation != null) {
196196
if (!animating) {
197197
if (WindowManagerService.DEBUG_ANIM) Slog.v(
198-
TAG, "Starting animation in " + this +
198+
TAG, "Starting animation in " + mAppToken +
199199
" @ " + currentTime + ": dw=" + dw + " dh=" + dh
200200
+ " scale=" + mService.mTransitionAnimationScale
201201
+ " allDrawn=" + mAppToken.allDrawn + " animating=" + animating);
@@ -248,7 +248,7 @@ boolean stepAnimationLocked(long currentTime, int dw, int dh) {
248248
}
249249

250250
if (WindowManagerService.DEBUG_ANIM) Slog.v(
251-
TAG, "Animation done in " + this
251+
TAG, "Animation done in " + mAppToken
252252
+ ": reportedVisible=" + mAppToken.reportedVisible);
253253

254254
transformation.clear();

services/java/com/android/server/wm/DimSurface.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,17 @@ class DimSurface {
3333
DimSurface(SurfaceSession session) {
3434
if (mDimSurface == null) {
3535
try {
36-
mDimSurface = new Surface(session, 0,
36+
if (WindowManagerService.DEBUG_SURFACE_TRACE) {
37+
mDimSurface = new WindowStateAnimator.SurfaceTrace(session, 0,
3738
"DimSurface",
3839
-1, 16, 16, PixelFormat.OPAQUE,
3940
Surface.FX_SURFACE_DIM);
41+
} else {
42+
mDimSurface = new Surface(session, 0,
43+
"DimSurface",
44+
-1, 16, 16, PixelFormat.OPAQUE,
45+
Surface.FX_SURFACE_DIM);
46+
}
4047
if (WindowManagerService.SHOW_TRANSACTIONS ||
4148
WindowManagerService.SHOW_SURFACE_ALLOC) Slog.i(WindowManagerService.TAG,
4249
" DIM " + mDimSurface + ": CREATE");

services/java/com/android/server/wm/WindowAnimator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,9 +451,9 @@ synchronized void animate() {
451451
Surface.openTransaction();
452452

453453
try {
454-
testWallpaperAndBackgroundLocked();
455454
updateWindowsAppsAndRotationAnimationsLocked();
456455
performAnimationsLocked();
456+
testWallpaperAndBackgroundLocked();
457457

458458
// THIRD LOOP: Update the surfaces of all windows.
459459

0 commit comments

Comments
 (0)