Run reveal animation from relative top of window
The window frame may not align with its parent if the app
doesn't draw under the display cutout. So the shift-up reveal
animation for the app main window needs to subtract the offset
to align with its parent.
Otherwise there will be a gap between the main window and its
container, e.g. expect to animate top from 40px to 0px but
it becomes 60px to 20px, then the 20px gap may be a strange
translucent area.
Bug: 317319213
Bug: 323114927
Test: On a device with a display cutout on top.
Launch an activity with style windowFullscreen=true and
windowLayoutInDisplayCutoutMode=default.
There won't have a gap between the cutout area and app
window when playing the open animation.
Change-Id: I2ac5b0a5301af78ae26c7373d2edae4c0c0ab0f2
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashScreenExitAnimationUtils.java b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashScreenExitAnimationUtils.java
index e86b62d..6325c68 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashScreenExitAnimationUtils.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashScreenExitAnimationUtils.java
@@ -390,7 +390,7 @@
SurfaceControl firstWindowSurface, ViewGroup splashScreenView,
TransactionPool transactionPool, Rect firstWindowFrame,
int mainWindowShiftLength, float roundedCornerRadius) {
- mFromYDelta = fromYDelta - roundedCornerRadius;
+ mFromYDelta = fromYDelta - Math.max(firstWindowFrame.top, roundedCornerRadius);
mToYDelta = toYDelta;
mOccludeHoleView = occludeHoleView;
mApplier = new SyncRtSurfaceTransactionApplier(occludeHoleView);