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

Commit 2fad0af9 authored by Lingyu Feng's avatar Lingyu Feng Committed by Android (Google) Code Review
Browse files

Merge "Send topology update to DM when WM registers DisplayListener" into main

parents e4e6ff01 786c2606
Loading
Loading
Loading
Loading
+13 −8
Original line number Diff line number Diff line
@@ -1203,6 +1203,8 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
            addChild(displayContent, POSITION_BOTTOM);
            if (displayContent.mDisplayId == DEFAULT_DISPLAY) {
                mDefaultDisplay = displayContent;
            } else {
                setShouldShowSystemDecorationsForNewDisplay(displayContent);
            }
        }

@@ -2775,14 +2777,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
                return;
            }

            if (ENABLE_DISPLAY_CONTENT_MODE_MANAGEMENT.isTrue()) {
                display.updateShouldShowSystemDecorations();

                final boolean inTopology = mWindowManager.mDisplayWindowSettings
                        .shouldShowSystemDecorsLocked(display);
                mWmService.mDisplayManagerInternal.onDisplayBelongToTopologyChanged(displayId,
                        inTopology);
            }
            setShouldShowSystemDecorationsForNewDisplay(display);

            startSystemDecorations(display, "displayAdded");

@@ -2792,6 +2787,16 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
        }
    }

    private void setShouldShowSystemDecorationsForNewDisplay(DisplayContent displayContent) {
        if (ENABLE_DISPLAY_CONTENT_MODE_MANAGEMENT.isTrue()) {
            displayContent.updateShouldShowSystemDecorations();
            final boolean inTopology = mWindowManager.mDisplayWindowSettings
                    .shouldShowSystemDecorsLocked(displayContent);
            mWmService.mDisplayManagerInternal.onDisplayBelongToTopologyChanged(
                    displayContent.mDisplayId, inTopology);
        }
    }

    void startSystemDecorations(final DisplayContent displayContent, String reason) {
        // Do not start home before booting, or it may accidentally finish booting before it
        // starts. Instead, we expect home activities to be launched when the system is ready