From 844e29aab28ecfa4044c63dc1698564f08a21c88 Mon Sep 17 00:00:00 2001 From: Riddle Hsu Date: Mon, 20 Apr 2020 21:06:30 +0800 Subject: [PATCH] Use current display surface size for custom rotation animation The animation starts after the display has been rotated, so the current size is available to use as how the normal rotation is configured. Fixes: 151135285 Test: Rotate an activity with ROTATION_ANIMATION_CROSSFADE and check there is no split effect in the center of screen. Change-Id: I68cc4c83983210e87c44014817ff4b84305ba32d --- .../java/com/android/server/wm/ScreenRotationAnimation.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/wm/ScreenRotationAnimation.java b/services/core/java/com/android/server/wm/ScreenRotationAnimation.java index 5f33ea170923d..9d44cad702815 100644 --- a/services/core/java/com/android/server/wm/ScreenRotationAnimation.java +++ b/services/core/java/com/android/server/wm/ScreenRotationAnimation.java @@ -597,8 +597,8 @@ class ScreenRotationAnimation { return startAnimation(initializeBuilder() .setSurfaceControl(mScreenshotLayer) .setAnimationLeashParent(mDisplayContent.getOverlayLayer()) - .setWidth(mWidth) - .setHeight(mHeight) + .setWidth(mDisplayContent.getSurfaceWidth()) + .setHeight(mDisplayContent.getSurfaceHeight()) .build(), createWindowAnimationSpec(mRotateAlphaAnimation), this::onAnimationEnd);