summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author wilsonshih <wilsonshih@google.com> 2021-08-27 17:27:17 +0800
committer wilsonshih <wilsonshih@google.com> 2021-08-30 11:20:29 +0800
commit97c3131335750f0672e9b6914a7d6d5d69a25d35 (patch)
tree0f998262591c2a55aa360f6839dc8c86d5f03128
parent793bcbcbe06d22706211ef44054998a85fd9e2d1 (diff)
Send request top ui to SystemUI when creating splash screen.
Boost SystemUI's RenderThread to top-app when creating splash screen. Bug: 195736516 Test: build and flash Change-Id: Ie6589ec8abf0b3ab799b79ca12cc506cf2b4abdb
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurface.java8
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawer.java12
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingWindowController.java5
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java5
4 files changed, 30 insertions, 0 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurface.java b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurface.java
index 01c9b6630fa6..76105a39189b 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurface.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurface.java
@@ -36,4 +36,12 @@ public interface StartingSurface {
default int getBackgroundColor(TaskInfo taskInfo) {
return Color.BLACK;
}
+
+ /** Set the proxy to communicate with SysUi side components. */
+ void setSysuiProxy(SysuiProxy proxy);
+
+ /** Callback to tell SysUi components execute some methods. */
+ interface SysuiProxy {
+ void requestTopUi(boolean requestTopUi, String componentTag);
+ }
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawer.java b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawer.java
index 52a3ac585aff..6c60bad31dba 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawer.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawer.java
@@ -117,6 +117,7 @@ public class StartingSurfaceDrawer {
final SplashscreenContentDrawer mSplashscreenContentDrawer;
private Choreographer mChoreographer;
private final WindowManagerGlobal mWindowManagerGlobal;
+ private StartingSurface.SysuiProxy mSysuiProxy;
/**
* @param splashScreenExecutor The thread used to control add and remove starting window.
@@ -151,6 +152,11 @@ public class StartingSurfaceDrawer {
: activityInfo.getThemeResource() != 0 ? activityInfo.getThemeResource()
: com.android.internal.R.style.Theme_DeviceDefault_DayNight;
}
+
+ void setSysuiProxy(StartingSurface.SysuiProxy sysuiProxy) {
+ mSysuiProxy = sysuiProxy;
+ }
+
/**
* Called when a task need a splash screen starting window.
*
@@ -317,6 +323,9 @@ public class StartingSurfaceDrawer {
}
Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
};
+ if (mSysuiProxy != null) {
+ mSysuiProxy.requestTopUi(true, TAG);
+ }
mSplashscreenContentDrawer.createContentView(context, suggestType, activityInfo, taskId,
viewSupplier::setView);
try {
@@ -573,6 +582,9 @@ public class StartingSurfaceDrawer {
}
private void removeWindowInner(View decorView, boolean hideView) {
+ if (mSysuiProxy != null) {
+ mSysuiProxy.requestTopUi(false, TAG);
+ }
if (hideView) {
decorView.setVisibility(View.GONE);
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingWindowController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingWindowController.java
index e84d498a9258..a5c47c41180e 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingWindowController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingWindowController.java
@@ -217,6 +217,11 @@ public class StartingWindowController implements RemoteCallable<StartingWindowCo
return color != Color.TRANSPARENT
? color : SplashscreenContentDrawer.getSystemBGColor();
}
+
+ @Override
+ public void setSysuiProxy(SysuiProxy proxy) {
+ mSplashScreenExecutor.execute(() -> mStartingSurfaceDrawer.setSysuiProxy(proxy));
+ }
}
/**
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
index 32b5cb20af4e..e926166b7e43 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
@@ -1089,6 +1089,11 @@ public class StatusBar extends SystemUI implements
}
}
}, OverlayPlugin.class, true /* Allow multiple plugins */);
+
+ mStartingSurfaceOptional.ifPresent(startingSurface -> startingSurface.setSysuiProxy(
+ (requestTopUi, componentTag) -> mMainExecutor.execute(() ->
+ mNotificationShadeWindowController.setRequestTopUi(
+ requestTopUi, componentTag))));
}
// ================================================================================