From 84ce067c7f7e763bb064611772b1b743cd3464a3 Mon Sep 17 00:00:00 2001 From: Riddle Hsu Date: Tue, 5 May 2020 20:55:06 +0800 Subject: [PATCH 1/2] Remove unnecessary effects of wallpaper_open_exit The translate animation should move the content outside the screen, so the alpha effect is not visible. And the scale is always 1. This also aligns the duration with wallpaper_open_enter to 225ms. Bug: 151709552 Test: Finish a task which will return to an activity with wallpaper. Change-Id: If1854a77de1410e65da478f2b4c5a645357e6053 --- core/res/res/anim/wallpaper_open_exit.xml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/core/res/res/anim/wallpaper_open_exit.xml b/core/res/res/anim/wallpaper_open_exit.xml index 696912b257ac5..955663fa48e91 100644 --- a/core/res/res/anim/wallpaper_open_exit.xml +++ b/core/res/res/anim/wallpaper_open_exit.xml @@ -20,21 +20,8 @@ - - - - \ No newline at end of file From 3691c1fbc9ad09e3192bd28b7a794ccf9dee68a7 Mon Sep 17 00:00:00 2001 From: Riddle Hsu Date: Tue, 5 May 2020 21:27:04 +0800 Subject: [PATCH 2/2] Revert cancellation of animation in old rotation In most of cases, the duration of closing apps should not be longer than the opening apps, otherwise that should be fixed. The cancellation is too rough and not safe because it may lead to unpredictable flow such as interrupt recents animation. Fixes: 155029580 Test: DisplayContentTests#testApplyTopFixedRotationTransform Change-Id: Ifb23a73ac2635cc7631324cee679e5a663250f99 --- .../com/android/server/wm/DisplayContent.java | 18 +++--------------- .../android/server/wm/DisplayContentTests.java | 10 ---------- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index 72e38386f1f98..864d96f0fea06 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -5241,25 +5241,13 @@ class DisplayContent extends WindowContainer { - if (a.nowVisible && a != mFixedRotationLaunchingApp - && a.getWindowConfiguration().getRotation() != newRotation) { - final WindowContainer w = a.getAnimatingContainer(); - if (w != null) { - w.cancelAnimation(); - } - } - }); - - mFixedRotationLaunchingApp.finishFixedRotationTransform( + rotatedLaunchingApp.finishFixedRotationTransform( () -> applyRotation(oldRotation, newRotation)); mFixedRotationLaunchingApp = null; } diff --git a/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java b/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java index cba89d0aea2d2..ac95a817bec91 100644 --- a/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java @@ -57,7 +57,6 @@ import static com.android.dx.mockito.inline.extended.ExtendedMockito.same; import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn; import static com.android.dx.mockito.inline.extended.ExtendedMockito.times; import static com.android.dx.mockito.inline.extended.ExtendedMockito.verify; -import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_APP_TRANSITION; import static com.android.server.wm.WindowContainer.POSITION_TOP; import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_NORMAL; @@ -1068,13 +1067,6 @@ public class DisplayContentTests extends WindowTestsBase { mDisplayContent.computeScreenConfiguration(config); mDisplayContent.onRequestedOverrideConfigurationChanged(config); - final ActivityRecord closingApp = new ActivityTestsBase.StackBuilder(mWm.mRoot) - .setDisplay(mDisplayContent).setOnTop(false).build().getTopMostActivity(); - closingApp.nowVisible = true; - closingApp.startAnimation(closingApp.getPendingTransaction(), mock(AnimationAdapter.class), - false /* hidden */, ANIMATION_TYPE_APP_TRANSITION); - assertTrue(closingApp.isAnimating()); - final ActivityRecord app = mAppWindow.mActivityRecord; mDisplayContent.prepareAppTransition(WindowManager.TRANSIT_ACTIVITY_OPEN, false /* alwaysKeepCurrent */); @@ -1135,8 +1127,6 @@ public class DisplayContentTests extends WindowTestsBase { // The display should be rotated after the launch is finished. mDisplayContent.mAppTransition.notifyAppTransitionFinishedLocked(app.token); - // The animation in old rotation should be cancelled. - assertFalse(closingApp.isAnimating()); // The fixed rotation should be cleared and the new rotation is applied to display. assertFalse(app.hasFixedRotationTransform()); assertFalse(app2.hasFixedRotationTransform());