summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/com/android/internal/statusbar/IStatusBar.aidl4
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/CommandQueueTest.java12
-rw-r--r--packages/SystemUI/shared/src/com/android/systemui/shared/recents/ILauncherProxy.aidl4
-rw-r--r--packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarControllerImpl.java5
-rw-r--r--packages/SystemUI/src/com/android/systemui/navigationbar/TaskbarDelegate.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java14
-rw-r--r--services/core/java/com/android/server/statusbar/StatusBarManagerInternal.java4
-rw-r--r--services/core/java/com/android/server/statusbar/StatusBarManagerService.java7
-rw-r--r--services/core/java/com/android/server/wallpaper/WallpaperManagerInternal.java2
-rw-r--r--services/core/java/com/android/server/wallpaper/WallpaperManagerService.java6
-rw-r--r--services/core/java/com/android/server/wm/DisplayPolicy.java6
-rw-r--r--services/core/java/com/android/server/wm/RootWindowContainer.java8
-rw-r--r--services/tests/mockingservicestests/src/com/android/server/wallpaper/WallpaperManagerServiceTests.java16
13 files changed, 53 insertions, 43 deletions
diff --git a/core/java/com/android/internal/statusbar/IStatusBar.aidl b/core/java/com/android/internal/statusbar/IStatusBar.aidl
index 72cb9d1a20ac..98d1ef6057fd 100644
--- a/core/java/com/android/internal/statusbar/IStatusBar.aidl
+++ b/core/java/com/android/internal/statusbar/IStatusBar.aidl
@@ -217,9 +217,9 @@ oneway interface IStatusBar
void setUdfpsRefreshRateCallback(in IUdfpsRefreshRateRequestCallback callback);
/**
- * Notifies System UI that the display is ready to show system decorations.
+ * Notifies System UI that the system decorations should be added on the display.
*/
- void onDisplayReady(int displayId);
+ void onDisplayAddSystemDecorations(int displayId);
/**
* Notifies System UI that the system decorations should be removed from the display.
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/CommandQueueTest.java b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/CommandQueueTest.java
index 2020d0dcb041..3d3178793a09 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/CommandQueueTest.java
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/CommandQueueTest.java
@@ -460,17 +460,17 @@ public class CommandQueueTest extends SysuiTestCase {
}
@Test
- public void testOnDisplayReady() {
- mCommandQueue.onDisplayReady(DEFAULT_DISPLAY);
+ public void testonDisplayAddSystemDecorations() {
+ mCommandQueue.onDisplayAddSystemDecorations(DEFAULT_DISPLAY);
waitForIdleSync();
- verify(mCallbacks).onDisplayReady(eq(DEFAULT_DISPLAY));
+ verify(mCallbacks).onDisplayAddSystemDecorations(eq(DEFAULT_DISPLAY));
}
@Test
- public void testOnDisplayReadyForSecondaryDisplay() {
- mCommandQueue.onDisplayReady(SECONDARY_DISPLAY);
+ public void testonDisplayAddSystemDecorationsForSecondaryDisplay() {
+ mCommandQueue.onDisplayAddSystemDecorations(SECONDARY_DISPLAY);
waitForIdleSync();
- verify(mCallbacks).onDisplayReady(eq(SECONDARY_DISPLAY));
+ verify(mCallbacks).onDisplayAddSystemDecorations(eq(SECONDARY_DISPLAY));
}
@Test
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/ILauncherProxy.aidl b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/ILauncherProxy.aidl
index b43ffc530289..10b930381c44 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/ILauncherProxy.aidl
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/ILauncherProxy.aidl
@@ -146,9 +146,9 @@ oneway interface ILauncherProxy {
void onUnbind(IRemoteCallback reply) = 35;
/**
- * Sent when {@link TaskbarDelegate#onDisplayReady} is called.
+ * Sent when {@link TaskbarDelegate#onDisplayAddSystemDecorations} is called.
*/
- void onDisplayReady(int displayId) = 36;
+ void onDisplayAddSystemDecorations(int displayId) = 36;
/**
* Sent when {@link TaskbarDelegate#onDisplayRemoved} is called.
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarControllerImpl.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarControllerImpl.java
index ebda3765cf90..babb64050ed5 100644
--- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarControllerImpl.java
@@ -284,7 +284,10 @@ public class NavigationBarControllerImpl implements
}
@Override
- public void onDisplayReady(int displayId) {
+ public void onDisplayAddSystemDecorations(int displayId) {
+ if (enableDisplayContentModeManagement()) {
+ mHasNavBar.put(displayId, true);
+ }
Display display = mDisplayManager.getDisplay(displayId);
mIsLargeScreen = isLargeScreen(mContext);
createNavigationBar(display, null /* savedState */, null /* result */);
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/TaskbarDelegate.java b/packages/SystemUI/src/com/android/systemui/navigationbar/TaskbarDelegate.java
index 9d8943052b38..c4d847f18269 100644
--- a/packages/SystemUI/src/com/android/systemui/navigationbar/TaskbarDelegate.java
+++ b/packages/SystemUI/src/com/android/systemui/navigationbar/TaskbarDelegate.java
@@ -238,16 +238,16 @@ public class TaskbarDelegate implements CommandQueue.Callbacks,
}
@Override
- public void onDisplayReady(int displayId) {
- CommandQueue.Callbacks.super.onDisplayReady(displayId);
+ public void onDisplayAddSystemDecorations(int displayId) {
+ CommandQueue.Callbacks.super.onDisplayAddSystemDecorations(displayId);
if (mLauncherProxyService.getProxy() == null) {
return;
}
try {
- mLauncherProxyService.getProxy().onDisplayReady(displayId);
+ mLauncherProxyService.getProxy().onDisplayAddSystemDecorations(displayId);
} catch (RemoteException e) {
- Log.e(TAG, "onDisplayReady() failed", e);
+ Log.e(TAG, "onDisplayAddSystemDecorations() failed", e);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
index dcea8d85e10d..1720898229a5 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
@@ -111,7 +111,7 @@ public class CommandQueue extends IStatusBar.Stub implements
private static final int MSG_COLLAPSE_PANELS = 4 << MSG_SHIFT;
private static final int MSG_EXPAND_SETTINGS = 5 << MSG_SHIFT;
private static final int MSG_SYSTEM_BAR_CHANGED = 6 << MSG_SHIFT;
- private static final int MSG_DISPLAY_READY = 7 << MSG_SHIFT;
+ private static final int MSG_DISPLAY_ADD_SYSTEM_DECORATIONS = 7 << MSG_SHIFT;
private static final int MSG_SHOW_IME_BUTTON = 8 << MSG_SHIFT;
private static final int MSG_TOGGLE_RECENT_APPS = 9 << MSG_SHIFT;
private static final int MSG_PRELOAD_RECENT_APPS = 10 << MSG_SHIFT;
@@ -415,9 +415,9 @@ public class CommandQueue extends IStatusBar.Stub implements
}
/**
- * @see IStatusBar#onDisplayReady(int)
+ * @see IStatusBar#onDisplayAddSystemDecorations(int)
*/
- default void onDisplayReady(int displayId) {
+ default void onDisplayAddSystemDecorations(int displayId) {
}
/**
@@ -1205,9 +1205,9 @@ public class CommandQueue extends IStatusBar.Stub implements
}
@Override
- public void onDisplayReady(int displayId) {
+ public void onDisplayAddSystemDecorations(int displayId) {
synchronized (mLock) {
- mHandler.obtainMessage(MSG_DISPLAY_READY, displayId, 0).sendToTarget();
+ mHandler.obtainMessage(MSG_DISPLAY_ADD_SYSTEM_DECORATIONS, displayId, 0).sendToTarget();
}
}
@@ -1851,9 +1851,9 @@ public class CommandQueue extends IStatusBar.Stub implements
mCallbacks.get(i).showPinningEscapeToast();
}
break;
- case MSG_DISPLAY_READY:
+ case MSG_DISPLAY_ADD_SYSTEM_DECORATIONS:
for (int i = 0; i < mCallbacks.size(); i++) {
- mCallbacks.get(i).onDisplayReady(msg.arg1);
+ mCallbacks.get(i).onDisplayAddSystemDecorations(msg.arg1);
}
break;
case MSG_DISPLAY_REMOVE_SYSTEM_DECORATIONS:
diff --git a/services/core/java/com/android/server/statusbar/StatusBarManagerInternal.java b/services/core/java/com/android/server/statusbar/StatusBarManagerInternal.java
index 0ed522805bef..a80b1b2dd9e8 100644
--- a/services/core/java/com/android/server/statusbar/StatusBarManagerInternal.java
+++ b/services/core/java/com/android/server/statusbar/StatusBarManagerInternal.java
@@ -171,11 +171,11 @@ public interface StatusBarManagerInternal {
void onProposedRotationChanged(int displayId, int rotation, boolean isValid);
/**
- * Notifies System UI that the display is ready to show system decorations.
+ * Notifies System UI that the system decorations should be added on the display.
*
* @param displayId display ID
*/
- void onDisplayReady(int displayId);
+ void onDisplayAddSystemDecorations(int displayId);
/**
* Notifies System UI that the system decorations should be removed from the display.
diff --git a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
index 4301c93cbed1..c546388e4499 100644
--- a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
+++ b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
@@ -770,10 +770,11 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
}
@Override
- public void onDisplayReady(int displayId) {
+ public void onDisplayAddSystemDecorations(int displayId) {
if (isVisibleBackgroundUserOnDisplay(displayId)) {
if (SPEW) {
- Slog.d(TAG, "Skipping onDisplayReady for visible background user "
+ Slog.d(TAG, "Skipping onDisplayAddSystemDecorations for visible background "
+ + "user "
+ mUserManagerInternal.getUserAssignedToDisplay(displayId));
}
return;
@@ -781,7 +782,7 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
IStatusBar bar = mBar;
if (bar != null) {
try {
- bar.onDisplayReady(displayId);
+ bar.onDisplayAddSystemDecorations(displayId);
} catch (RemoteException ex) {}
}
}
diff --git a/services/core/java/com/android/server/wallpaper/WallpaperManagerInternal.java b/services/core/java/com/android/server/wallpaper/WallpaperManagerInternal.java
index 872ab595994b..f413fe33c3f2 100644
--- a/services/core/java/com/android/server/wallpaper/WallpaperManagerInternal.java
+++ b/services/core/java/com/android/server/wallpaper/WallpaperManagerInternal.java
@@ -26,7 +26,7 @@ public abstract class WallpaperManagerInternal {
/**
* Notifies the display is ready for adding wallpaper on it.
*/
- public abstract void onDisplayReady(int displayId);
+ public abstract void onDisplayAddSystemDecorations(int displayId);
/** Notifies when display stop showing system decorations and wallpaper. */
public abstract void onDisplayRemoveSystemDecorations(int displayId);
diff --git a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
index db530e728a1a..09b10739d469 100644
--- a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
+++ b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
@@ -1636,8 +1636,8 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
private final class LocalService extends WallpaperManagerInternal {
@Override
- public void onDisplayReady(int displayId) {
- onDisplayReadyInternal(displayId);
+ public void onDisplayAddSystemDecorations(int displayId) {
+ onDisplayAddSystemDecorationsInternal(displayId);
}
@Override
@@ -3944,7 +3944,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
return (wallpaper != null) ? wallpaper.allowBackup : false;
}
- private void onDisplayReadyInternal(int displayId) {
+ private void onDisplayAddSystemDecorationsInternal(int displayId) {
synchronized (mLock) {
if (mLastWallpaper == null) {
return;
diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java
index 5b1619995529..5329e3b9abb3 100644
--- a/services/core/java/com/android/server/wm/DisplayPolicy.java
+++ b/services/core/java/com/android/server/wm/DisplayPolicy.java
@@ -1887,17 +1887,17 @@ public class DisplayPolicy {
mCanSystemBarsBeShownByUser = canBeShown;
}
- void notifyDisplayReady() {
+ void notifyDisplayAddSystemDecorations() {
mHandler.post(() -> {
final int displayId = getDisplayId();
StatusBarManagerInternal statusBar = getStatusBarManagerInternal();
if (statusBar != null) {
- statusBar.onDisplayReady(displayId);
+ statusBar.onDisplayAddSystemDecorations(displayId);
}
final WallpaperManagerInternal wpMgr = LocalServices
.getService(WallpaperManagerInternal.class);
if (wpMgr != null) {
- wpMgr.onDisplayReady(displayId);
+ wpMgr.onDisplayAddSystemDecorations(displayId);
}
});
}
diff --git a/services/core/java/com/android/server/wm/RootWindowContainer.java b/services/core/java/com/android/server/wm/RootWindowContainer.java
index abd26b5164f7..cf464c707ff4 100644
--- a/services/core/java/com/android/server/wm/RootWindowContainer.java
+++ b/services/core/java/com/android/server/wm/RootWindowContainer.java
@@ -2845,7 +2845,13 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
}
startHomeOnDisplay(mCurrentUser, reason, displayContent.getDisplayId());
- displayContent.getDisplayPolicy().notifyDisplayReady();
+ if (enableDisplayContentModeManagement()) {
+ if (displayContent.isSystemDecorationsSupported()) {
+ displayContent.getDisplayPolicy().notifyDisplayAddSystemDecorations();
+ }
+ } else {
+ displayContent.getDisplayPolicy().notifyDisplayAddSystemDecorations();
+ }
}
@Override
diff --git a/services/tests/mockingservicestests/src/com/android/server/wallpaper/WallpaperManagerServiceTests.java b/services/tests/mockingservicestests/src/com/android/server/wallpaper/WallpaperManagerServiceTests.java
index b92afc5c0ca7..d80fd20dd1e6 100644
--- a/services/tests/mockingservicestests/src/com/android/server/wallpaper/WallpaperManagerServiceTests.java
+++ b/services/tests/mockingservicestests/src/com/android/server/wallpaper/WallpaperManagerServiceTests.java
@@ -731,7 +731,7 @@ public class WallpaperManagerServiceTests {
// WHEN display ID, 2, is ready.
WallpaperManagerInternal wallpaperManagerInternal = LocalServices.getService(
WallpaperManagerInternal.class);
- wallpaperManagerInternal.onDisplayReady(testDisplayId);
+ wallpaperManagerInternal.onDisplayAddSystemDecorations(testDisplayId);
// Then there is a connection established for the system & lock wallpaper for display ID, 2.
verify(mockIWallpaperService).attach(
@@ -771,7 +771,7 @@ public class WallpaperManagerServiceTests {
// WHEN display ID, 2, is ready.
WallpaperManagerInternal wallpaperManagerInternal = LocalServices.getService(
WallpaperManagerInternal.class);
- wallpaperManagerInternal.onDisplayReady(testDisplayId);
+ wallpaperManagerInternal.onDisplayAddSystemDecorations(testDisplayId);
// Then there is a connection established for the system wallpaper for display ID, 2.
verify(mockIWallpaperService).attach(
@@ -818,7 +818,7 @@ public class WallpaperManagerServiceTests {
// WHEN display ID, 2, is ready.
WallpaperManagerInternal wallpaperManagerInternal = LocalServices.getService(
WallpaperManagerInternal.class);
- wallpaperManagerInternal.onDisplayReady(testDisplayId);
+ wallpaperManagerInternal.onDisplayAddSystemDecorations(testDisplayId);
// Then there is a connection established for the fallback wallpaper for display ID, 2.
verify(mockIWallpaperService).attach(
@@ -856,7 +856,7 @@ public class WallpaperManagerServiceTests {
// GIVEN wallpaper connections have been established for display ID, 2.
WallpaperManagerInternal wallpaperManagerInternal = LocalServices.getService(
WallpaperManagerInternal.class);
- wallpaperManagerInternal.onDisplayReady(testDisplayId);
+ wallpaperManagerInternal.onDisplayAddSystemDecorations(testDisplayId);
// Save displayConnector for displayId 2 before display removal.
WallpaperManagerService.DisplayConnector displayConnector =
wallpaper.connection.getDisplayConnectorOrCreate(testDisplayId);
@@ -894,7 +894,7 @@ public class WallpaperManagerServiceTests {
// GIVEN wallpaper connections have been established for display ID, 2.
WallpaperManagerInternal wallpaperManagerInternal = LocalServices.getService(
WallpaperManagerInternal.class);
- wallpaperManagerInternal.onDisplayReady(testDisplayId);
+ wallpaperManagerInternal.onDisplayAddSystemDecorations(testDisplayId);
// Save displayConnectors for display ID, 2, before display removal.
WallpaperManagerService.DisplayConnector systemWallpaperDisplayConnector =
systemWallpaper.connection.getDisplayConnectorOrCreate(testDisplayId);
@@ -930,7 +930,7 @@ public class WallpaperManagerServiceTests {
// GIVEN wallpaper connections have been established for display ID, 2.
WallpaperManagerInternal wallpaperManagerInternal = LocalServices.getService(
WallpaperManagerInternal.class);
- wallpaperManagerInternal.onDisplayReady(testDisplayId);
+ wallpaperManagerInternal.onDisplayAddSystemDecorations(testDisplayId);
// Save fallback wallpaper displayConnector for display ID, 2, before display removal.
WallpaperManagerService.DisplayConnector fallbackWallpaperConnector =
mService.mFallbackWallpaper.connection.getDisplayConnectorOrCreate(testDisplayId);
@@ -977,7 +977,7 @@ public class WallpaperManagerServiceTests {
// GIVEN wallpaper connections have been established for displayID, 2.
WallpaperManagerInternal wallpaperManagerInternal = LocalServices.getService(
WallpaperManagerInternal.class);
- wallpaperManagerInternal.onDisplayReady(testDisplayId);
+ wallpaperManagerInternal.onDisplayAddSystemDecorations(testDisplayId);
// Save displayConnector for displayId 2 before display removal.
WallpaperManagerService.DisplayConnector displayConnector =
wallpaper.connection.getDisplayConnectorOrCreate(testDisplayId);
@@ -1011,7 +1011,7 @@ public class WallpaperManagerServiceTests {
// GIVEN wallpaper connections have been established for displayID, 2.
WallpaperManagerInternal wallpaperManagerInternal = LocalServices.getService(
WallpaperManagerInternal.class);
- wallpaperManagerInternal.onDisplayReady(testDisplayId);
+ wallpaperManagerInternal.onDisplayAddSystemDecorations(testDisplayId);
// Save displayConnectors for displayId 2 before display removal.
WallpaperManagerService.DisplayConnector systemWallpaperDisplayConnector =
systemWallpaper.connection.getDisplayConnectorOrCreate(testDisplayId);