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

Commit 64b74d57 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Simulate extra navigation bar for fixed rotation" into sc-v2-dev am:...

Merge "Simulate extra navigation bar for fixed rotation" into sc-v2-dev am: b4fabe9b am: cef9ce27

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15828039

Change-Id: I72f9e9fd488cd22eaa1c61ed9f59c52e6567fb17
parents b0e40f36 cef9ce27
Loading
Loading
Loading
Loading
+34 −14
Original line number Diff line number Diff line
@@ -1538,30 +1538,50 @@ public class DisplayPolicy {
     * some temporal states, but doesn't change the window frames used to show on screen.
     */
    void simulateLayoutDisplay(DisplayFrames displayFrames, SparseArray<Rect> barContentFrames) {
        if (mNavigationBar != null) {
            final WindowFrames simulatedWindowFrames = new WindowFrames();
        if (INSETS_LAYOUT_GENERALIZATION) {
                simulateLayoutDecorWindow(mNavigationBar, displayFrames, simulatedWindowFrames,
            final InsetsStateController insetsStateController =
                    mDisplayContent.getInsetsStateController();
            for (int type = 0; type < InsetsState.SIZE; type++) {
                final InsetsSourceProvider provider =
                        insetsStateController.peekSourceProvider(type);
                if (provider == null || !provider.hasWindow()
                        || provider.mWin.getControllableInsetProvider() != provider) {
                    continue;
                }
                final WindowFrames simulatedWindowFrames = new WindowFrames();
                simulateLayoutDecorWindow(provider.mWin, displayFrames, simulatedWindowFrames,
                        barContentFrames,
                        contentFrame -> simulateLayoutForContentFrame(displayFrames,
                                mNavigationBar, contentFrame));
                                provider.mWin, contentFrame));
            }
        } else {
            if (mNavigationBar != null) {
                final WindowFrames simulatedWindowFrames = new WindowFrames();
                simulateLayoutDecorWindow(mNavigationBar, displayFrames, simulatedWindowFrames,
                        barContentFrames, contentFrame -> layoutNavigationBar(displayFrames,
                                contentFrame));
            }
        }
            if (mStatusBar != null) {
                final WindowFrames simulatedWindowFrames = new WindowFrames();
            if (INSETS_LAYOUT_GENERALIZATION) {
                simulateLayoutDecorWindow(mStatusBar, displayFrames, simulatedWindowFrames,
                        barContentFrames,
                        contentFrame -> layoutStatusBar(displayFrames, contentFrame));
            }
            if (mExtraNavBarAlt != null) {
                // There's no pre-defined behavior for the extra navigation bar, we need to use the
                // new flexible insets logic anyway.
                final WindowFrames simulatedWindowFrames = new WindowFrames();
                simulateLayoutDecorWindow(mExtraNavBarAlt, displayFrames, simulatedWindowFrames,
                        barContentFrames,
                        contentFrame -> simulateLayoutForContentFrame(displayFrames,
                                mStatusBar, contentFrame));
            } else {
                simulateLayoutDecorWindow(mStatusBar, displayFrames, simulatedWindowFrames,
                                mExtraNavBarAlt, contentFrame));
            }
            if (mClimateBarAlt != null) {
                final WindowFrames simulatedWindowFrames = new WindowFrames();
                simulateLayoutDecorWindow(mClimateBarAlt, displayFrames, simulatedWindowFrames,
                        barContentFrames,
                        contentFrame -> layoutStatusBar(displayFrames, contentFrame));
                        contentFrame -> simulateLayoutForContentFrame(displayFrames,
                                mClimateBarAlt, contentFrame));
            }
        }
    }