Loading services/core/java/com/android/server/wm/AppWindowToken.java +13 −4 Original line number Diff line number Diff line Loading @@ -340,6 +340,7 @@ class AppWindowToken extends WindowToken { } void clearAnimatingFlags() { boolean wallpaperMightChange = false; for (int i = allAppWindows.size() - 1; i >= 0; i--) { final WindowState win = allAppWindows.get(i); // We don't want to clear it out for windows that get replaced, because the Loading @@ -350,7 +351,6 @@ class AppWindowToken extends WindowToken { // by the client. We should let animation proceed and not clear this flag or // they won't eventually be removed by WindowStateAnimator#finishExit. if (!win.mWillReplaceWindow && !win.mRemoveOnExit) { win.mAnimatingExit = false; // Clear mAnimating flag together with mAnimatingExit. When animation // changes from exiting to entering, we need to clear this flag until the // new animation gets applied, so that isAnimationStarting() becomes true Loading @@ -358,16 +358,25 @@ class AppWindowToken extends WindowToken { // Otherwise applySurfaceChangesTransaction will faill to skip surface // placement for this window during this period, one or more frame will // show up with wrong position or scale. if (win.mAnimatingExit) { win.mAnimatingExit = false; wallpaperMightChange = true; } if (win.mWinAnimator.mAnimating) { win.mWinAnimator.mAnimating = false; wallpaperMightChange = true; } if (win.mDestroying) { win.mDestroying = false; service.mDestroySurface.remove(win); wallpaperMightChange = true; } } } if (wallpaperMightChange) { requestUpdateWallpaperIfNeeded(); } } void destroySurfaces() { destroySurfaces(false /*cleanupOnResume*/); Loading services/core/java/com/android/server/wm/WallpaperController.java +21 −9 Original line number Diff line number Diff line Loading @@ -586,9 +586,14 @@ class WallpaperController { if (DEBUG_WALLPAPER_LIGHT) Slog.v(TAG, "New i: " + wallpaperTargetIndex + " old i: " + oldI); if (oldI >= 0) { if (DEBUG_WALLPAPER_LIGHT) Slog.v(TAG, "Animating wallpapers: old#" + oldI + "=" + oldW + "; new#" + wallpaperTargetIndex + "=" + wallpaperTarget); final boolean newTargetHidden = wallpaperTarget.mAppToken != null && wallpaperTarget.mAppToken.hiddenRequested; final boolean oldTargetHidden = oldW.mAppToken != null && oldW.mAppToken.hiddenRequested; if (DEBUG_WALLPAPER_LIGHT) Slog.v(TAG, "Animating wallpapers:" + " old#" + oldI + "=" + oldW + " hidden=" + oldTargetHidden + " new#" + wallpaperTargetIndex + "=" + wallpaperTarget + " hidden=" + newTargetHidden); // Set the upper and lower wallpaper targets correctly, // and make sure that we are positioning the wallpaper below the lower. Loading @@ -598,6 +603,7 @@ class WallpaperController { "Found target above old target."); mUpperWallpaperTarget = wallpaperTarget; mLowerWallpaperTarget = oldW; wallpaperTarget = oldW; wallpaperTargetIndex = oldI; } else { Loading @@ -607,15 +613,21 @@ class WallpaperController { mUpperWallpaperTarget = oldW; mLowerWallpaperTarget = wallpaperTarget; } // If the new target is going hidden, set it back to the old target. if (wallpaperTarget.mAppToken != null && wallpaperTarget.mAppToken.hiddenRequested) { if (newTargetHidden && !oldTargetHidden) { if (DEBUG_WALLPAPER_LIGHT) Slog.v(TAG, "Old wallpaper still the target."); // Use the old target if new target is hidden but old target // is not. If they're both hidden, still use the new target. mWallpaperTarget = oldW; } else if (newTargetHidden == oldTargetHidden && !mService.mOpeningApps.contains(wallpaperTarget.mAppToken) && (mService.mOpeningApps.contains(oldW.mAppToken) || mService.mClosingApps.contains(oldW.mAppToken))) { // If they're both hidden (or both not hidden), prefer the one that's // currently in opening or closing app list, this allows transition // selection logic to better determine the wallpaper status of // opening/closing apps. mWallpaperTarget = oldW; wallpaperTarget = oldW; wallpaperTargetIndex = oldI; } } } Loading Loading
services/core/java/com/android/server/wm/AppWindowToken.java +13 −4 Original line number Diff line number Diff line Loading @@ -340,6 +340,7 @@ class AppWindowToken extends WindowToken { } void clearAnimatingFlags() { boolean wallpaperMightChange = false; for (int i = allAppWindows.size() - 1; i >= 0; i--) { final WindowState win = allAppWindows.get(i); // We don't want to clear it out for windows that get replaced, because the Loading @@ -350,7 +351,6 @@ class AppWindowToken extends WindowToken { // by the client. We should let animation proceed and not clear this flag or // they won't eventually be removed by WindowStateAnimator#finishExit. if (!win.mWillReplaceWindow && !win.mRemoveOnExit) { win.mAnimatingExit = false; // Clear mAnimating flag together with mAnimatingExit. When animation // changes from exiting to entering, we need to clear this flag until the // new animation gets applied, so that isAnimationStarting() becomes true Loading @@ -358,16 +358,25 @@ class AppWindowToken extends WindowToken { // Otherwise applySurfaceChangesTransaction will faill to skip surface // placement for this window during this period, one or more frame will // show up with wrong position or scale. if (win.mAnimatingExit) { win.mAnimatingExit = false; wallpaperMightChange = true; } if (win.mWinAnimator.mAnimating) { win.mWinAnimator.mAnimating = false; wallpaperMightChange = true; } if (win.mDestroying) { win.mDestroying = false; service.mDestroySurface.remove(win); wallpaperMightChange = true; } } } if (wallpaperMightChange) { requestUpdateWallpaperIfNeeded(); } } void destroySurfaces() { destroySurfaces(false /*cleanupOnResume*/); Loading
services/core/java/com/android/server/wm/WallpaperController.java +21 −9 Original line number Diff line number Diff line Loading @@ -586,9 +586,14 @@ class WallpaperController { if (DEBUG_WALLPAPER_LIGHT) Slog.v(TAG, "New i: " + wallpaperTargetIndex + " old i: " + oldI); if (oldI >= 0) { if (DEBUG_WALLPAPER_LIGHT) Slog.v(TAG, "Animating wallpapers: old#" + oldI + "=" + oldW + "; new#" + wallpaperTargetIndex + "=" + wallpaperTarget); final boolean newTargetHidden = wallpaperTarget.mAppToken != null && wallpaperTarget.mAppToken.hiddenRequested; final boolean oldTargetHidden = oldW.mAppToken != null && oldW.mAppToken.hiddenRequested; if (DEBUG_WALLPAPER_LIGHT) Slog.v(TAG, "Animating wallpapers:" + " old#" + oldI + "=" + oldW + " hidden=" + oldTargetHidden + " new#" + wallpaperTargetIndex + "=" + wallpaperTarget + " hidden=" + newTargetHidden); // Set the upper and lower wallpaper targets correctly, // and make sure that we are positioning the wallpaper below the lower. Loading @@ -598,6 +603,7 @@ class WallpaperController { "Found target above old target."); mUpperWallpaperTarget = wallpaperTarget; mLowerWallpaperTarget = oldW; wallpaperTarget = oldW; wallpaperTargetIndex = oldI; } else { Loading @@ -607,15 +613,21 @@ class WallpaperController { mUpperWallpaperTarget = oldW; mLowerWallpaperTarget = wallpaperTarget; } // If the new target is going hidden, set it back to the old target. if (wallpaperTarget.mAppToken != null && wallpaperTarget.mAppToken.hiddenRequested) { if (newTargetHidden && !oldTargetHidden) { if (DEBUG_WALLPAPER_LIGHT) Slog.v(TAG, "Old wallpaper still the target."); // Use the old target if new target is hidden but old target // is not. If they're both hidden, still use the new target. mWallpaperTarget = oldW; } else if (newTargetHidden == oldTargetHidden && !mService.mOpeningApps.contains(wallpaperTarget.mAppToken) && (mService.mOpeningApps.contains(oldW.mAppToken) || mService.mClosingApps.contains(oldW.mAppToken))) { // If they're both hidden (or both not hidden), prefer the one that's // currently in opening or closing app list, this allows transition // selection logic to better determine the wallpaper status of // opening/closing apps. mWallpaperTarget = oldW; wallpaperTarget = oldW; wallpaperTargetIndex = oldI; } } } Loading