Ignore specified animation types when checking isAnimating
The check isAnimating is used in a lot of places to determine if the
apps can hide, show, removed, etc. However, we don't always want to
check if any animation is running, just if a specific animation.
This change adds a new method that allows the caller to check if
isAnmating but ignore certain animationTypes.
This is specifically needed for ScreenRotationAnimation refactor to
ensure we can ignore screen rotation animation when checking
isAnimating. Otherwise, screen rotation will block hiding closing apps
if rotation occurs at the same time.
Test: WindowContainerTests
Bug: 152333373
Bug: 149490428
Change-Id: I922e3a5698f5db4dcc819a59ebfde2cd0301d7d2
diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskStackTests.java b/services/tests/wmtests/src/com/android/server/wm/TaskStackTests.java
index 6387a3b..35adcfa 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TaskStackTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/TaskStackTests.java
@@ -33,6 +33,8 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.clearInvocations;
import android.app.WindowConfiguration;
@@ -144,7 +146,7 @@
// Stack removal is deferred if one of its child is animating.
doReturn(true).when(stack).hasWindowsAlive();
- doReturn(true).when(task).isAnimating(TRANSITION | CHILDREN);
+ doReturn(true).when(task).isAnimating(eq(TRANSITION | CHILDREN), anyInt());
stack.removeIfPossible();
// For the case of deferred removal the task controller will still be connected to the its