Merge "Fix wallpaper crop during unlock animation" into nyc-dev am: d4a45e0c40

am: d2b0d2e231

* commit 'd2b0d2e231dc09231e5bfe52ae42b7f16e7f03c2':
  Fix wallpaper crop during unlock animation

Change-Id: I215425d36b6bf8822c91809e8ff7fbd635b5eb11
This commit is contained in:
Chong Zhang
2016-05-24 17:30:46 +00:00
committed by android-build-merger

View File

@@ -1334,7 +1334,17 @@ class WindowStateAnimator {
final WindowState wallpaperTarget = mWallpaperControllerLocked.getWallpaperTarget(); final WindowState wallpaperTarget = mWallpaperControllerLocked.getWallpaperTarget();
if (wallpaperTarget != null) { if (wallpaperTarget != null) {
final Task task = wallpaperTarget.getTask(); final Task task = wallpaperTarget.getTask();
if (task != null && !task.isFullscreen()) { final WindowStateAnimator winAnimator = wallpaperTarget.mWinAnimator;
// We can only crop the wallpaper using final crop with stack bounds if the target
// is not animating, or if it's animating with clip mode STACK_CLIP_AFTER_ANIM.
// If it's animating with mode STACK_CLIP_NONE, we shouldn't crop either the task
// itself or the wallpaper. If it's animating with STACK_CLIP_BEFORE_ANIM, the crop
// is before the transform on the task itself.
final boolean useFinalCropOnWallpaper = !winAnimator.isAnimationSet()
|| winAnimator.resolveStackClip() == STACK_CLIP_AFTER_ANIM;
if (task != null && !task.isFullscreen()
&& task.cropWindowsToStackBounds()
&& useFinalCropOnWallpaper){
final TaskStack stack = task.mStack; final TaskStack stack = task.mStack;
if (stack != null && !stack.isFullscreen()) { if (stack != null && !stack.isFullscreen()) {
stack.getDimBounds(mTmpStackBounds); stack.getDimBounds(mTmpStackBounds);