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

Commit 2d7c4996 authored by Tiger's avatar Tiger
Browse files

De-flake testFakeControlTarget_overrideVisibilityReceivedByWindows

This CL let app2 be the focused window to make sure the control target
won't be changed unexpectedly while we are waiting for the idle of
WindowAnimator.

Fix: 328585829
Test: atest InsetsPolicyTest
Change-Id: I56efd7e39044a0c7450e5bda79d6e09ec7f13b33
parent 260d9c9e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -411,6 +411,10 @@ public class InsetsPolicyTest extends WindowTestsBase {
        app2.mAboveInsetsState.addSource(statusBarSource);
        assertTrue(app2.getInsetsState().peekSource(statusBarId).isVisible());

        // Let app2 be the focused window. Otherwise, the control target could be overwritten by
        // DisplayPolicy#updateSystemBarAttributes unexpectedly.
        mDisplayContent.getDisplayPolicy().focusChangedLw(null, app2);

        app2.setRequestedVisibleTypes(0, navigationBars() | statusBars());
        mDisplayContent.getInsetsPolicy().updateBarControlTarget(app2);
        waitUntilWindowAnimatorIdle();