diff options
| author | 2025-02-24 03:58:11 -0800 | |
|---|---|---|
| committer | 2025-02-24 03:58:11 -0800 | |
| commit | a3a4ebbc868e8f95be4f9729a915cf5c8c5beea9 (patch) | |
| tree | 8c8d533a9ac6f1e608c8db58d556ed558b6f52c0 | |
| parent | 899253a888c35f7bc947a8928f23ff11b5306ea5 (diff) | |
| parent | e09b6ae000a6194e30410d53774cf72405944dac (diff) | |
Merge "Check isHomeSupported() before notifying wallpaper" into main
| -rw-r--r-- | services/core/java/com/android/server/wm/DisplayPolicy.java | 44 | ||||
| -rw-r--r-- | services/core/java/com/android/server/wm/RootWindowContainer.java | 8 |
2 files changed, 34 insertions, 18 deletions
diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java index a03ecf51223a..4908df025dd1 100644 --- a/services/core/java/com/android/server/wm/DisplayPolicy.java +++ b/services/core/java/com/android/server/wm/DisplayPolicy.java @@ -1875,18 +1875,40 @@ public class DisplayPolicy { } void notifyDisplayAddSystemDecorations() { - mHandler.post(() -> { + if (enableDisplayContentModeManagement()) { final int displayId = getDisplayId(); - StatusBarManagerInternal statusBar = getStatusBarManagerInternal(); - if (statusBar != null) { - statusBar.onDisplayAddSystemDecorations(displayId); - } - final WallpaperManagerInternal wpMgr = LocalServices - .getService(WallpaperManagerInternal.class); - if (wpMgr != null) { - wpMgr.onDisplayAddSystemDecorations(displayId); - } - }); + 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(() -> { + final int displayId = getDisplayId(); + StatusBarManagerInternal statusBar = getStatusBarManagerInternal(); + if (statusBar != null) { + statusBar.onDisplayAddSystemDecorations(displayId); + } + final WallpaperManagerInternal wpMgr = LocalServices + .getService(WallpaperManagerInternal.class); + if (wpMgr != null) { + wpMgr.onDisplayAddSystemDecorations(displayId); + } + }); + } } void notifyDisplayRemoveSystemDecorations() { diff --git a/services/core/java/com/android/server/wm/RootWindowContainer.java b/services/core/java/com/android/server/wm/RootWindowContainer.java index f309372ab6a2..e864ecf60770 100644 --- a/services/core/java/com/android/server/wm/RootWindowContainer.java +++ b/services/core/java/com/android/server/wm/RootWindowContainer.java @@ -2794,13 +2794,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent> } startHomeOnDisplay(mCurrentUser, reason, displayContent.getDisplayId()); - if (enableDisplayContentModeManagement()) { - if (displayContent.isSystemDecorationsSupported()) { - displayContent.getDisplayPolicy().notifyDisplayAddSystemDecorations(); - } - } else { - displayContent.getDisplayPolicy().notifyDisplayAddSystemDecorations(); - } + displayContent.getDisplayPolicy().notifyDisplayAddSystemDecorations(); } @Override |