Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 86da4b38 authored by Vinit Nayak's avatar Vinit Nayak
Browse files

Pass through onTransitionConsumed() to OneShotRemoteHandler

* We simply forgot to do it. Unacceptable.
* That was preventing launcher from properly cleaning up state.

Fixes: 348141930
Flag: EXEMPT bugfix
Test: None, not reproducible sadly.
Change-Id: I0c230033172ebe87809ea624f361a7959f26693b
parent ef6bba06
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -504,7 +504,9 @@ class SplitScreenTransitions {
            ProtoLog.d(WM_SHELL_SPLIT_SCREEN, "onTransitionConsumed for passThrough transition");
        }

        // TODO: handle transition consumed for active remote handler
        if (mActiveRemoteHandler != null) {
            mActiveRemoteHandler.onTransitionConsumed(transition, aborted, finishT);
        }
    }

    void onFinish(WindowContainerTransaction wct) {
+2 −0
Original line number Diff line number Diff line
@@ -193,6 +193,8 @@ public class OneShotRemoteHandler implements Transitions.TransitionHandler {
    public void onTransitionConsumed(@NonNull IBinder transition, boolean aborted,
            @Nullable SurfaceControl.Transaction finishTransaction) {
        try {
            ProtoLog.d(ShellProtoLogGroup.WM_SHELL_TRANSITIONS,
                    "OneShot onTransitionConsumed for %s", mRemote);
            mRemote.getRemoteTransition().onTransitionConsumed(transition, aborted);
        } catch (RemoteException e) {
            Log.e(Transitions.TAG, "Error calling onTransitionConsumed()", e);
+24 −1
Original line number Diff line number Diff line
@@ -219,7 +219,7 @@ public class SplitTransitionTests extends ShellTestCase {

    @Test
    @UiThreadTest
    public void testRemoteTransitionConsumed() {
    public void testRemoteTransitionConsumedForStartAnimation() {
        // Omit side child change
        TransitionInfo info = new TransitionInfoBuilder(TRANSIT_OPEN, 0)
                .addChange(TRANSIT_OPEN, mMainChild)
@@ -238,7 +238,30 @@ public class SplitTransitionTests extends ShellTestCase {
        assertTrue(accepted);

        assertTrue(testRemote.isConsumed());
    }

    @Test
    @UiThreadTest
    public void testRemoteTransitionConsumed() {
        // Omit side child change
        TransitionInfo info = new TransitionInfoBuilder(TRANSIT_OPEN, 0)
                .addChange(TRANSIT_OPEN, mMainChild)
                .build();
        TestRemoteTransition testRemote = new TestRemoteTransition();

        IBinder transition = mSplitScreenTransitions.startEnterTransition(
                TRANSIT_OPEN, new WindowContainerTransaction(),
                new RemoteTransition(testRemote, "Test"), mStageCoordinator,
                TRANSIT_SPLIT_SCREEN_PAIR_OPEN, false);
        mMainStage.onTaskAppeared(mMainChild, createMockSurface());
        mStageCoordinator.startAnimation(transition, info,
                mock(SurfaceControl.Transaction.class),
                mock(SurfaceControl.Transaction.class),
                mock(Transitions.TransitionFinishCallback.class));
        mStageCoordinator.onTransitionConsumed(transition, false /*aborted*/,
                mock(SurfaceControl.Transaction.class));

        assertTrue(testRemote.isConsumed());
    }

    @Test