summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/wm/DisplayPolicy.java44
-rw-r--r--services/core/java/com/android/server/wm/RootWindowContainer.java8
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