From 4b4fc236ffdbb4287bad01588ceebf5313c8d171 Mon Sep 17 00:00:00 2001 From: Vadim Caen Date: Tue, 26 May 2020 20:17:15 +0800 Subject: [PATCH] System Bars animation for fixed rotation transform Fade out system bars when the fixed transform is starting and fade them in once its finished. In other words, if mFixedRotationLaunchingApp is set, the hide (fade out) animation will start. And if mFixedRotationLaunchingApp is cleared or seamless rotation is done for fixed rotation, the show (fade in) animation will start. Note a special case: the fixed rotation app hides the system bars, so there may be no window to rotate. Then the show animation will apply immediately (though they are invisible) to make sure the bars can be visible by transient state. Bug: 150676212 Bug: 156864004 Test: Manual: open and close a landscape application, and open and immediately cancel opening animation. Manual: open a landscape application which hides status bar and navigation bar. The bars should still be visible after swiping from edge of screen. Test: WmTests:DisplayContentTests#testApplyTopFixedRotationTransform Change-Id: Ic326b4bda44b39c875aeb27f33fba31a5cfcfc66 --- .../com/android/server/wm/DisplayContent.java | 21 +++ .../android/server/wm/DisplayRotation.java | 6 + .../wm/FixedRotationAnimationController.java | 166 ++++++++++++++++++ .../android/server/wm/SurfaceAnimator.java | 9 +- .../server/wm/DisplayContentTests.java | 15 +- 5 files changed, 215 insertions(+), 2 deletions(-) create mode 100644 services/core/java/com/android/server/wm/FixedRotationAnimationController.java diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index d93e9764146fd..94f21e63d3d29 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -498,6 +498,8 @@ class DisplayContent extends WindowContainer