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

Commit cae2f4ce authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Request traversal for insets client visibility change"

parents 7f5f2781 4da92ddd
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -508,6 +508,9 @@ abstract class InsetsSourceProvider {
        }
        mClientVisible = clientVisible;
        updateVisibility();
        // The visibility change needs a traversal to apply.
        mDisplayContent.setLayoutNeeded();
        mDisplayContent.mWmService.mWindowPlacerLocked.requestTraversal();
    }

    @VisibleForTesting
+8 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.clearInvocations;
import static org.mockito.Mockito.spy;
@@ -411,7 +412,14 @@ public class InsetsStateControllerTest extends WindowTestsBase {
        final WindowState navBar = createTestWindow("navBar");

        getController().getSourceProvider(ITYPE_IME).setWindowContainer(ime, null, null);

        waitUntilHandlersIdle();
        clearInvocations(mDisplayContent);
        getController().getSourceProvider(ITYPE_IME).setClientVisible(true);
        waitUntilHandlersIdle();
        // The visibility change should trigger a traversal to notify the change.
        verify(mDisplayContent).notifyInsetsChanged(any());

        getController().getSourceProvider(ITYPE_STATUS_BAR).setWindowContainer(statusBar, null,
                null);
        getController().getSourceProvider(ITYPE_NAVIGATION_BAR).setWindowContainer(navBar, null,