Merge "Removing RotationTouchHelper state management from RecentsAnimationDeviceState" into main

This commit is contained in:
Sunny Goyal
2025-01-07 12:47:56 -08:00
committed by Android (Google) Code Review
30 changed files with 130 additions and 256 deletions

View File

@@ -118,7 +118,6 @@ public abstract class AbsSwipeUpHandlerTestCase<
protected RecentsAnimationTargets mRecentsAnimationTargets;
protected TaskAnimationManager mTaskAnimationManager;
protected RecentsAnimationDeviceState mRecentsAnimationDeviceState;
@Mock protected CONTAINER_INTERFACE mActivityInterface;
@Mock protected ContextInitListener<?> mContextInitListener;
@@ -180,7 +179,8 @@ public abstract class AbsSwipeUpHandlerTestCase<
@Before
public void setUpRecentsContainer() {
mTaskAnimationManager = new TaskAnimationManager(mContext, mRecentsAnimationDeviceState);
mTaskAnimationManager = new TaskAnimationManager(mContext,
RecentsAnimationDeviceState.INSTANCE.get(mContext));
RecentsViewContainer recentsContainer = getRecentsContainer();
RECENTS_VIEW recentsView = getRecentsView();
@@ -198,12 +198,6 @@ public abstract class AbsSwipeUpHandlerTestCase<
}).when(recentsContainer).runOnBindToTouchInteractionService(any());
}
@Before
public void setUpRecentsAnimationDeviceState() {
runOnMainSync(() ->
mRecentsAnimationDeviceState = new RecentsAnimationDeviceState(mContext, true));
}
@Test
public void testInitWhenReady_registersActivityInitListener() {
String reasonString = "because i said so";

View File

@@ -44,7 +44,6 @@ public class FallbackSwipeHandlerTestCase extends AbsSwipeUpHandlerTestCase<
long touchTimeMs, boolean continuingLastGesture) {
return new FallbackSwipeHandler(
mContext,
mRecentsAnimationDeviceState,
mTaskAnimationManager,
mGestureState,
touchTimeMs,

View File

@@ -40,7 +40,6 @@ import org.mockito.Mockito.spy
import org.mockito.junit.MockitoJUnit
import org.mockito.kotlin.eq
import org.mockito.kotlin.verify
import org.mockito.kotlin.whenever
@SmallTest
@RunWith(AndroidJUnit4::class)
@@ -72,15 +71,18 @@ class LauncherSwipeHandlerV2Test {
.bindSystemUiProxy(systemUiProxy)
.bindRecentsDisplayModel(RecentsDisplayModel(sandboxContext))
)
sandboxContext.putObject(
RotationTouchHelper.INSTANCE,
mock(RotationTouchHelper::class.java),
)
val deviceState = mock(RecentsAnimationDeviceState::class.java)
whenever(deviceState.rotationTouchHelper).thenReturn(mock(RotationTouchHelper::class.java))
sandboxContext.putObject(RecentsAnimationDeviceState.INSTANCE, deviceState)
gestureState = spy(GestureState(OverviewComponentObserver.INSTANCE.get(sandboxContext), 0))
underTest =
LauncherSwipeHandlerV2(
sandboxContext,
deviceState,
taskAnimationManager,
gestureState,
0,

View File

@@ -73,7 +73,6 @@ public class LauncherSwipeHandlerV2TestCase extends AbsSwipeUpHandlerTestCase<
long touchTimeMs, boolean continuingLastGesture) {
return new LauncherSwipeHandlerV2(
mContext,
mRecentsAnimationDeviceState,
mTaskAnimationManager,
mGestureState,
touchTimeMs,

View File

@@ -62,7 +62,6 @@ public class RecentsWindowSwipeHandlerTestCase extends AbsSwipeUpHandlerTestCase
boolean continuingLastGesture) {
return new RecentsWindowSwipeHandler(
mContext,
mRecentsAnimationDeviceState,
mTaskAnimationManager,
mGestureState,
touchTimeMs,