Merge "Send request top ui to SystemUI when creating splash screen." into sc-v2-dev am: 421c7d25b8 am: cccb673f8c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15684586 Change-Id: I8a41c17eb8d6a30d7da92526477ed2d0388e142f
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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))));
|
||||
}
|
||||
|
||||
// ================================================================================
|
||||
|
||||
Reference in New Issue
Block a user