diff options
author | 2025-05-19 15:07:16 +0800 | |
---|---|---|
committer | 2025-09-18 09:04:28 +0200 | |
commit | 14ff3d2a1c4e4e234c6b4639d401d70f29c63117 (patch) | |
tree | 668e6cf2fa1474bca5fd5348af78aa56dd08b64d | |
parent | a5a510ab5ba19a8302d7f3ccbe482f8067ab8f0c (diff) |
[SP 2025-09-01] Use consistent animation when forcibly hiding non system overlay
There are several non system overlay window types. When hiding the
windows with animation, their specified exit animations may be used.
This avoids ugly jump cut and inconsistent duration when these
windows are requested to be hidden.
Bug: 408215749
Flag: EXEMPT bugfix
Test: Show multiple windows with different overlay types and
window animations by non system apps. Launch Settings
and check the windows are fading out in a short time.
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:dd71ab6ba3950978bd28dc38fecec236cf1153ea)
Merged-In: Ie7bb2663892d608715aa077e2170eae4c03a4e36
Change-Id: Ie7bb2663892d608715aa077e2170eae4c03a4e36
-rw-r--r-- | services/core/java/com/android/server/wm/WindowState.java | 4 | ||||
-rw-r--r-- | services/core/java/com/android/server/wm/WindowStateAnimator.java | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index 05b81d4bfb67..d5c1721183fe 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -2997,6 +2997,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP return true; } + boolean isForceHiddenNonSystemOverlayWindow() { + return mForceHideNonSystemOverlayWindow; + } + void setForceHideNonSystemOverlayWindowIfNeeded(boolean forceHide) { final int baseType = getBaseType(); if (mSession.mCanAddInternalSystemWindow diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java index 0d434f51e082..3fd0e2e30f62 100644 --- a/services/core/java/com/android/server/wm/WindowStateAnimator.java +++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java @@ -62,6 +62,7 @@ import android.view.Surface.OutOfResourcesException; import android.view.SurfaceControl; import android.view.WindowManager; import android.view.WindowManager.LayoutParams; +import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.AnimationUtils; @@ -545,6 +546,10 @@ class WindowStateAnimator { a = AnimationUtils.loadAnimation(mContext, anim); Trace.traceEnd(Trace.TRACE_TAG_WINDOW_MANAGER); } + } else if (!isEntrance && mWin.isForceHiddenNonSystemOverlayWindow()) { + a = new AlphaAnimation(1f, 0f); + a.setDuration(mContext.getResources().getInteger( + com.android.internal.R.integer.config_shortAnimTime)); } else { switch (transit) { case WindowManagerPolicy.TRANSIT_ENTER: |