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

Commit ff188280 authored by Hongwei Wang's avatar Hongwei Wang
Browse files

Separate finishTransaction for leftover transition

When enter PiP from split-screen, the fade-in animation would be picked.
The alpha will be reset to 1 as part of the finishTransaction and from
the MixedTransitionHelper, when we dispatch the leftovers with the same
finishTransaction, there is no guarantee that when finishTransaction is
actually executed, which leads to a race condition.

Fixing this by passing over a fresh finishTransaction to the leftovers
in MixedTransitionHelper, similar to what we do for startTransaction.

This CL covers the enter PiP from split-screen in gesture nav mode.

Flag: EXEMPT bugfix
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/fcSpmPtl7xQUMCkJj0PFUY
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/cxkqthnSiPrK1t5FsbEBQD
Test: Enter PiP from split-screen, make sure no flicker
Test: Enter PiP with non-auto-enter API, make sure no regression there
Test: atest --iteration 5 WMShellFlickerTestsPip1 -- --test-arg \
      com.android.tradefed.testtype.AndroidJUnitTest:instrumentation-arg:filter-tests:="com.android.wm.shell.flicker.pip.FromSplitScreenEnterPipOnUserLeaveHintTest#visibleLayersShownMoreThanOneConsecutiveEntry[ROTATION_0_GESTURAL_NAV]"
Test: atest --iteration 5 WMShellFlickerTestsPip1 -- --test-arg \
      com.android.tradefed.testtype.AndroidJUnitTest:instrumentation-arg:filter-tests:="com.android.wm.shell.flicker.pip.FromSplitScreenAutoEnterPipOnGoToHomeTest#visibleLayersShownMoreThanOneConsecutiveEntry[ROTATION_0_GESTURAL_NAV]"
Bug: 359667269
Bug: 312446524
Bug: 289943985
Change-Id: I2f1c2bf9d002639c0e144d2743de9331dcf590c0
parent bf329d4f
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -141,10 +141,13 @@ public class MixedTransitionHelper {
            pipHandler.setEnterAnimationType(ANIM_TYPE_ALPHA);
            pipHandler.startEnterAnimation(pipChange, startTransaction, finishTransaction,
                    finishCB);
            // make a new finishTransaction because pip's startEnterAnimation "consumes" it so
            // we need a separate one to send over to launcher.
            SurfaceControl.Transaction otherFinishT = new SurfaceControl.Transaction();
            // Dispatch the rest of the transition normally. This will most-likely be taken by
            // recents or default handler.
            mixed.mLeftoversHandler = player.dispatchTransition(mixed.mTransition, everythingElse,
                    otherStartT, finishTransaction, finishCB, mixedHandler);
                    otherStartT, otherFinishT, finishCB, mixedHandler);
        } else {
            ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, "  Not leaving split, so just "
                    + "forward animation to Pip-Handler.");
+0 −6
Original line number Diff line number Diff line
@@ -182,12 +182,6 @@ class FromSplitScreenEnterPipOnUserLeaveHintTest(flicker: LegacyFlickerTest) :
        }
    }

    /** {@inheritDoc} */
    @FlakyTest(bugId = 312446524)
    @Test
    override fun visibleLayersShownMoreThanOneConsecutiveEntry() =
        super.visibleLayersShownMoreThanOneConsecutiveEntry()

    /** {@inheritDoc} */
    @Test
    @FlakyTest(bugId = 336510055)