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

Commit 092a667e authored by Riddle Hsu's avatar Riddle Hsu Committed by Automerger Merge Worker
Browse files

Merge "Make sure display config is updated when cutout is changed" into tm-dev am: 25319431

parents 132d5f38 25319431
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -1810,10 +1810,14 @@ public class DisplayPolicy {
    /**
    /**
     * Called when the resource overlays change.
     * Called when the resource overlays change.
     */
     */
    public void onOverlayChangedLw() {
    void onOverlayChanged() {
        updateCurrentUserResources();
        updateCurrentUserResources();
        // Update the latest display size, cutout.
        mDisplayContent.updateDisplayInfo();
        // The height of status bar needs to update in case display cutout is changed.
        onConfigurationChanged();
        onConfigurationChanged();
        mSystemGestures.onConfigurationChanged();
        // The height of status bar can affect screen size configuration.
        mDisplayContent.reconfigureDisplayLocked();
    }
    }


    /**
    /**
+11 −7
Original line number Original line Diff line number Diff line
@@ -6966,14 +6966,18 @@ public class WindowManagerService extends IWindowManager.Stub
    }
    }


    public void onOverlayChanged() {
    public void onOverlayChanged() {
        // Post to display thread so it can get the latest display info.
        mH.post(() -> {
            synchronized (mGlobalLock) {
            synchronized (mGlobalLock) {
            mRoot.forAllDisplays(displayContent -> {
                mAtmService.deferWindowLayout();
                displayContent.getDisplayPolicy().onOverlayChangedLw();
                try {
                displayContent.updateDisplayInfo();
                    mRoot.forAllDisplays(dc -> dc.getDisplayPolicy().onOverlayChanged());
            });
                } finally {
            requestTraversal();
                    mAtmService.continueWindowLayout();
                }
                }
            }
            }
        });
    }


    @Override
    @Override
    public Object getWindowManagerLock() {
    public Object getWindowManagerLock() {