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

Commit a6447f28 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix issue with letterboxing"

parents 08035230 0dd0cf91
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ public class InsetsSource implements Parcelable {
    public InsetsSource(@InternalInsetsType int type) {
        mType = type;
        mFrame = new Rect();
        mVisible = InsetsState.getDefaultVisibility(type);
    }

    public InsetsSource(InsetsSource other) {
+4 −0
Original line number Diff line number Diff line
@@ -102,8 +102,12 @@ public class InsetsSourceConsumerTest {

    @Test
    public void testShow() {

        // Insets source starts out visible
        mConsumer.hide();
        mConsumer.show();
        assertTrue("Consumer should be visible", mConsumer.isVisible());
        verify(mSpyInsetsSource).setVisible(eq(false));
        verify(mSpyInsetsSource).setVisible(eq(true));
    }

+5 −2
Original line number Diff line number Diff line
@@ -2192,10 +2192,13 @@ public class DisplayPolicy {
        final boolean attachedInParent = attached != null && !layoutInScreen;
        final boolean requestedFullscreen = (fl & FLAG_FULLSCREEN) != 0
                || (requestedSysUiFl & View.SYSTEM_UI_FLAG_FULLSCREEN) != 0
                || !win.getClientInsetsState().getSource(ITYPE_STATUS_BAR).isVisible();
                || (ViewRootImpl.sNewInsetsMode == NEW_INSETS_MODE_FULL
                        && !win.getRequestedInsetsState().getSource(ITYPE_STATUS_BAR).isVisible());
        final boolean requestedHideNavigation =
                (requestedSysUiFl & View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) != 0
                        || !win.getClientInsetsState().getSource(ITYPE_NAVIGATION_BAR).isVisible();
                || (ViewRootImpl.sNewInsetsMode == NEW_INSETS_MODE_FULL
                        && !win.getRequestedInsetsState().getSource(ITYPE_NAVIGATION_BAR)
                                .isVisible());

        // TYPE_BASE_APPLICATION windows are never considered floating here because they don't get
        // cropped / shifted to the displayFrame in WindowState.
+3 −2
Original line number Diff line number Diff line
@@ -66,10 +66,11 @@ class InsetsPolicy {
        }
        mStatusBar.setVisible(focusedWin == null
                || focusedWin != getStatusControlTarget(focusedWin)
                || focusedWin.getClientInsetsState().getSource(ITYPE_STATUS_BAR).isVisible());
                || focusedWin.getRequestedInsetsState().getSource(ITYPE_STATUS_BAR).isVisible());
        mNavBar.setVisible(focusedWin == null
                || focusedWin != getNavControlTarget(focusedWin)
                || focusedWin.getClientInsetsState().getSource(ITYPE_NAVIGATION_BAR).isVisible());
                || focusedWin.getRequestedInsetsState().getSource(ITYPE_NAVIGATION_BAR)
                        .isVisible());
    }

    boolean isHidden(@InternalInsetsType int type) {
+1 −1
Original line number Diff line number Diff line
@@ -463,7 +463,7 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient {
            final WindowState windowState = mService.windowForClientLocked(this, window,
                    false /* throwOnError */);
            if (windowState != null) {
                windowState.setClientInsetsState(state);
                windowState.updateRequestedInsetsState(state);
                windowState.getDisplayContent().getInsetsPolicy().onInsetsModified(
                        windowState, state);
            }
Loading