Fix Home key causes wrong animation
Wallpaper logic assumed that if mWallpaperTarget was non-null then any wallpaper animation should be exiting. However, if the existing wallpaper target was already animating away then mWallpaperTarget remains non-null until it is completely gone. Pressing Home during this time was causing the next animation to exit rather than reverse and enter. This fix looks to see if the wallpaper target is animating and if it is to treat it as null for the purpose of determining which direction the animation should go. Fixes bug 6407941. Change-Id: I731267328db0f9972a5aed6f214962f96737dd07
This commit is contained in:
@@ -140,6 +140,8 @@ public class WindowAnimator {
|
||||
mService.debugLayoutRepeats("appToken " + appAnimator.mAppToken + " done",
|
||||
mPendingLayoutChanges);
|
||||
}
|
||||
if (WindowManagerService.DEBUG_ANIM) Slog.v(TAG,
|
||||
"updateWindowsApps...: done animating " + appAnimator.mAppToken);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,9 +156,11 @@ public class WindowAnimator {
|
||||
// stopped animating, do one more pass through the layout
|
||||
mPendingLayoutChanges |= WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
|
||||
if (WindowManagerService.DEBUG_LAYOUT_REPEATS) {
|
||||
mService.debugLayoutRepeats("exiting appToken " + appAnimator.mAppToken
|
||||
mService.debugLayoutRepeats("exiting appToken " + appAnimator.mAppToken
|
||||
+ " done", mPendingLayoutChanges);
|
||||
}
|
||||
if (WindowManagerService.DEBUG_ANIM) Slog.v(TAG,
|
||||
"updateWindowsApps...: done animating exiting " + appAnimator.mAppToken);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,9 +250,9 @@ public class WindowAnimator {
|
||||
|
||||
if (mPolicy.doesForceHide(win, win.mAttrs)) {
|
||||
if (!wasAnimating && nowAnimating) {
|
||||
if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(TAG,
|
||||
"Animation started that could impact force hide: "
|
||||
+ win);
|
||||
if (WindowManagerService.DEBUG_ANIM ||
|
||||
WindowManagerService.DEBUG_VISIBILITY) Slog.v(TAG,
|
||||
"Animation started that could impact force hide: " + win);
|
||||
mBulkUpdateParams |= SET_FORCE_HIDING_CHANGED;
|
||||
mPendingLayoutChanges |= WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
|
||||
if (WindowManagerService.DEBUG_LAYOUT_REPEATS) {
|
||||
|
||||
@@ -130,8 +130,6 @@ import android.view.animation.AnimationSet;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.view.animation.Interpolator;
|
||||
import android.view.animation.ScaleAnimation;
|
||||
import android.view.animation.Transformation;
|
||||
import android.view.animation.TranslateAnimation;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.DataInputStream;
|
||||
@@ -3231,12 +3229,21 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
if (mNextAppTransitionType == ActivityOptions.ANIM_CUSTOM) {
|
||||
a = loadAnimation(mNextAppTransitionPackage, enter ?
|
||||
mNextAppTransitionEnter : mNextAppTransitionExit);
|
||||
if (DEBUG_ANIM) Slog.v(TAG, "applyAnimation: wtoken=" + wtoken
|
||||
+ " anim=" + a + " nextAppTransition=ANIM_CUSTOM"
|
||||
+ " transit=" + transit + " Callers " + Debug.getCallers(3));
|
||||
} else if (mNextAppTransitionType == ActivityOptions.ANIM_SCALE_UP) {
|
||||
a = createScaleUpAnimationLocked(transit, enter);
|
||||
initialized = true;
|
||||
if (DEBUG_ANIM) Slog.v(TAG, "applyAnimation: wtoken=" + wtoken
|
||||
+ " anim=" + a + " nextAppTransition=ANIM_SCALE_UP"
|
||||
+ " transit=" + transit + " Callers " + Debug.getCallers(3));
|
||||
} else if (mNextAppTransitionType == ActivityOptions.ANIM_THUMBNAIL) {
|
||||
a = createThumbnailAnimationLocked(transit, enter, false);
|
||||
initialized = true;
|
||||
if (DEBUG_ANIM) Slog.v(TAG, "applyAnimation: wtoken=" + wtoken
|
||||
+ " anim=" + a + " nextAppTransition=ANIM_THUMBNAIL"
|
||||
+ " transit=" + transit + " Callers " + Debug.getCallers(3));
|
||||
} else {
|
||||
int animAttr = 0;
|
||||
switch (transit) {
|
||||
@@ -3295,7 +3302,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
if (DEBUG_ANIM) Slog.v(TAG, "applyAnimation: wtoken=" + wtoken
|
||||
+ " anim=" + a
|
||||
+ " animAttr=0x" + Integer.toHexString(animAttr)
|
||||
+ " transit=" + transit);
|
||||
+ " transit=" + transit + " Callers " + Debug.getCallers(3));
|
||||
}
|
||||
if (a != null) {
|
||||
if (DEBUG_ANIM) {
|
||||
@@ -7810,7 +7817,9 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
mToTopApps.clear();
|
||||
}
|
||||
|
||||
WindowState oldWallpaper = mWallpaperTarget;
|
||||
WindowState oldWallpaper =
|
||||
mWallpaperTarget != null && mWallpaperTarget.mWinAnimator.isAnimating()
|
||||
? null : mWallpaperTarget;
|
||||
|
||||
adjustWallpaperWindowsLocked();
|
||||
mInnerFields.mWallpaperMayChange = false;
|
||||
@@ -8117,8 +8126,8 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
// to go through the process of getting informed
|
||||
// by the application when it has finished drawing.
|
||||
if (w.mOrientationChanging) {
|
||||
if (DEBUG_ORIENTATION) Slog.v(TAG,
|
||||
"Orientation start waiting for draw in "
|
||||
if (DEBUG_ANIM || DEBUG_ORIENTATION) Slog.v(TAG,
|
||||
"Orientation start waiting for draw mDrawState=DRAW_PENDING in "
|
||||
+ w + ", surface " + winAnimator.mSurface);
|
||||
winAnimator.mDrawState = WindowStateAnimator.DRAW_PENDING;
|
||||
if (w.mAppToken != null) {
|
||||
|
||||
@@ -380,8 +380,9 @@ class WindowStateAnimator {
|
||||
|
||||
boolean finishDrawingLocked() {
|
||||
if (mDrawState == DRAW_PENDING) {
|
||||
if (SHOW_TRANSACTIONS || DEBUG_ORIENTATION) Slog.v(
|
||||
TAG, "finishDrawingLocked: " + this + " in " + mSurface);
|
||||
if (DEBUG_ANIM || SHOW_TRANSACTIONS || DEBUG_ORIENTATION) Slog.v(
|
||||
TAG, "finishDrawingLocked: mDrawState=COMMIT_DRAW_PENDING " + this + " in "
|
||||
+ mSurface);
|
||||
mDrawState = COMMIT_DRAW_PENDING;
|
||||
return true;
|
||||
}
|
||||
@@ -393,7 +394,8 @@ class WindowStateAnimator {
|
||||
if (mDrawState != COMMIT_DRAW_PENDING) {
|
||||
return false;
|
||||
}
|
||||
//Slog.i(TAG, "commitFinishDrawingLocked: Draw pending. " + mSurface);
|
||||
if (DEBUG_ANIM)
|
||||
Slog.i(TAG, "commitFinishDrawingLocked: mDrawState=READY_TO_SHOW " + mSurface);
|
||||
mDrawState = READY_TO_SHOW;
|
||||
final boolean starting = mWin.mAttrs.type == TYPE_APPLICATION_STARTING;
|
||||
final AppWindowToken atoken = mWin.mAppToken;
|
||||
@@ -526,8 +528,8 @@ class WindowStateAnimator {
|
||||
if (mSurface == null) {
|
||||
mReportDestroySurface = false;
|
||||
mSurfacePendingDestroy = false;
|
||||
if (DEBUG_ORIENTATION) Slog.i(TAG,
|
||||
"createSurface " + this + ": DRAW NOW PENDING");
|
||||
if (DEBUG_ANIM || DEBUG_ORIENTATION) Slog.i(TAG,
|
||||
"createSurface " + this + ": mDrawState=DRAW_PENDING");
|
||||
mDrawState = DRAW_PENDING;
|
||||
if (mWin.mAppToken != null) {
|
||||
mWin.mAppToken.allDrawn = false;
|
||||
@@ -1062,6 +1064,9 @@ class WindowStateAnimator {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (DEBUG_ANIM) {
|
||||
Slog.v(TAG, "prepareSurface: No changes in animation for " + mWin);
|
||||
}
|
||||
displayed = true;
|
||||
}
|
||||
|
||||
@@ -1145,6 +1150,7 @@ class WindowStateAnimator {
|
||||
|
||||
// Force the show in the next prepareSurfaceLocked() call.
|
||||
mLastAlpha = -1;
|
||||
if (DEBUG_ANIM) Slog.v(TAG, "performShowLocked: mDrawState=HAS_DRAWN");
|
||||
mDrawState = HAS_DRAWN;
|
||||
mService.scheduleAnimationLocked();
|
||||
|
||||
@@ -1285,7 +1291,7 @@ class WindowStateAnimator {
|
||||
+ " anim=" + anim + " attr=0x" + Integer.toHexString(attr)
|
||||
+ " a=" + a
|
||||
+ " mAnimation=" + mAnimation
|
||||
+ " isEntrance=" + isEntrance);
|
||||
+ " isEntrance=" + isEntrance + " Callers " + Debug.getCallers(3));
|
||||
if (a != null) {
|
||||
if (WindowManagerService.DEBUG_ANIM) {
|
||||
RuntimeException e = null;
|
||||
|
||||
Reference in New Issue
Block a user