summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Riddle Hsu <riddlehsu@google.com> 2021-06-22 21:51:27 +0800
committer Riddle Hsu <riddlehsu@google.com> 2021-06-22 21:51:27 +0800
commitb8fe6eb7cae8e6c3329dcdc5a41f0880957b5d3c (patch)
treea9d5ecc42ac9239fcbff52e5f2e2ffff4cb9020f
parent184c61395ec061c7a73017daae73458daa774c30 (diff)
Ignore wallpaper enter animation
The alpha animation is almost unnoticeable and rare to execute (e.g. orientation change across visibility change). It would be more efficient, consistent and less error prone to skip the animation which user won't aware it. Though the original issue is about the surface position of wallpaper animation leash: 1. WallpaperController#updateWallpaperOffset may calculate wrong offset by using frames in different rotation. This can be fixed by early return if !isVisible(). 2. Even if the wallpaper offset is correct, the surface position calculated by wallpaper scale will be ignored in WindowState#updateSurfacePosition because the window is animating (mSurfaceAnimator.hasLeash()). This can be fixed by relaxing the condition if wallpaper scale is not 1. But as the reason described above, the simple bypass has more benefit. Bug: 191441606 Test: Launch landscape app from portriat home with traditional rotation animation (e.g. when IME is vieible), and then return to home with fixed (seamless) rotation. The wallpaper should not have extra offset temporarily. Change-Id: Iaa76ea38c27dffb96b2c1d39a3a7a9cd8fe246c4
-rw-r--r--services/core/java/com/android/server/wm/WindowStateAnimator.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java
index 9a6e4448966d..4471f6c91190 100644
--- a/services/core/java/com/android/server/wm/WindowStateAnimator.java
+++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java
@@ -683,8 +683,9 @@ class WindowStateAnimator {
}
// We don't apply animation for application main window here since this window type
- // should be controlled by AppWindowToken in general.
- if (mAttrType != TYPE_BASE_APPLICATION) {
+ // should be controlled by ActivityRecord in general. Wallpaper is also excluded because
+ // WallpaperController should handle it.
+ if (mAttrType != TYPE_BASE_APPLICATION && !mIsWallpaper) {
applyAnimationLocked(transit, true);
}