Loading services/core/java/com/android/server/wm/RecentsAnimationController.java +7 −2 Original line number Diff line number Diff line Loading @@ -151,6 +151,8 @@ public class RecentsAnimationController implements DeathRecipient { // Whether to take a screenshot when handling a deferred cancel private boolean mCancelDeferredWithScreenshot; @VisibleForTesting boolean mIsAddingTaskToTargets; @VisibleForTesting boolean mShouldAttachNavBarToAppDuringTransition; private boolean mNavigationBarAttachedToApp; Loading Loading @@ -375,7 +377,8 @@ public class RecentsAnimationController implements DeathRecipient { final long token = Binder.clearCallingIdentity(); try { synchronized (mService.getWindowManagerLock()) { restoreNavigationBarFromApp(moveHomeToTop); restoreNavigationBarFromApp( moveHomeToTop || mIsAddingTaskToTargets /* animate */); mService.mWindowPlacerLocked.requestTraversal(); } } finally { Loading Loading @@ -685,6 +688,7 @@ public class RecentsAnimationController implements DeathRecipient { void addTaskToTargets(Task task, OnAnimationFinishedCallback finishedCallback) { if (mRunner != null) { mIsAddingTaskToTargets = task != null; // No need to send task appeared when the task target already exists, or when the // task is being managed as a multi-window mode outside of recents (e.g. bubbles). if (isAnimatingTask(task) || skipAnimation(task)) { Loading Loading @@ -901,7 +905,8 @@ public class RecentsAnimationController implements DeathRecipient { removeWallpaperAnimation(wallpaperAdapter); } restoreNavigationBarFromApp(reorderMode == REORDER_MOVE_TO_TOP); restoreNavigationBarFromApp( reorderMode == REORDER_MOVE_TO_TOP || mIsAddingTaskToTargets /* animate */); // Clear any pending failsafe runnables mService.mH.removeCallbacks(mFailsafeRunnable); Loading services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java +25 −0 Original line number Diff line number Diff line Loading @@ -552,6 +552,31 @@ public class RecentsAnimationControllerTest extends WindowTestsBase { verify(transaction).reparent(navToken.getSurfaceControl(), parent.getSurfaceControl()); } @Test public void testAddTaskToTargets_expectAnimation() { setupForShouldAttachNavBarDuringTransition(); final ActivityRecord activity = createActivityRecord(mDefaultDisplay); final ActivityRecord homeActivity = createHomeActivity(); initializeRecentsAnimationController(mController, homeActivity); final WindowToken navToken = mDefaultDisplay.getDisplayPolicy().getNavigationBar().mToken; final SurfaceControl.Transaction transaction = navToken.getPendingTransaction(); verify(mController.mStatusBar).setNavigationBarLumaSamplingEnabled( eq(mDefaultDisplay.mDisplayId), eq(false)); verify(transaction).reparent(navToken.getSurfaceControl(), activity.getSurfaceControl()); verify(transaction).setLayer(navToken.getSurfaceControl(), Integer.MAX_VALUE); final WindowContainer parent = navToken.getParent(); mController.addTaskToTargets(createTask(mDefaultDisplay), (type, anim) -> {}); mController.cleanupAnimation(REORDER_MOVE_TO_ORIGINAL_POSITION); verify(mController).restoreNavigationBarFromApp(eq(true)); verify(mController.mStatusBar).setNavigationBarLumaSamplingEnabled( eq(mDefaultDisplay.mDisplayId), eq(true)); verify(transaction).setLayer(navToken.getSurfaceControl(), 0); } @Test public void testNotAttachNavigationBar_controlledByFadeRotationAnimation() { setupForShouldAttachNavBarDuringTransition(); Loading Loading
services/core/java/com/android/server/wm/RecentsAnimationController.java +7 −2 Original line number Diff line number Diff line Loading @@ -151,6 +151,8 @@ public class RecentsAnimationController implements DeathRecipient { // Whether to take a screenshot when handling a deferred cancel private boolean mCancelDeferredWithScreenshot; @VisibleForTesting boolean mIsAddingTaskToTargets; @VisibleForTesting boolean mShouldAttachNavBarToAppDuringTransition; private boolean mNavigationBarAttachedToApp; Loading Loading @@ -375,7 +377,8 @@ public class RecentsAnimationController implements DeathRecipient { final long token = Binder.clearCallingIdentity(); try { synchronized (mService.getWindowManagerLock()) { restoreNavigationBarFromApp(moveHomeToTop); restoreNavigationBarFromApp( moveHomeToTop || mIsAddingTaskToTargets /* animate */); mService.mWindowPlacerLocked.requestTraversal(); } } finally { Loading Loading @@ -685,6 +688,7 @@ public class RecentsAnimationController implements DeathRecipient { void addTaskToTargets(Task task, OnAnimationFinishedCallback finishedCallback) { if (mRunner != null) { mIsAddingTaskToTargets = task != null; // No need to send task appeared when the task target already exists, or when the // task is being managed as a multi-window mode outside of recents (e.g. bubbles). if (isAnimatingTask(task) || skipAnimation(task)) { Loading Loading @@ -901,7 +905,8 @@ public class RecentsAnimationController implements DeathRecipient { removeWallpaperAnimation(wallpaperAdapter); } restoreNavigationBarFromApp(reorderMode == REORDER_MOVE_TO_TOP); restoreNavigationBarFromApp( reorderMode == REORDER_MOVE_TO_TOP || mIsAddingTaskToTargets /* animate */); // Clear any pending failsafe runnables mService.mH.removeCallbacks(mFailsafeRunnable); Loading
services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java +25 −0 Original line number Diff line number Diff line Loading @@ -552,6 +552,31 @@ public class RecentsAnimationControllerTest extends WindowTestsBase { verify(transaction).reparent(navToken.getSurfaceControl(), parent.getSurfaceControl()); } @Test public void testAddTaskToTargets_expectAnimation() { setupForShouldAttachNavBarDuringTransition(); final ActivityRecord activity = createActivityRecord(mDefaultDisplay); final ActivityRecord homeActivity = createHomeActivity(); initializeRecentsAnimationController(mController, homeActivity); final WindowToken navToken = mDefaultDisplay.getDisplayPolicy().getNavigationBar().mToken; final SurfaceControl.Transaction transaction = navToken.getPendingTransaction(); verify(mController.mStatusBar).setNavigationBarLumaSamplingEnabled( eq(mDefaultDisplay.mDisplayId), eq(false)); verify(transaction).reparent(navToken.getSurfaceControl(), activity.getSurfaceControl()); verify(transaction).setLayer(navToken.getSurfaceControl(), Integer.MAX_VALUE); final WindowContainer parent = navToken.getParent(); mController.addTaskToTargets(createTask(mDefaultDisplay), (type, anim) -> {}); mController.cleanupAnimation(REORDER_MOVE_TO_ORIGINAL_POSITION); verify(mController).restoreNavigationBarFromApp(eq(true)); verify(mController.mStatusBar).setNavigationBarLumaSamplingEnabled( eq(mDefaultDisplay.mDisplayId), eq(true)); verify(transaction).setLayer(navToken.getSurfaceControl(), 0); } @Test public void testNotAttachNavigationBar_controlledByFadeRotationAnimation() { setupForShouldAttachNavBarDuringTransition(); Loading