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

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

Merge "Check isHomeSupported() before notifying wallpaper" into main

parents 899253a8 e09b6ae0
Loading
Loading
Loading
Loading
+33 −11
Original line number Original line Diff line number Diff line
@@ -1875,6 +1875,27 @@ public class DisplayPolicy {
    }
    }


    void notifyDisplayAddSystemDecorations() {
    void notifyDisplayAddSystemDecorations() {
        if (enableDisplayContentModeManagement()) {
            final int displayId = getDisplayId();
            final boolean isSystemDecorationsSupported =
                    mDisplayContent.isSystemDecorationsSupported();
            final boolean isHomeSupported = mDisplayContent.isHomeSupported();
            mHandler.post(() -> {
                if (isSystemDecorationsSupported) {
                    StatusBarManagerInternal statusBar = getStatusBarManagerInternal();
                    if (statusBar != null) {
                        statusBar.onDisplayAddSystemDecorations(displayId);
                    }
                }
                if (isHomeSupported) {
                    final WallpaperManagerInternal wpMgr =
                            LocalServices.getService(WallpaperManagerInternal.class);
                    if (wpMgr != null) {
                        wpMgr.onDisplayAddSystemDecorations(displayId);
                    }
                }
            });
        } else {
            mHandler.post(() -> {
            mHandler.post(() -> {
                final int displayId = getDisplayId();
                final int displayId = getDisplayId();
                StatusBarManagerInternal statusBar = getStatusBarManagerInternal();
                StatusBarManagerInternal statusBar = getStatusBarManagerInternal();
@@ -1888,6 +1909,7 @@ public class DisplayPolicy {
                }
                }
            });
            });
        }
        }
    }


    void notifyDisplayRemoveSystemDecorations() {
    void notifyDisplayRemoveSystemDecorations() {
        mHandler.post(
        mHandler.post(
+1 −7
Original line number Original line Diff line number Diff line
@@ -2794,14 +2794,8 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
        }
        }


        startHomeOnDisplay(mCurrentUser, reason, displayContent.getDisplayId());
        startHomeOnDisplay(mCurrentUser, reason, displayContent.getDisplayId());
        if (enableDisplayContentModeManagement()) {
            if (displayContent.isSystemDecorationsSupported()) {
        displayContent.getDisplayPolicy().notifyDisplayAddSystemDecorations();
        displayContent.getDisplayPolicy().notifyDisplayAddSystemDecorations();
    }
    }
        } else {
            displayContent.getDisplayPolicy().notifyDisplayAddSystemDecorations();
        }
    }


    @Override
    @Override
    public void onDisplayRemoved(int displayId) {
    public void onDisplayRemoved(int displayId) {