diff options
| author | 2021-06-28 16:18:54 -0700 | |
|---|---|---|
| committer | 2021-06-30 10:31:12 -0700 | |
| commit | 9f4e80879e427e28409281c08bacb47667233f3a (patch) | |
| tree | 59cfd5d5f33b7a5a2d67e00da1d39cebb454f03e | |
| parent | aa1b081a72acd9721715b1e97a0a51fffa5b5be5 (diff) | |
Don't reorder tasks if the recents animation is not running to home
- This fixes a regression from ag/15090191, in the case where there is
a 3p launcher, then we don't want to ever move home to top
Bug: 140749967
Bug: 185643608
Test: FallbackRecentsTests#testOverview
Test: atest RecentsAnimationControllerTest
Change-Id: Iaab4a3431be9c33908c5c8b3354e793ec321389a
| -rw-r--r-- | services/core/java/com/android/server/wm/RecentsAnimationController.java | 7 | ||||
| -rw-r--r-- | services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java | 4 |
2 files changed, 7 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/wm/RecentsAnimationController.java b/services/core/java/com/android/server/wm/RecentsAnimationController.java index 710dd552f72d..737ef338f9b2 100644 --- a/services/core/java/com/android/server/wm/RecentsAnimationController.java +++ b/services/core/java/com/android/server/wm/RecentsAnimationController.java @@ -16,6 +16,7 @@ package com.android.server.wm; +import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME; import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY; import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; @@ -823,8 +824,10 @@ public class RecentsAnimationController implements DeathRecipient { if (mCanceled) { return; } - cancelAnimation(mWillFinishToHome ? REORDER_MOVE_TO_TOP : REORDER_KEEP_IN_PLACE, - true /* screenshot */, "cancelAnimationForHomeStart"); + final int reorderMode = mTargetActivityType == ACTIVITY_TYPE_HOME && mWillFinishToHome + ? REORDER_MOVE_TO_TOP + : REORDER_KEEP_IN_PLACE; + cancelAnimation(reorderMode, true /* screenshot */, "cancelAnimationForHomeStart"); } /** diff --git a/services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java b/services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java index 03944172db7c..a034ac267287 100644 --- a/services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java +++ b/services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java @@ -683,12 +683,12 @@ public class RecentsAnimationControllerTest extends WindowTestsBase { @Test public void testCancelForStartHome() throws Exception { mWm.setRecentsAnimationController(mController); + final ActivityRecord homeActivity = createHomeActivity(); final ActivityRecord activity = createActivityRecord(mDefaultDisplay); final WindowState win1 = createWindow(null, TYPE_BASE_APPLICATION, activity, "win1"); activity.addWindow(win1); - RecentsAnimationController.TaskAnimationAdapter adapter = mController.addAnimation( - activity.getTask(), false /* isRecentTaskInvisible */); + initializeRecentsAnimationController(mController, homeActivity); mController.setWillFinishToHome(true); // Verify cancel is called with a snapshot and that we've created an overlay |