Only use WM screen rotation animation on default display

Configuration changes cause WindowManagerService to freeze any displays
with activities, which causes a screen rotation animation to be applied
to those displays. However, ScreenRotationAnimation always uses the default
display, so it shouldn't be used for non-default displays.

Bug: 63682998
Test: manual
Change-Id: Ic66c6e47c030393fbbe5ecbfecd90d4929871349
This commit is contained in:
David Stevens
2017-08-01 17:54:23 -07:00
parent 0a0bc5f89d
commit 848cf82aaf
2 changed files with 3 additions and 3 deletions

View File

@@ -280,7 +280,7 @@ class ScreenRotationAnimation {
// capture a screenshot into the surface we just created
Surface sur = new Surface();
sur.copyFrom(mSurfaceControl);
// FIXME: we should use the proper display
// TODO(multidisplay): we should use the proper display
SurfaceControl.screenshot(SurfaceControl.getBuiltInDisplay(
SurfaceControl.BUILT_IN_DISPLAY_ID_MAIN), sur);
mSurfaceControl.setLayerStack(display.getLayerStack());

View File

@@ -6047,7 +6047,8 @@ public class WindowManagerService extends IWindowManager.Stub
Debug.startMethodTracing(file.toString(), 8 * 1024 * 1024);
}
if (CUSTOM_SCREEN_ROTATION) {
// TODO(multidisplay): rotation on non-default displays
if (CUSTOM_SCREEN_ROTATION && displayContent.isDefaultDisplay) {
mExitAnimId = exitAnim;
mEnterAnimId = enterAnim;
ScreenRotationAnimation screenRotationAnimation =
@@ -6059,7 +6060,6 @@ public class WindowManagerService extends IWindowManager.Stub
// Check whether the current screen contains any secure content.
boolean isSecure = displayContent.hasSecureWindowOnScreen();
// TODO(multidisplay): rotation on main screen only.
displayContent.updateDisplayInfo();
screenRotationAnimation = new ScreenRotationAnimation(mContext, displayContent,
mFxSession, inTransaction, mPolicy.isDefaultOrientationForced(), isSecure,