Loading services/core/java/com/android/server/wm/AppWindowToken.java +8 −3 Original line number Diff line number Diff line Loading @@ -2432,14 +2432,19 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree } } private boolean shouldAnimate(int transit) { @VisibleForTesting boolean shouldAnimate(int transit) { final boolean isSplitScreenPrimary = getWindowingMode() == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY; final boolean allowSplitScreenPrimaryAnimation = transit != TRANSIT_WALLPAPER_OPEN; // Don't animate when the task runs recents animation. // Don't animate while the task runs recents animation but only if we are in the mode // where we cancel with deferred screenshot, which means that the controller has // transformed the task. final RecentsAnimationController controller = mWmService.getRecentsAnimationController(); if (controller != null && controller.isAnimatingTask(getTask())) { if (controller != null && controller.isAnimatingTask(getTask()) && controller.shouldCancelWithDeferredScreenshot()) { return false; } Loading services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java +20 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD; import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN; import static android.view.Display.DEFAULT_DISPLAY; import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION; import static android.view.WindowManager.TRANSIT_ACTIVITY_CLOSE; import static com.android.dx.mockito.inline.extended.ExtendedMockito.atLeast; import static com.android.dx.mockito.inline.extended.ExtendedMockito.doNothing; Loading Loading @@ -166,6 +167,25 @@ public class RecentsAnimationControllerTest extends WindowTestsBase { verify(mAnimationCallbacks).onAnimationFinished(REORDER_KEEP_IN_PLACE, true, false); } @Test public void testShouldAnimateWhenNoCancelWithDeferredScreenshot() { mWm.setRecentsAnimationController(mController); final AppWindowToken appWindow = createAppWindowToken(mDisplayContent, WINDOWING_MODE_FULLSCREEN, ACTIVITY_TYPE_STANDARD); final WindowState win1 = createWindow(null, TYPE_BASE_APPLICATION, appWindow, "win1"); appWindow.addWindow(win1); assertEquals(appWindow.getTask().getTopVisibleAppToken(), appWindow); assertEquals(appWindow.findMainWindow(), win1); mController.addAnimation(appWindow.getTask(), false /* isRecentTaskInvisible */); assertTrue(mController.isAnimatingTask(appWindow.getTask())); // Assume appWindow transition should animate when no // IRecentsAnimationController#setCancelWithDeferredScreenshot called. assertFalse(mController.shouldCancelWithDeferredScreenshot()); assertTrue(appWindow.shouldAnimate(TRANSIT_ACTIVITY_CLOSE)); } private static void verifyNoMoreInteractionsExceptAsBinder(IInterface binder) { verify(binder, atLeast(0)).asBinder(); verifyNoMoreInteractions(binder); Loading Loading
services/core/java/com/android/server/wm/AppWindowToken.java +8 −3 Original line number Diff line number Diff line Loading @@ -2432,14 +2432,19 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree } } private boolean shouldAnimate(int transit) { @VisibleForTesting boolean shouldAnimate(int transit) { final boolean isSplitScreenPrimary = getWindowingMode() == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY; final boolean allowSplitScreenPrimaryAnimation = transit != TRANSIT_WALLPAPER_OPEN; // Don't animate when the task runs recents animation. // Don't animate while the task runs recents animation but only if we are in the mode // where we cancel with deferred screenshot, which means that the controller has // transformed the task. final RecentsAnimationController controller = mWmService.getRecentsAnimationController(); if (controller != null && controller.isAnimatingTask(getTask())) { if (controller != null && controller.isAnimatingTask(getTask()) && controller.shouldCancelWithDeferredScreenshot()) { return false; } Loading
services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java +20 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD; import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN; import static android.view.Display.DEFAULT_DISPLAY; import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION; import static android.view.WindowManager.TRANSIT_ACTIVITY_CLOSE; import static com.android.dx.mockito.inline.extended.ExtendedMockito.atLeast; import static com.android.dx.mockito.inline.extended.ExtendedMockito.doNothing; Loading Loading @@ -166,6 +167,25 @@ public class RecentsAnimationControllerTest extends WindowTestsBase { verify(mAnimationCallbacks).onAnimationFinished(REORDER_KEEP_IN_PLACE, true, false); } @Test public void testShouldAnimateWhenNoCancelWithDeferredScreenshot() { mWm.setRecentsAnimationController(mController); final AppWindowToken appWindow = createAppWindowToken(mDisplayContent, WINDOWING_MODE_FULLSCREEN, ACTIVITY_TYPE_STANDARD); final WindowState win1 = createWindow(null, TYPE_BASE_APPLICATION, appWindow, "win1"); appWindow.addWindow(win1); assertEquals(appWindow.getTask().getTopVisibleAppToken(), appWindow); assertEquals(appWindow.findMainWindow(), win1); mController.addAnimation(appWindow.getTask(), false /* isRecentTaskInvisible */); assertTrue(mController.isAnimatingTask(appWindow.getTask())); // Assume appWindow transition should animate when no // IRecentsAnimationController#setCancelWithDeferredScreenshot called. assertFalse(mController.shouldCancelWithDeferredScreenshot()); assertTrue(appWindow.shouldAnimate(TRANSIT_ACTIVITY_CLOSE)); } private static void verifyNoMoreInteractionsExceptAsBinder(IInterface binder) { verify(binder, atLeast(0)).asBinder(); verifyNoMoreInteractions(binder); Loading