summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Marzia Favaro <marziana@google.com> 2025-03-13 16:11:57 +0000
committer Marzia Favaro <marziana@google.com> 2025-03-13 16:31:46 +0000
commitbd9a8433b9892b220d97767bc3b77ce8a6b48d16 (patch)
tree959223db83aff124e71428c2069fa0c0b53520a6
parent0012d539154e05d9fb59172878614eaf0a16ce6c (diff)
Prevent windows from dimming if host is going away
The exit animation has already started, and if someone keeps dimming, then it would - create a new surface (because exit animation removes the dim state) - see that we need to interrupt the dim, since host is leaving - destroy the surface - repeat Bug: 401449608 Fix: 403209573 Test: DimmerTests Flag: EXEMPT minor change Change-Id: I6bb6c540aba3d473e1587b4a7e0bef1883c335cd
-rw-r--r--services/core/java/com/android/server/wm/Dimmer.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/Dimmer.java b/services/core/java/com/android/server/wm/Dimmer.java
index 2798e843d6dd..ab87459da01a 100644
--- a/services/core/java/com/android/server/wm/Dimmer.java
+++ b/services/core/java/com/android/server/wm/Dimmer.java
@@ -218,6 +218,11 @@ class Dimmer {
*/
protected void adjustAppearance(@NonNull WindowState dimmingContainer,
float alpha, int blurRadius) {
+ if (!mHost.isVisibleRequested()) {
+ // If the host is already going away, there is no point in keeping dimming
+ return;
+ }
+
if (mDimState != null || (alpha != 0 || blurRadius != 0)) {
final DimState d = obtainDimState(dimmingContainer);
d.prepareLookChange(alpha, blurRadius);