Merge "Prevent adding duplicate TaskAnimationManager launcher destroyed callbacks" into main

This commit is contained in:
Treehugger Robot authored and Android (Google) Code Review committed 2025-05-20 15:22:24 -07:00
commit 27312fa26d
2 files changed
+16 -3

No files matched your search

@@ -17,8 +17,6 @@
package com.android.quickstep;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.anyInt;
@@ -148,6 +146,10 @@ public class TaskAnimationManagerTest {
gestureState,
new Intent(),
mock(RecentsAnimationCallbacks.RecentsAnimationListener.class));
// Simulate multiple launcher destroyed events before the recents animation start
mTaskAnimationManager.onLauncherDestroyed();
mTaskAnimationManager.onLauncherDestroyed();
mTaskAnimationManager.onLauncherDestroyed();
listenerCaptor.getValue().onAnimationStart(
controllerCompat,
@@ -158,6 +160,8 @@ public class TaskAnimationManagerTest {
new Bundle(),
new TransitionInfo(0, 0));
});
// Verify checks that finish was only called once
runOnMainSync(() -> verify(controllerCompat)
.finish(/* toHome= */ eq(false), anyBoolean(), any()));
}