summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Vishnu Nair <vishnun@google.com> 2023-07-31 12:37:08 -0700
committer Vishnu Nair <vishnun@google.com> 2023-07-31 12:37:08 -0700
commita6a5290224b5e3256b7f334b26644c17d886c13c (patch)
treed3e9c060a7c8e660d8efba268a4a0c0ef05a5973
parent20ce2d46f525beecc8c475334f624bafb6a5be91 (diff)
[wm] Make dim animation duration respect transition animation scale
Fixes test flakniess by allowing tests to disable dim animations. Blur is set by the dim layer and blur radius is affected by alpha. Tests validating blur has to ensure the dim animation is complete before taking screenshots. This change allows the tests to disable the dim animation by setting the scale to 0 for the duration of the test. Test: atest android.server.wm.other.BlurTests#testNoBlurBehindWhenBlurDisabled --rerun-until-failure Bug: 293532283 Change-Id: Ia3873eb5185c5b3d456448018ca121a95c645e55
-rw-r--r--services/core/java/com/android/server/wm/Dimmer.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/wm/Dimmer.java b/services/core/java/com/android/server/wm/Dimmer.java
index d7667d8ce7a8..4f3ab8bbbe0a 100644
--- a/services/core/java/com/android/server/wm/Dimmer.java
+++ b/services/core/java/com/android/server/wm/Dimmer.java
@@ -349,7 +349,8 @@ class Dimmer {
// Otherwise use the same duration as the animation on the WindowContainer
AnimationAdapter animationAdapter = container.mSurfaceAnimator.getAnimation();
- return animationAdapter == null ? DEFAULT_DIM_ANIM_DURATION
+ final float durationScale = container.mWmService.getTransitionAnimationScaleLocked();
+ return animationAdapter == null ? (long) (DEFAULT_DIM_ANIM_DURATION * durationScale)
: animationAdapter.getDurationHint();
}